Skip to content

Configuration reference

Every variable the stack reads, grouped by service, with where it is read and whether it has a default. Authentication and model setup are covered in prose at the end.

Environment files

There are two environment modes:

  • Full Docker stack (infra/scripts/start-all.sh) — reads the repository-root .env, created from .env.template on the first run. Compose maps values into each container and uses Docker service names for internal URLs. Crawlee and the dev Keycloak container load the whole .env via env_file; every other container receives exactly the variables listed in its environment: block.
  • Local development (infra/scripts/start-dev.sh) — Docker runs only the infrastructure; the app processes read their own files, apps/backend/.env, apps/frontend/.env and apps/crawlee/.env, which the script creates and appends missing keys to without overwriting existing values.

Four template files exist. The In template column below says which one carries the variable:

Value File Who reads it
root .env.template copied to .env by start-all.sh; also sourced by start-dev.sh
worker apps/backend/ai_ta_backend/rabbitmq/.env.template the ingest worker when run on its own (python worker.py)
none — read from the process environment only

apps/backend/.env.template and apps/frontend/.env.template are dev reference files: no script reads them (start-dev.sh writes the app .env files itself), so a variable that appears only there has no effect on either stack.

Never commit .env files

Environment files contain secrets. They are gitignored — keep it that way.

Read by uses three columns: full (docker-compose.yaml), dev (docker-compose.dev.yaml and the app .env files start-dev.sh writes) and sim (docker-compose.sim.yaml). Required means Compose refuses to start without it (:?).

Core secrets

Change all of these before any non-local use.

Variable Read by Required or default In template
POSTGRES_PASSWORD full, dev full: no default; dev: password root
INGEST_REDIS_PASSWORD full, dev no default root
QDRANT_API_KEY full, dev no default; must match api_key in qdrant_config.yaml root
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY full, dev no default (template: minioadmin) root
KEYCLOAK_ADMIN_PASSWORD full, dev, sim dev/sim: admin; full: no default root
ENCRYPTION_MASTER_KEY full, dev generated by both start scripts on first run; the frontend, backend and worker must share one value root

ENCRYPTION_MASTER_KEY encrypts each chatbot's stored Sim API key and the external-connection configs. Changing it later means every chatbot's Sim key has to be re-entered.

Names and ports

Variable Read by Required or default In template
POSTGRES_USER / POSTGRES_DATABASE full, dev postgres root
S3_BUCKET_NAME full, dev uiuc-chat root
QDRANT_COLLECTION_NAME full, dev illinois_chat (template: illinois-chat-qwen) root
QDRANT_VECTOR_SIZE full, dev (start scripts) 4096 none
AWS_REGION full, dev us-east-1 root
FRONTEND_PORT full 3000 root
CRAWLEE_PORT full 3345 root
POSTGRES_PORT full 5432 root
KEYCLOAK_DB_PORT full 5433 root
PUBLIC_MINIO_API_PORT / PUBLIC_MINIO_DASHBOARD_PORT dev 10000 / 9001 root
DOCKER_INTERNAL_MINIO_API_PORT / DOCKER_INTERNAL_MINIO_DASHBOARD_PORT dev 10000 / 9001 root
MINIO_ENDPOINT, MINIO_PUBLIC_ENDPOINT, MINIO_URL dev (app .env files) http://localhost:10000; always the API port, never the console root
RABBITMQ_USER / RABBITMQ_PASS full, dev guest none
DRIZZLE_MASTERPASS dev your_master_password (drizzle-gateway on port 4983) none

On the full stack the object-storage service (minio, running the Silo image) listens on ports 9000 (API) and 9001 (console) and these MINIO_* endpoints are set by Compose, so the root-template values apply only to the dev stack.

Authentication (Keycloak)

Variable Read by Required or default In template
KEYCLOAK_ADMIN_USERNAME full, dev, sim admin root
NEXT_PUBLIC_KEYCLOAK_URL dev http://localhost:8080/ (full stack: hardcoded build arg) root
NEXT_PUBLIC_KEYCLOAK_REALM dev, sim illinois_chat_realm (full stack: hardcoded build arg) root
NEXT_PUBLIC_KEYCLOAK_CLIENT_ID dev illinois_chat (full stack: hardcoded build arg) root
NEXT_PUBLIC_USE_ILLINOIS_CHAT_CONFIG dev True (full stack: hardcoded build arg) root
NEXT_PUBLIC_SIGNING_KEY dev empty root
SUPER_ADMIN_EMAILS full, dev empty; comma-separated root
NEXT_PUBLIC_SUPER_ADMIN_EMAILS dev empty; set to the same value as SUPER_ADMIN_EMAILS root
DEFAULT_COURSE_ADMINS full, dev empty; comma-separated admins added to every new chatbot (backend) root

NEXT_PUBLIC_SIGNING_KEY encrypts the provider API keys chatbots store on their LLMs page. Without it those keys are stored in plaintext.

Illinois Chat uses Keycloak for authentication. The Docker stack bootstraps a ready-to-use realm from infra/keycloak/realms/:

  • Realm: illinois_chat_realm
  • Client ID: illinois_chat
  • Admin console: http://localhost:8080 (log in with KEYCLOAK_ADMIN_USERNAME / KEYCLOAK_ADMIN_PASSWORD)

The frontend authenticates users via OIDC against this realm. User records live in Postgres. Typical customizations in the Keycloak admin console:

  • Identity providers — federate with an institution's SSO (SAML/OIDC) so users log in with existing accounts.
  • User federation — connect LDAP/Active Directory.
  • Theme — the Illinois Chat login theme ships in infra/keycloak/theme/.

Change the admin password

The default Keycloak admin password is admin. Change it before exposing the stack anywhere.

Models and embeddings

Variable Read by Required or default In template
EMBEDDING_MODEL full, dev template Qwen/Qwen3-Embedding-8B; when empty the code falls back to text-embedding-ada-002 (1536 dimensions, which do not fit the 4096-dimension embeddings column) root, worker
EMBEDDING_API_BASE full, dev template http://host.docker.internal:11434/v1; when empty the code falls back to https://api.openai.com/v1 root, worker
ALLOWED_EMBEDDING_PROVIDERS full, dev openai,ollama; providers an external connection may use worker
NCSA_HOSTED_API_KEY full, dev empty root, worker
NCSA_HOSTED_VLM_BASE_URL full, dev empty; enables the hosted default tier of tool routing root
TOOL_ROUTER_MODEL_ID dev empty; model used for tool routing on the hosted endpoint. Not passed by Compose, so the full stack always uses the hosted default model root
OLLAMA_SERVER_URL full, dev empty root, worker
VLADS_OPENAI_KEY, OPENAI_API_KEY dev empty; not passed by Compose root (VLADS_OPENAI_KEY only)

Chat models are configured per chatbot on its LLMs page, not server-side. On a self-hosted stack the common setups are:

  • Bring-your-own-key — chatbot owners paste OpenAI, Anthropic or Azure keys on the LLMs page; nothing to configure server-side.
  • Local serving — run Ollama or vLLM (optionally via infra/docker/docker-compose.models.yaml) and set OLLAMA_SERVER_URL, or point an OpenAI-compatible provider at the endpoint.
  • NCSA-hosted — set NCSA_HOSTED_API_KEY and NCSA_HOSTED_VLM_BASE_URL if you have access.

Retrieval depends on a single embedding model configured deployment-wide. The default is Qwen3-Embedding-8B (4096-dimensional vectors) served from any OpenAI-compatible endpoint (Ollama, vLLM, a hosted API):

EMBEDDING_MODEL=Qwen/Qwen3-Embedding-8B
EMBEDDING_API_BASE=http://host.docker.internal:11434/v1

If you switch to a model with a different dimension, set QDRANT_VECTOR_SIZE to match before the first start; the start scripts recreate a Qdrant collection whose size does not match.

On the dev stack, start-dev.sh writes both keys empty into apps/backend/.env and apps/frontend/.env and does not copy the root .env values; set them in those files (see Development setup).

Backend API

The Flask backend reads this from its process environment. On the full stack Compose passes it on from .env.

Variable Read by Required or default In template
CANVAS_ACCESS_TOKEN full, dev empty; required by /canvas_ingest, which returns 500 without it and 502 when Canvas rejects it (see Troubleshooting) root, worker

Ingest worker

The worker reads these from its process environment. None is in the root template; the worker template names four of them in a comment as supplied by the deployment.

Variable Read by Required or default In template
RABBITMQ_URL full (set by Compose), dev (written by start-dev.sh) amqp://guest:guest@rabbitmq:5672 on the full stack none
RABBITMQ_SSL full, dev unset none
RABBITMQ_QUEUE full, dev uiuc-chat none
RABBITMQ_PREFETCH_COUNT full, dev 1 none
MAX_JOB_RETRIES full, dev 10; only a job that fails before ingest starts (the database lookup or the connection resolve) is re-queued, right away, up to this many times. With the default that is 11 attempts in all (the first try plus 10 retries); the worker log counts them as attempt n/11 and ends with discarded after 11 attempts. A file that fails during ingest is not re-queued: the worker tries it up to 3 times in the same job, then records the failure none
INGEST_SUBPROCESS_TIMEOUT full, dev 300 seconds none
RABBITMQ_HEARTBEAT full, dev 60 seconds. AMQP heartbeat timeout the worker asks for; pika lets the client override the broker, so this value is what gets used. A frame goes out every half of this value, and AWS NAT gateways and load balancers cut a connection that is idle for 350 seconds: keep it well under 700, and the worker warns from 700 up. broker accepts the broker's proposal; 0 is refused none
QDRANT_UPSERT_BATCH_SIZE full, dev 100 none
EMBEDDING_MAX_ATTEMPTS full, dev 10 none

Email (SMTP)

The backend emails a download link when an export of more than 500 items finishes in the background (see Analysis & exports). The variables are read from the backend's process environment; no Compose file passes them and start-dev.sh does not write them, so on a cleanly built stack the export still reaches object storage but no email is sent and no error is shown.

Variable Read by Required or default In template
EMAIL_SENDER backend no default none
SES_HOST backend no default none
SES_PORT backend 465 none
USERNAME_SMTP, PASSWORD_SMTP backend no default none

Tools platform (Sim AI)

Read by docker-compose.sim.yaml, which both start scripts load unless --no-sim is given. Values marked generated are written into .env by the start scripts on first run. See Tools Platform (Sim AI) for what each one does.

Variable Required or default In template
ALLOWED_INTEGRATIONS required; the block whitelist. An empty value would mean unrestricted, so Compose refuses to start root (full list)
SIM_APPROVAL_ADMIN_EMAIL required; the start scripts exit without it root
SIM_API_ENCRYPTION_KEY required; generated (64 hex characters) root
SIM_BETTER_AUTH_SECRET, SIM_ENCRYPTION_KEY, SIM_INTERNAL_API_SECRET required; generated root
SIM_KEYCLOAK_CLIENT_SECRET required; generated (the old published default simai-local-secret is replaced) root
SIM_POSTGRES_PASSWORD required; generated root
SIM_POSTGRES_USER / SIM_POSTGRES_DB postgres / simstudio root
SIM_APP_PORT / SIM_REALTIME_PORT / SIM_POSTGRES_PORT 3010 / 3011 / 55432 root
SIM_NEXT_PUBLIC_APP_URL / SIM_NEXT_PUBLIC_SOCKET_URL http://localhost:3010 / http://localhost:3011 root
SIM_TRUSTED_ORIGINS http://localhost:3010,http://localhost:3011,http://keycloak:8080 root
SIM_API_BASE_URL (frontend) Compose default http://simstudio:3000; template http://localhost:3010 root
SIM_ALLOWED_SIM_ORIGINS (frontend) empty; extra Sim origins chatbots may use as a per-chatbot base URL root
SIM_KEYCLOAK_CLIENT_ID simai root
SIM_SSO_PROVIDER_ID uiuc-keycloak root
SIM_SSO_DOMAIN illinois.edu; exactly one domain, a list denies every sign-in root
SIM_REDIS_URL empty none
SIM_APP_IMAGE, SIM_REALTIME_IMAGE, SIM_MIGRATIONS_IMAGE pinned digests in the compose file root (commented)

SIM_API_BASE_URL on the full stack

start-all.sh copies .env.template to .env, and the template's SIM_API_BASE_URL=http://localhost:3010 overrides the Compose default http://simstudio:3000. Inside the frontend container localhost is the container itself, so set the value to http://simstudio:3000 when running the full stack.

Observability

Variable Read by Required or default In template
POSTHOG_API_KEY full (backend, worker), dev, worker not_a_key (backend), empty (worker); only used when POSTHOG_HOST is set root, worker
POSTHOG_HOST full (backend, worker), dev, worker empty; backend and worker send no PostHog events root, backend, worker
NEXT_PUBLIC_POSTHOG_KEY, NEXT_PUBLIC_POSTHOG_HOST dev empty; not passed by Compose root
NOMIC_API_KEY dev empty; not passed by Compose root
SENTRY_DSN dev empty; not passed by Compose root
LOG_LEVEL full (backend, worker, frontend, crawlee), dev INFO; one of DEBUG, INFO, WARNING, ERROR, CRITICAL. An unknown value falls back to INFO with one warning line. The crawler reads it from .env through env_file; Compose passes it to the other three. start-dev.sh does not write it; add it to apps/backend/.env, and to apps/frontend/.env or apps/crawlee/.env for those apps. See Logging root, worker

Vector database (Qdrant, optional)

The default vector store is pgvector in the application Postgres. Qdrant is started by both stacks and used only by chatbots whose external connection names a qdrant config. Qdrant reads qdrant_config.yaml at the repository root; its api_key must match QDRANT_API_KEY in .env. The start scripts create the collection named in QDRANT_COLLECTION_NAME with QDRANT_VECTOR_SIZE cosine vectors.

Database schema

  • The schema is applied from infra/db/init-schema.sql only when a start script runs with --create-schema (empty database) or --wipe_data / --clean (reset). A plain start on an empty database stops with "Database is empty".
  • Drizzle migrations 0016 and 0017 are replayed by both start scripts on every boot (0016 adds the Sim columns, 0017 encrypts projects.sim_api_key); both are no-ops once applied.
  • Every other migration under apps/frontend/src/db/migrations is applied with npm run db:migrate from apps/frontend. Migrations touch only the host database; see External connections for external stores.

What the images contain

The frontend, backend and worker images are built with COPY . . and no .dockerignore, and the backend and worker call load_dotenv() on start:

  • Frontend (context apps/frontend): the runner stage copies no .env, so server-only variables not listed in Compose's frontend environment: block (for example TOOL_ROUTER_MODEL_ID) are unset in the container. NEXT_PUBLIC_* values are inlined by next build, so values not passed as build args (NEXT_PUBLIC_SIGNING_KEY, NEXT_PUBLIC_SUPER_ADMIN_EMAILS) are present only if an apps/frontend/.env existed on the build machine.
  • Backend (context apps/backend): an apps/backend/.env left behind by an earlier start-dev.sh run is baked into the image and read at runtime, secrets included.
  • Worker (context apps/backend/ai_ta_backend/rabbitmq): bakes only a .env created from the worker template in that directory.

Statements on this site such as "/canvas_ingest returns 500" or "no export email is sent" describe a clean build; a baked .env changes them.

Root-template variables that no Compose file passes on and that therefore have no effect on the full stack: NEXT_PUBLIC_KEYCLOAK_URL, NEXT_PUBLIC_KEYCLOAK_CLIENT_ID, NEXT_PUBLIC_USE_ILLINOIS_CHAT_CONFIG (hardcoded build args), NEXT_PUBLIC_SIGNING_KEY, NEXT_PUBLIC_SUPER_ADMIN_EMAILS, TOOL_ROUTER_MODEL_ID, VLADS_OPENAI_KEY, NEXT_PUBLIC_POSTHOG_*, NOMIC_API_KEY, SENTRY_DSN, MINIO_*, SIM_ALLOWED_SIM_ORIGINS.