Skip to content

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.

VariableDefaultConsumer / behavior
API_KEYMust be providedShared bearer authentication; placeholders are not rejected consistently
ALLOWED_ORIGINSlocalhost/127.0.0.1 on ports 3000 and 8000CORS middleware; not network access control
OLLAMA_HOSThttp://localhost:11434Model client and generation HTTP endpoint
OLLAMA_MODELqwen3.5:2bModel when routing is disabled or initialization fails
OLLAMA_TIMEOUT900 secondsGeneration HTTP timeout
OLLAMA_THINKfalseGeneration payload think option
OLLAMA_TEMPERATURE0.7Generation option
OLLAMA_CONTEXT_SIZE8192Generation context option
OLLAMA_MAX_TOKENS2048Generation prediction limit
ENABLE_MODEL_ROUTINGtrueInitialize and use router
ENABLE_CONVERSATION_MEMORYtrueStore/retrieve conversation state; disable for first-use lab
CONVERSATION_RETENTION_DAYS7Expiry assigned to new query-created threads
CONVERSATION_DB_PATHdata/conversations.db relative to project codeSQLite 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”
SettingActual status
DEFAULT_MODELRead/logged; router rules still hard-code their default
RATE_LIMIT_*Not consumed by backend rate limiting
CHROMA_DB_PATH, CHROMA_COLLECTION_NAMEBackend uses fixed relative path and collection names
API_HOST, API_PORTNot wired into the checked-in startup commands; configure Uvicorn/service arguments
LOG_LEVELBackend logging is configured at INFO in code
BACKUP_RETENTION_DAYS, BACKUP_SCHEDULEDo 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.

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.