Is anyone else experiencing significant latency on...
# ask-ai
s
Is anyone else experiencing significant latency on the first response during phone calls with their AI agents? The rest of the conversation flows normally after this initial lag. Feels like a cold start issue with the VAD/EOU not capturing the first audio promptly. I've seen a few threads on this but still haven't found any fixes.
t
Thanks for reaching out, Nuru. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! I wanted to share some insights about why you might notice a bit of a delay on the first response during phone calls. It usually comes down to a couple of things, like cold start issues and how the system detects when someone stops talking (Voice Activity Detection or VAD/End-of-Utterance delays). Here’s a quick rundown of the main causes and what you can do about them: • Cold Start Delays: Sometimes, if your deployment scales down to zero replicas, the very first connection can take a little longer. One way to smooth this out is by choosing plans that keep some instances “warm” and ready to go. • VAD/EOU Delays: The system waits for a short pause (default is 0.5 seconds) after it thinks you’ve finished speaking before responding. You can reduce this delay to make things snappier, but just a heads-up—it might cause a few more interruptions. Some friendly recommendations: 1. Keep an eye on metrics like
end_of_utterance_delay
and
transcription_delay
to spot where things might be slowing down. 2. Tweak the
min_endpointing_delay
and
max_endpointing_delay
settings to find the sweet spot that works best for you. 3. Try out different turn detection modes like "stt" or even custom models to see if they boost performance. If you want, I’d be happy to help you dig into your specific latency metrics or walk you through setting up these parameters just right for your setup. Just let me know! Sources: Deploying to production | LiveKit Docs | Speech & Audio Processing | livekit/livekit_composite | DeepWiki | How does end-of-utterance detection work in conversations? | Improving voice AI's turn detection with transformers | Capturing metrics | LiveKit Docs
s
this is what the logs look like: I'm seeing a ~7 second delay from when the user says "hello" to when we get the first response. Here's what I'm observing: • - User speaks at :03 • - VAD/STT doesn't capture until :07 • - Massive EOU delay (3.4s) • - Response finally delivered at :10
Copy code
00:38:58 | INFO | outbound_ai_agent:165 | 📡 STATUS UPDATE: ongoing | Room: room-453526d6-c61c-40ce-8a34-0e1633d0a09b | URL: http://localhost:8000/api/v1/livekit/webhook | Status: 200
00:39:03 | INFO | outbound_ai_agent.__mp_main__:53 | STT metrics
2025-08-24 00:39:03,809 - INFO livekit.agents - STT metrics {"audio_duration": 5.0, "pid": 5764, "job_id": "AJ_b9Y2nL6F3oF2"}
00:39:04 | INFO | outbound_ai_agent.__mp_main__:285 | 👤 User spoke first, agent will respond naturally
2025-08-24 00:39:07,732 - DEBUG livekit.agents - received user transcript {"user_transcript": "Hello.", "language": "en", "pid": 5764, "job_id": "AJ_b9Y2nL6F3oF2"}
2025-08-24 00:39:07,878 - DEBUG livekit.plugins.turn_detector - eou prediction {"eou_probability": 0.36358243227005005, "input": "<|im_start|>user\nhello", "duration": 0.13, "pid": 5764, "job_id": "AJ_b9Y2nL6F3oF2"}
00:39:07 | INFO | outbound_ai_agent.__mp_main__:45 | EOU metrics
2025-08-24 00:39:07,879 - DEBUG livekit.agents - using preemptive generation {"preemptive_lead_time": 0.14629602432250977, "pid": 5764, "job_id": "AJ_b9Y2nL6F3oF2"}
2025-08-24 00:39:07,880 - INFO livekit.agents - EOU metrics {"end_of_utterance_delay": 3.4, "transcription_delay": 3.26, "pid": 5764, "job_id": "AJ_b9Y2nL6F3oF2"}
00:39:08 | INFO | outbound_ai_agent.__mp_main__:53 | STT metrics
2025-08-24 00:39:08,809 - INFO livekit.agents - STT metrics {"audio_duration": 5.0, "pid": 5764, "job_id": "AJ_b9Y2nL6F3oF2"}
00:39:09 | INFO | outbound_ai_agent.__mp_main__:14 | LLM metrics
2025-08-24 00:39:09,325 - INFO livekit.agents - LLM metrics {"ttft": 1.35, "prompt_tokens": 650, "prompt_cached_tokens": 0, "completion_tokens": 19, "tokens_per_second": 11.97, "pid": 5764, "job_id": "AJ_b9Y2nL6F3oF2"}
00:39:10 | INFO | outbound_ai_agent.__mp_main__:37 | TTS metrics
2025-08-24 00:39:10,533 - INFO livekit.agents - TTS metrics {"ttfb": 0.5016634580097161, "audio_duration": 3.89, "pid": 5764, "job_id": "AJ_b9Y2nL6F3oF2"}
but the subsequent conversations don't have this delay
t
Hey there! Looking at your logs, it seems the noticeable delay (~7 seconds) mainly comes from a mix of transcription delay (3.26s) and EOU delay (3.4s). No worries though—I’ve put together some steps that can help speed things up: 1. Reduce EOU Delay: • Try lowering the
min_endpointing_delay
and
max_endpointing_delay
parameters. For example, you could set
min_endpointing_delay=0.2
and
max_endpointing_delay=2.0
. • Turn on preemptive generation so the LLM and TTS can work alongside the user’s audio. • Think about using a turn detection model—it can help make EOU decisions faster and more accurate. 2. Reduce Transcription Delay: • Adjust your STT engine for lower latency by reducing
max_delay
(like
max_delay=0.5
) and enabling partial transcripts. • Consider faster STT providers like Deepgram, or tweak your current provider’s settings to get better speed. 3. Monitor Metrics: • Keep an eye on
end_of_utterance_delay
and
transcription_delay
so you can track how much things improve. If you want, I’d be happy to walk you through how to set these up in your system—just let me know! Sources: Capturing metrics | LiveKit Docs | livekit-plugins/livekit-plugins-speechmatics/livekit/plugins/speechmatics/s... | How does end-of-utterance detection work in conversations?
b
@square-lion-80075 did it work for you?
t
Please feel free to reach out if you’d like a hand with putting these changes into action or if you want to explore more metrics together. I’m always here to support you!