Configuration reference
Set backend variables in .env or the process environment before startup. Restart the backend to apply startup settings. Process variables take precedence over load_dotenv() defaults. Protect .env and never treat an example file as proof a setting is implemented.
Backend settings
Section titled “Backend settings”| Variable | Default | Consumer / behavior |
|---|---|---|
API_KEY | Must be provided | Shared bearer authentication; placeholders are not rejected consistently |
ALLOWED_ORIGINS | localhost/127.0.0.1 on ports 3000 and 8000 | CORS middleware; not network access control |
OLLAMA_HOST | http://localhost:11434 | Model client and generation HTTP endpoint |
OLLAMA_MODEL | qwen3.5:2b | Model when routing is disabled or initialization fails |
OLLAMA_TIMEOUT | 900 seconds | Generation HTTP timeout |
OLLAMA_THINK | false | Generation payload think option |
OLLAMA_TEMPERATURE | 0.7 | Generation option |
OLLAMA_CONTEXT_SIZE | 8192 | Generation context option |
OLLAMA_MAX_TOKENS | 2048 | Generation prediction limit |
ENABLE_MODEL_ROUTING | true | Initialize and use router |
ENABLE_CONVERSATION_MEMORY | true | Store/retrieve conversation state; disable for first-use lab |
CONVERSATION_RETENTION_DAYS | 7 | Expiry assigned to new query-created threads |
CONVERSATION_DB_PATH | data/conversations.db relative to project code | SQLite path; module reads this before app calls load_dotenv() |
For a custom database path, export it into the process environment before starting the service. Setting it only in .env can be too late because the database module is imported first.
Settings that do not do what their names suggest
Section titled “Settings that do not do what their names suggest”| Setting | Actual status |
|---|---|
DEFAULT_MODEL | Read/logged; router rules still hard-code their default |
RATE_LIMIT_* | Not consumed by backend rate limiting |
CHROMA_DB_PATH, CHROMA_COLLECTION_NAME | Backend uses fixed relative path and collection names |
API_HOST, API_PORT | Not wired into the checked-in startup commands; configure Uvicorn/service arguments |
LOG_LEVEL | Backend logging is configured at INFO in code |
BACKUP_RETENTION_DAYS, BACKUP_SCHEDULE | Do not assume the backup script reads these or installs a schedule |
Resource limits belong to the actual container/service configuration. An environment variable alone does not enforce them. Script-specific settings should be checked in the script you invoke.
First-use lab choices
Section titled “First-use lab choices”Use a unique API_KEY, ENABLE_CONVERSATION_MEMORY=false, and a localhost Ollama host. Keep routing enabled after installing both models. See installation for the explicit localhost server command.
Next: Model behavior and storage paths.