Configuration¶
All configuration is environment variables. Secrets are never stored in code or image layers.
| Variable | Default | Purpose |
|---|---|---|
HOST, PORT |
127.0.0.1, 8080 |
Bind address. The Docker image sets 0.0.0.0. |
DATA_DIR |
.runtime |
SQLite database, local access keys and saved audio. Use /data on Railway. |
APP_REVIEWER_TOKEN, APP_TRAINEE_TOKEN |
generated locally | Bearer tokens per role. Required on Railway. |
APP_TRIAL_CODE |
none | Beta entry code, or a JSON object of named codes. |
APP_ADMIN_CODE |
none | Scoped owner admin access. |
PRACTICE_PASS_LINE |
75 |
Draft pass line for the formative practice score on the progress view and debrief. |
VOICE_PROVIDER |
gemini if a Gemini key is set, else sarvam |
Provider for realization, transcription and TTS on the request/response voice path. |
SARVAM_FALLBACK |
on |
Retry a failed Gemini speech call once on Sarvam (needs SARVAM_API_KEY). |
GEMINI_TEXT_MODEL |
gemini-3.8-flash |
Gemini model for realization, translation and transcription. |
SARVAM_API_KEY |
none | Sarvam speech and chat (fallback, and the realtime socket). |
SARVAM_CHAT_MODEL |
sarvam-105b |
Sarvam model for interpretation and realization. |
GEMINI_API_KEY |
none | Gemini Live, interpretation, improvisation, the default speech stack and session feedback. |
GEMINI_MONTHLY_SESSION_CAP |
20 |
Monthly cap on native voice sessions. |
VOICE_MONTHLY_CALL_CAP, VOICE_SESSION_CALL_CAP |
300, 90 |
Sarvam call caps. |
VOICE_INR_BUDGET_JSON |
none | Optional INR reservation ceilings. |
INTERPRETER_MONTHLY_CAP, INTERPRETER_SESSION_CAP |
5000, 200 |
Gemini interpreter calls; counted separately from speech caps. |
REPLAY_STORAGE_CAP_MB |
50 |
Total saved-audio storage. |
DOCS_ACCESS_PHRASE |
none | Enables developer docs at /docs, behind this phrase (4–256 characters). The resulting cookie session opens docs only, never the practice API. Unset means /docs stays disabled. |
DOCS_SITE_DIR |
site/ next to app/ |
Built MkDocs site served at /docs. The Docker image builds it into /srv/site. |
TRANSCRIPT_RETENTION_DAYS |
180 |
Ended encounters older than this are redacted (wording dropped, evidence structure kept). |
EVAL_CONDITION_ASSIGNMENT |
unset | balanced assigns expressive audio, neutral audio or text by a deterministic hash of learner and case. |
GATE_MODE, GATE_MODEL, GATE_TIMEOUT_S |
off (shadow if a Cloudflare token is set), clef, 0.8 |
Pre-speech gate for improvised answers; see Pre-speech gating. |
CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_AI_TOKEN |
unset | Clef / Clef-flash via Workers AI. |
TYPESAFE_API_URL, TYPESAFE_API_KEY, TYPESAFE_MODEL |
unset | Jev (offline comparison). |
MURIL_GATE_URL, MURIL_GATE_TOKEN |
unset | Self-hosted MuRIL gate. |
LIVE_VERBATIM_TTS, VERBATIM_TTS_MODEL |
off, gemini-3.8-flash-tts |
Speak improvised Live turns from checked text with verbatim TTS; VERBATIM_TTS_MODEL is also the Gemini TTS model for all patient and attendant audio. |
FACULTY_REVIEW_GATE |
off |
enforce blocks cases with pending clinical, language or patient-voice review. Keep off until faculty reviewers are onboarded. |
Railway¶
Deploy with scripts/deploy.sh: it runs the unit tests and consistency suite, stages only the deployable files in a temporary folder (refusing if any secret or data file slips in), links the med-abhyaas production service, runs railway up, waits for the deployment and checks /health and the docs login page. --dry-run stages without deploying; --skip-tests skips the checks. The script never changes Railway variables.
Single instance with a persistent volume at /data. Deploy app/, docs/, mkdocs.yml, .scratch/practice-copilot/issues/, Dockerfile, .dockerignore and .railway/railway.ts. The image's first stage runs mkdocs build --strict, so a broken docs build fails the deploy. .dockerignore excludes everything else.