# Backend environment variables # Copy this to .env and fill in values # ── Core Application ───────────────────────────────────────────────────────── # Application stage: 'development' or 'production' # Production mode has stricter CORS defaults APP_STAGE=production # Storage directory (default: storage/ in project root) # For Hugging Face Spaces, use: STORAGE_DIR=/tmp/ascent-storage STORAGE_DIR=storage # ── MongoDB (optional — omit to run in flat-file mode only) ───────────────── MONGODB_URL=mongodb://localhost:27017 MONGODB_DB=ai_interview_sim # ── LLM Configuration ─────────────────────────────────────────────────────── # Pre-warm Qwen2.5-7B at startup (adds ~90s to startup time) LLM_EAGER_LOAD=false # HuggingFace token (required for CPU Spaces to use HF Inference API) # Without this on CPU, LLM scoring falls back to cosine similarity only # HF_TOKEN=hf_... # ── Answer Scoring Limits ─────────────────────────────────────────────────── # Maximum answer length in characters (~2000 words at 10000 chars) # Prevents abuse and controls LLM API costs MAX_ANSWER_LENGTH=10000 # Minimum answer length to prevent spam/empty submissions MIN_ANSWER_LENGTH=10 # ── Security ───────────────────────────────────────────────────────────────── # CORS: Comma-separated list of allowed origins # Example: ALLOWED_ORIGINS=https://your-app.vercel.app,https://app.example.com # If not set, defaults based on APP_STAGE (development allows localhost) ALLOWED_ORIGINS= # Secret for cleanup endpoint authentication (required for production) # Generate with: openssl rand -hex 32 CLEANUP_SECRET= # Secret for admin endpoint authentication (required for production) # Generate with: openssl rand -hex 32 ADMIN_SECRET= # ── Logging ────────────────────────────────────────────────────────────────── # Python logging level: DEBUG, INFO, WARNING, ERROR LOG_LEVEL=INFO # ── Firebase Auth ──────────────────────────────────────────────────────────── # Path to your Firebase service account JSON, OR the JSON content as a string # FIREBASE_SERVICE_ACCOUNT=/path/to/serviceAccountKey.json # ── AI Gateway (Orchestration Layer) ───────────────────────────────────────── # HuggingFace model for CPU/API inference (default: Qwen2.5-72B-Instruct) HF_API_MODEL=Qwen/Qwen2.5-72B-Instruct # Per-provider timeout in seconds before failover to next provider LLM_TIMEOUT_SECONDS=30 # Number of retries per provider before switching (0 = try once then switch) LLM_MAX_RETRIES=2 # Base delay for exponential backoff between retries (seconds) LLM_RETRY_BASE_DELAY=1.5