carepath-api / .env.example
tranth3truong's picture
Deploy public Scribe-only CarePath Space
cc678b9
Raw
History Blame Contribute Delete
3.12 kB
# CarePath unified runtime — one FastAPI service, two products.
# Defaults below are the keyless demo profile: the whole app must boot with no
# API keys (mock interpreter providers, mock ASR + offline LLM for the scriber).
# Ready-made profiles: .env.local.example (keyless demo), .env.ckey.example
# (real Gipformer ASR + CKey LLM).
# --- Scriber (scribe/carepath, routes /api/v1/*) ---
APP_ENV=local
ASR_PROVIDER=gipformer
GIPFORMER_QUANTIZE=int8
GIPFORMER_NUM_THREADS=4
GIPFORMER_DECODING_METHOD=modified_beam_search
GIPFORMER_CHUNK_SECONDS=20
# Long-audio segmentation: overlap (default) | vad | fixed.
# overlap = overlapping windows merged with seam de-duplication (no word loss
# at chunk boundaries; no extra model).
# vad = split on silence; requires GIPFORMER_VAD_MODEL (repo_id:filename or
# a local silero_vad.onnx path). Falls back to overlap if unavailable.
# fixed = legacy non-overlapping 20s windows.
GIPFORMER_SEGMENTATION=overlap
GIPFORMER_OVERLAP_SECONDS=2
GIPFORMER_MAX_SEGMENT_SECONDS=20
GIPFORMER_VAD_MODEL=
# Set LLM_PROVIDER=offline for a deterministic no-key fallback.
# Set LLM_PROVIDER=ckey for CKey OpenAI-compatible chat completions.
LLM_PROVIDER=offline
LLM_BASE_URL=https://api.openai.com/v1
LLM_MODEL=gpt-4.1-mini
LLM_API_KEY=
LLM_TIMEOUT_SECONDS=60
# If a network LLM provider fails, fall back to the offline generator so a
# request never errors out (recommended for live demos).
LLM_FALLBACK_OFFLINE=true
# Retrieval
MEDICAL_LEXICON_PATH=data/medical_lexicon.json
RETRIEVAL_TOP_K=5
# Backend: lexical (default) | semantic | hybrid. semantic/hybrid use the
# Vietnamese bi-encoder and need the optional sentence-transformers + pyvi deps.
RETRIEVAL_BACKEND=lexical
SEMANTIC_MODEL_NAME=bkai-foundation-models/vietnamese-bi-encoder
# Safety/demo
ALLOW_MOCK_ASR=false
TEAM_CODE=
SOAP_RATE_LIMIT_PER_IP_HOUR=3
SOAP_RATE_LIMIT_PER_IP_DAY=10
SOAP_RATE_LIMIT_GLOBAL_DAY=100
# Cross-origin frontends for both APIs. Clear this value for same-origin-only
# production; list every Vite development origin when developing against either API.
CORS_ORIGINS=http://localhost:5173,http://127.0.0.1:5173
# Public Vercel site used by the Interpreter's “Tất cả chức năng” link when
# its frontend is built into the Space image. Set as a Docker build arg.
VITE_PUBLIC_SITE_URL=https://carepath-omega.vercel.app
# --- Interpreter (interpreter/app, routes /api/* + /ws/*) ---
# PROVIDER_MODE=mock runs deterministic providers with zero keys (the demo
# profile). PROVIDER_MODE=cloud is a later track: it needs the two API keys
# below and a non-default ADMIN_TOKEN (startup refuses "change-me").
PROVIDER_MODE=mock
ANTHROPIC_API_KEY=
OPENAI_API_KEY=
ADMIN_TOKEN=change-me
CONFIDENCE_THRESHOLD=0.7
RETENTION_DAYS=30
MAX_TURN_AUDIO_BYTES=10485760
# sqlite is fine for the demo (ephemeral on HF Spaces); point at Postgres etc.
# for anything that must survive a container restart.
DATABASE_URL=sqlite:///./carepath.db
OPENAI_TRANSCRIBE_MODEL=gpt-4o-transcribe
CLAUDE_MT_MODEL=claude-sonnet-5
CLAUDE_REVIEWER_MODEL=claude-sonnet-5
PROVIDER_TIMEOUT_SECONDS=30