Skip to main content

External services and models

Every external piece is optional at the code level: the app starts, and the tests pass, without any of them. Quality and realism depend on having them running. Each row says what it does, how to start it, and what happens without it.

Everything except Ollama runs in Docker Compose: docker compose up -d starts it all, docker compose down stops it (see the compose table below). "In-process" means inside the api container.

Language models​

ComponentWhat it does hereHow it runsWithout it
DeepSeek API (deepseek-flash, OpenAI-compatible)Primary LLM: triage extraction (5 samples), the AI call-taker, hospital profilingCloud. VAAZHVU_LLM_PROVIDER=openai, VAAZHVU_LLM_URL=https://api.deepseek.com, VAAZHVU_LLM_MODEL=deepseek-flash, VAAZHVU_LLM_API_KEY in .env. Thinking disabled through VAAZHVU_LLM_*_PARAMS (faster and more accurate here).Falls back to Ollama per request
Ollama + gemma3:4bLocal fallback LLM (schema-enforced JSON; streamed call-taker replies)Native Ollama.app on the Mac (keeps the Metal GPU), port 11434; the api reaches it at host.docker.internal:11434. make llm sets 5 parallel slots and 24 h keep-alive and pulls the modelNo LLM: triage abstains (human + ALS), the call-taker says its offline line

Speech​

ComponentWhat it does hereHow it runsWithout it
MLX Whisper whisper-large-v3Voice-line speech-to-text on the Apple GPU, ~0.6 s per decode, two decodes per turnmacOS host runs only (make voice): not available in the Docker api, which has no Metal GPUfaster-whisper on CPU (always, in Docker)
faster-whisper (small)STT for uploaded audio (/intake/voice); the voice line in Docker and on non-Apple machinesIn-process (CTranslate2, CPU) in the full api image; weights from make models, mounted from ~/.cache/huggingfaceVoice upload unavailable
Silero VADDetects speech start/stop: end of turn (0.7 s), barge-inIn-process (bundled with Pipecat)— (required by the voice line)
Pipecat 1.12Real-time voice pipeline framework (transport, VAD, STT service, frame processing)Python libraryVoice WebSocket returns an error
espeak-ngText-to-speech for the AI's voice in the Docker apiInstalled in the image (apt)No agent audio (the text still reaches the client)
macOS say (Vani ta-IN, Tara en-IN)Text-to-speech on macOS host runs (make run)Built into macOSespeak-ng
IndicConformerAlternative Tamil ASRAdapter only (gated NeMo weights not installed)—

Language tools​

ComponentWhat it does hereHow it runsWithout it
IndicXlit (AI4Bharat)Tanglish → Tamil scriptDocker xlit (services/xlit/Dockerfile, Python 3.10 for fairseq). Port 8095Tanglish goes to the LLM as-is (weaker understanding)
IndicTrans2 dist-200M (AI4Bharat)Tamil → English view for the LLM and the dispatcherIn-process on CPU in Docker (MPS on a macOS host); gated Hugging Face model (accept the terms), make models, mounted from ~/.cache/huggingfaceNo English view (VAAZHVU_INDICTRANS=0)
fastText lid.176 + wordfreqLanguage ID and Tanglish code-mix detectionIn-process, make models, mounted from ~/.cache/vaazhvu-modelsScript-only detection

Maps and optimisation​

ComponentWhat it does hereHow it runsWithout it
OSRM v6 (MLD) on Geofabrik South IndiaEvery road route, ETA, duration matrix (dispatch, coverage, fleet plan), unit movement geometry, alternatives for closuresDocker osrm (host port 5001; macOS AirPlay owns 5000). make osrm-data builds the graph, docker compose up -d starts it. --max-table-size 3000Haversine distance × speed: straight lines, rough ETAs
VROOMVRP baseline B2 in the dispatch evaluationDocker vroom (port 3000), routes over OSRMEvaluation skips B2
OR-Tools CP-SATMEXCLP fleet placement; legacy batch assignmentPython libraryGreedy placement fallback
CARTO basemap tilesWeb map tilesVAAZHVU_CARTO_API_KEYDefault OSM tiles
Mappls live traffic (route_eta, route_adv)Real congestion on ~27 Chennai arterials for the terminal's Live traffic layer (routing/live_traffic.py, corridors in config/live_traffic.yaml, GET /api/ops/traffic/live). Display only, not dispatch ETAsCloud. VAAZHVU_MAPPLS_TRAFFIC_KEY (static key from auth.mappls.com) in .env; fetched only while the layer is on, cached refresh_s (180 s). Verified live 2026-10-03; the same key is denied route_traffic (what the dispatch adapter routing/mappls.py calls) and the SDK's live vector tilesThe layer says "no Mappls key"; closures still show
Apple MapKitiOS maps, Apple Maps navigationBuilt into iOS—
NominatimOptional geocoder fallbackVAAZHVU_NOMINATIM_URLGazetteer only

Events, records, other systems​

ComponentWhat it does hereHow it runsWithout it
NATS JetStreamDurable mirror of every event to ems.<type> for other consumersDocker nats (4222, monitor 8222), VAAZHVU_NATS_URLSQLite + SSE only (the system of record is unaffected)
HAPI FHIR R4Patient / Encounter / vital-sign Observations (LOINC/UCUM) for the receiving hospitalDocker fhir (port 8090, base /fhir), VAAZHVU_FHIR_URLFHIR bundles are still built (see /incidents/{id}/fhir) but not stored
Go dispatch scorerIndependent reimplementation of the dispatch objective; parity cross-checkDocker scorer (8081), VAAZHVU_SCORER_URLNo cross-check
Resgrid CADMirrors committed dispatches into a real CAD (SaveCall)VAAZHVU_RESGRID_URL + _TOKENNo-op
SMS gatewayTexts the caller: tracking link + crew number on dispatch, a location-request link when the location is missing or the call was silent (ops/sms_out.py)Any HTTP gateway, VAAZHVU_SMS_URL + _TOKEN; not connected to a carrier in the prototypeSimulated: stored in sms_outbox, sms.sent with simulated: true
NeuroKit2Synthesises ECG / PPG / respiration for the patient monitorPython library— (required by the vitals simulation)

Network​

ComponentWhat it does here
Tailscale (headscale)Phones reach the Mac at its tailnet name over WireGuard (set in ios/Vaazhvu/Config/Local.xcconfig). Debug builds of the iOS apps allow plain HTTP only to the local network and *.ts.net; Release builds are HTTPS-only.

Docker compose (docker-compose.yml)​

Everything below starts with docker compose up -d and stops with docker compose down.

ServiceImagePort
apibuilt from Dockerfile (extras integrations ml voice)8001→8000, 8000
scorerbuilt from services/dispatch-scorer8081
natsnats:2.10-alpine (JetStream, volume)4222, 8222
osrmghcr.io/project-osrm/osrm-backend:v6.0.05001→5000
vroomghcr.io/vroom-project/vroom-docker:v1.14.03000
fhirhapiproject/hapi:v7.6.08090→8080
xlitbuilt from services/xlit8095
monitorpython:3.12-slim running scripts/monitor_stack.py --serve9101
prometheusprom/prometheus:v2.54.19090
grafanagrafana/grafana:11.2.03001→3000
ollamaollama/ollama (opt-in profile ollama, CPU-only on macOS)11434

Ollama normally runs natively (Ollama.app, Metal GPU); the api reaches it at host.docker.internal:11434. MLX Whisper and macOS say are host-only, so the containerised voice line uses faster-whisper (CPU) and espeak-ng.

Licences to keep in mind​

ComponentLicence and obligation
OpenStreetMap data (GIS, OSRM graph)ODbL: show attribution (the maps do)
GemmaGemma terms
IndicTrans2MIT, gated download
fastText lid.176CC-BY-SA 3.0
DeepSeekAPI terms
CrowdCADAGPL: deliberately not linked or copied

See Third-party components.