Skip to content

Latency Budget

Zlatko Lakisic edited this page Aug 3, 2026 · 1 revision

Latency Budget

Total target: under 15 seconds, ideally under 6.

Latency budget stacked bar


Stage budgets

Stage Budget Notes
Wake word → capture start ~50 ms local, negligible
Utterance + VAD close speech + ~0.7–1.2 s silence tune audio.vad_silence_ms / COMSTAR_VAD_SILENCE_MS
STT (Reach → Ada, or local fallback) ~1–5 s GPU on Ada preferred; Pi CPU tiny ~3–5 s
Orchestration 2–10 s dominated by MCP calls — where the budget goes
TTS (Ada or local Piper) ~1 s roughly realtime; first chunk can start earlier
Avatar render + playback ~200 ms

Instrumentation

Every process emits structured JSON logs. Latency spans (via Span helper) on close:

Span Meaning
wake_to_listen Wake → listening armed
stt Transcription
orchestration directAgent
tts_first Time to first TTS chunk
tts_total Full synthesis
avatar_start Until kiosk speak.started
turn_total End-to-end turn

Shared turn_id (ULID) threads through all spans for one turn.

make logs-export SINCE="1 hour ago" > /tmp/run.jsonl
python scripts/latency_report.py /tmp/run.jsonl

Latency report example


If you're over budget

  1. Confirm orchestration dominates (if it doesn't, something else is wrong).
  2. Trim voice MCP set — remove slow tools.
  3. Prefer Ada STT over Pi tiny.
  4. Cache greetings.
  5. Clock skew between Mac and Pi must be < 1 s or span numbers are nonsense (make doctor).

Related pages

Clone this wiki locally