elegant-judge-25223
12/16/2025, 6:46 AMtotal_latency = eou.end_of_utterance_delay + llm.ttft + tts.ttfb
the above formula is given by livekit to calculate latency
I have the following below questions:
1. on_user_turn_completed_delay is the agent callback initiated after the end_of_utterance_delay, so it should be included in the latency calculation process?
2. there is a param of e2e_latency in observability feature, what does it actually represent (time from agent callback initiated till audio generation starting?)
3. if the above 2 questions are true then the formula of end_of_utterance_delay + on_user_turn_completed_delay + e2_latency, wouldnt that give a more accurate picture of latency of livekit integration?tall-airline-16756
12/16/2025, 6:47 AMtall-airline-16756
12/16/2025, 6:47 AMon_user_turn_completed_delay runs after end_of_utterance_delay and before LLM inference, so it contributes to perceived end-to-end latency. If your on_user_turn_completed callback does non-trivial work (RAG, DB calls, etc.), include it in your latency calculation.
2) what does e2e_latency represent?
• There is no documented metric named e2e_latency. The observability metrics that are defined are end_of_utterance_delay, on_user_turn_completed_delay, llm.ttft, and tts.ttfb. The meaning of e2e_latency cannot be confirmed.
3) would adding them produce a more accurate total latency?
• Yes — a more complete formula is:
accurate_total_latency =
end_of_utterance_delay +
on_user_turn_completed_delay +
llm.ttft +
tts.ttfb
This captures VAD-to-turn completion, any user callback processing, time-to-first-LLM-token, and time-to-first-TTS-audio. If e2e_latency in your system is intended to equal llm.ttft + tts.ttfb, then using a separate e2e_latency term could double-count those parts — rely on the specific metric definitions above.
Would you like help mapping these metrics to the observability output you’re seeing (example logs/events or metric names)?
Sources: Observability data hooks | LiveKit docselegant-judge-25223
12/16/2025, 6:53 AMtall-airline-16756
12/16/2025, 6:53 AMe2eLatency and the sample observability attributes.
• e2eLatency meaning: In Agent Insights e2eLatency is the end‑to‑end latency measured from the moment the user turn is detected as complete to when the agent begins speaking. It is effectively the sum of endpointing (end_of_utterance) time plus the model and TTS startup times.
• How e2eLatency relates to your other metrics:
e2eLatency ≈ end_of_utterance_delay + llm.ttft + tts.ttfb
In your sample:
• llmNodeTtft = 0.536 s
• ttsNodeTtfb = 1.031 s
• e2eLatency = 2.601 s
→ remaining ≈ 1.034 s is attributed to endpointing (which includes any on_user_turn_completed processing when present).
• Should you include on_user_turn_completed_delay in your latency formula?
Yes — if your on_user_turn_completed callback does non-trivial work (RAG, DB calls, network calls, etc.), that time is part of the perceived latency and should be included for an accurate measurement. Note that on_user_turn_completed time is represented inside EOUMetrics/endpointing in observability when available.
• Recommended “most accurate” formula to track in your integration:
accurate_total_latency =
end_of_utterance_delay
+ on_user_turn_completed_delay
+ llm.ttft
+ tts.ttfb
If e2eLatency is already present in your observability export, it gives you a ready end‑to‑end number (but it aggregates endpointing + LLM + TTS). Use the breakdown above to isolate which stage is the bottleneck.
Would you like help correlating these fields with specific logs or a sample session trace so we can pinpoint where that ~1.03s in your sample comes from?
Sources: Agents (Python) | livekit/livekit_composite | DeepWiki | How does end-of-utterance detection work in conversations? | Observability data hooks | LiveKit docs | examples/voice_agents | livekit/livekit_composite | DeepWiki | Agents (Node.js) | livekit/livekit_composite | DeepWiki