Loading page
Configuration flags read by the API and worker containers.
Every flag below has a working default — you don't need an .env file to
boot AudioLens locally. This page is the full reference for when you do
need to change one, grouped by what it controls.
| Variable | Default | Purpose |
|---|---|---|
ENVIRONMENT | development | production enforces secure cookies and HTTPS origins |
CODE_VERSION | development | Cache identity component |
| Variable | Default | Purpose |
|---|---|---|
SESSION_TTL_SECONDS / JOB_TTL_SECONDS | 86400 | Session and job expiry (24h) |
SESSION_COOKIE_NAME | sid | Session cookie name |
COOKIE_SECURE | false | Set true behind HTTPS |
COOKIE_SAMESITE | lax | lax / strict / none |
COOKIE_DOMAIN | unset | Leave unset for localhost |
ALLOWED_ORIGINS | http://localhost:8080,http://127.0.0.1:8080 | CORS origins — * is rejected |
| Variable | Default | Purpose |
|---|---|---|
REDIS_URL | redis://localhost:6379/0 | Sessions / cache (DB0) |
JOB_REDIS_URL | redis://localhost:6379/1 | Job metadata (DB1) |
CELERY_BROKER_URL | redis://localhost:6379/2 | Celery broker (DB2) |
CELERY_RESULT_BACKEND | redis://localhost:6379/3 | Celery results (DB3) |
STORAGE_BACKEND | local | local or s3 |
STORAGE_LOCAL_ROOT | shared-storage | Local storage path |
S3_BUCKET | unset | S3-compatible bucket name |
S3_ENDPOINT_URL | unset | S3-compatible endpoint |
S3_REGION | unset (us-east-1 if using AWS defaults) | S3 region |
S3_ACCESS_KEY_ID | unset | S3 access key |
S3_SECRET_ACCESS_KEY | unset | S3 secret key |
REDIS_MAXMEMORY (compose-level) | 1gb | Redis memory cap |
| Variable | Default | Purpose |
|---|---|---|
MAX_UPLOAD_BYTES | 104857600 (100 MB) | Max upload size |
MAX_AUDIO_DURATION_SECONDS | 600 (10 min) | Max clip length |
MAX_SALIENCY_SECONDS | 12 | Saliency analysis window (gradcam / lime) |
MAX_SALIENCY_SECONDS_SHAP | 6 | Stricter SHAP window (memory guard) |
SALIENCY_SHAP_SAMPLES | 8 | SHAP samples per call |
| Variable | Default | Purpose |
|---|---|---|
ML_DEVICE | auto | auto / cpu / mps / cuda / cuda:N / rocm — see Device selection |
ATTENTION_FORCE_CPU | true | Works around a GPU Triton segfault in attention computation |
ENABLE_LEGACY_SYNC_INFERENCE | false | Legacy synchronous routes (410 otherwise); refused in production |
API_V1_PREFIX | /api/v1 | Set in code only |
| Variable | Default | Purpose |
|---|---|---|
TASK_SOFT_TIME_LIMIT_SECONDS / TASK_TIME_LIMIT_SECONDS | 3300 / 3600 | Worker task timeout |
BROKER_VISIBILITY_TIMEOUT_SECONDS | derived | Must stay ordered after the time limits above |
STALE_JOB_SECONDS | derived | Threshold the reaper uses to consider a job stale |
STALE_JOB_SWEEP_SECONDS | 300 | Reaper sweep interval |
| Variable | Default | Purpose |
|---|---|---|
MODEL_REGISTRY_MAX_ENTRIES | 3 | Model variants a worker keeps loaded at once |
MODEL_REGISTRY_IDLE_SECONDS | 1800 | Idle model eviction time |
| Variable | Default | Purpose |
|---|---|---|
FR10_MIN_GROUP_SIZE | 8 | Minimum items per group for a fairness slice |
FR10_MIN_SPEAKERS_PER_GROUP | 2 | Minimum distinct speakers per group |
| Variable | Default | Purpose |
|---|---|---|
VITE_API_BASE_URL | unset (defaults to page host on :8000) | API base URL for production frontend builds |
See Self-hosting for how these get set in practice —
.env files, compose overrides, or inline on the boot command.