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
| Component | What it does here | How it runs | Without it |
|---|
DeepSeek API (deepseek-flash, OpenAI-compatible) | Primary LLM: triage extraction (5 samples), the AI call-taker, hospital profiling | Cloud. 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:4b | Local 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 model | No LLM: triage abstains (human + ALS), the call-taker says its offline line |
Speech
| Component | What it does here | How it runs | Without it |
|---|
MLX Whisper whisper-large-v3 | Voice-line speech-to-text on the Apple GPU, ~0.6 s per decode, two decodes per turn | macOS host runs only (make voice): not available in the Docker api, which has no Metal GPU | faster-whisper on CPU (always, in Docker) |
faster-whisper (small) | STT for uploaded audio (/intake/voice); the voice line in Docker and on non-Apple machines | In-process (CTranslate2, CPU) in the full api image; weights from make models, mounted from ~/.cache/huggingface | Voice upload unavailable |
| Silero VAD | Detects speech start/stop: end of turn (0.7 s), barge-in | In-process (bundled with Pipecat) | — (required by the voice line) |
| Pipecat 1.12 | Real-time voice pipeline framework (transport, VAD, STT service, frame processing) | Python library | Voice WebSocket returns an error |
| espeak-ng | Text-to-speech for the AI's voice in the Docker api | Installed 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 macOS | espeak-ng |
| IndicConformer | Alternative Tamil ASR | Adapter only (gated NeMo weights not installed) | — |
| Component | What it does here | How it runs | Without it |
|---|
| IndicXlit (AI4Bharat) | Tanglish → Tamil script | Docker xlit (services/xlit/Dockerfile, Python 3.10 for fairseq). Port 8095 | Tanglish goes to the LLM as-is (weaker understanding) |
| IndicTrans2 dist-200M (AI4Bharat) | Tamil → English view for the LLM and the dispatcher | In-process on CPU in Docker (MPS on a macOS host); gated Hugging Face model (accept the terms), make models, mounted from ~/.cache/huggingface | No English view (VAAZHVU_INDICTRANS=0) |
| fastText lid.176 + wordfreq | Language ID and Tanglish code-mix detection | In-process, make models, mounted from ~/.cache/vaazhvu-models | Script-only detection |
Maps and optimisation
| Component | What it does here | How it runs | Without it |
|---|
| OSRM v6 (MLD) on Geofabrik South India | Every road route, ETA, duration matrix (dispatch, coverage, fleet plan), unit movement geometry, alternatives for closures | Docker osrm (host port 5001; macOS AirPlay owns 5000). make osrm-data builds the graph, docker compose up -d starts it. --max-table-size 3000 | Haversine distance × speed: straight lines, rough ETAs |
| VROOM | VRP baseline B2 in the dispatch evaluation | Docker vroom (port 3000), routes over OSRM | Evaluation skips B2 |
| OR-Tools CP-SAT | MEXCLP fleet placement; legacy batch assignment | Python library | Greedy placement fallback |
| CARTO basemap tiles | Web map tiles | VAAZHVU_CARTO_API_KEY | Default 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 ETAs | Cloud. 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 tiles | The layer says "no Mappls key"; closures still show |
| Apple MapKit | iOS maps, Apple Maps navigation | Built into iOS | — |
| Nominatim | Optional geocoder fallback | VAAZHVU_NOMINATIM_URL | Gazetteer only |
Events, records, other systems
| Component | What it does here | How it runs | Without it |
|---|
| NATS JetStream | Durable mirror of every event to ems.<type> for other consumers | Docker nats (4222, monitor 8222), VAAZHVU_NATS_URL | SQLite + SSE only (the system of record is unaffected) |
| HAPI FHIR R4 | Patient / Encounter / vital-sign Observations (LOINC/UCUM) for the receiving hospital | Docker fhir (port 8090, base /fhir), VAAZHVU_FHIR_URL | FHIR bundles are still built (see /incidents/{id}/fhir) but not stored |
| Go dispatch scorer | Independent reimplementation of the dispatch objective; parity cross-check | Docker scorer (8081), VAAZHVU_SCORER_URL | No cross-check |
| Resgrid CAD | Mirrors committed dispatches into a real CAD (SaveCall) | VAAZHVU_RESGRID_URL + _TOKEN | No-op |
| SMS gateway | Texts 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 prototype | Simulated: stored in sms_outbox, sms.sent with simulated: true |
| NeuroKit2 | Synthesises ECG / PPG / respiration for the patient monitor | Python library | — (required by the vitals simulation) |
Network
| Component | What 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.
| Service | Image | Port |
|---|
api | built from Dockerfile (extras integrations ml voice) | 8001→8000, 8000 |
scorer | built from services/dispatch-scorer | 8081 |
nats | nats:2.10-alpine (JetStream, volume) | 4222, 8222 |
osrm | ghcr.io/project-osrm/osrm-backend:v6.0.0 | 5001→5000 |
vroom | ghcr.io/vroom-project/vroom-docker:v1.14.0 | 3000 |
fhir | hapiproject/hapi:v7.6.0 | 8090→8080 |
xlit | built from services/xlit | 8095 |
monitor | python:3.12-slim running scripts/monitor_stack.py --serve | 9101 |
prometheus | prom/prometheus:v2.54.1 | 9090 |
grafana | grafana/grafana:11.2.0 | 3001→3000 |
ollama | ollama/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
| Component | Licence and obligation |
|---|
| OpenStreetMap data (GIS, OSRM graph) | ODbL: show attribution (the maps do) |
| Gemma | Gemma terms |
| IndicTrans2 | MIT, gated download |
fastText lid.176 | CC-BY-SA 3.0 |
| DeepSeek | API terms |
| CrowdCAD | AGPL: deliberately not linked or copied |
See Third-party components.