High Latency Problem in VAPI. What could be the re...
# support
h
Hi guys, I’m working on a voice agent using VAPI and I’m having issues with high latency. Even though the system latency shows around 575-1000ms, the actual response time during live calls is 3–4 seconds, and sometimes it goes up to 6–7 seconds. My setup is really simple just a single prompt (314 words 1,935 chars) and no knowledge base or nothing. - I've tried to enable smart endpoint but nothing really changed. Here are some call ids: - 53c7caa1-2fd5-4482-8ed4-1902e7dabba5 - 8fc0ec9b-0f85-41ec-add9-f484b4f58dc6 - 40076a86-8c7b-4500-b0c6-221b73eda696 What could be the reason for this much delay. I've tried to see the latenncy on the dashboard 575 to 1000ms. I've tried 4o and 4o-mini https://cdn.discordapp.com/attachments/1360159358234918952/1360159358767337532/94ae7e355d7c4ed3bc2012570258d657d902f6de28574200b2c105aa89bf5a03.jpg?ex=67fa1a9d&is=67f8c91d&hm=7a2ae65fcd606e155f6db5088806108f1939dde30d31442d6edb060b6edb3d53& https://cdn.discordapp.com/attachments/1360159358234918952/1360159359044292699/122f92c898f44b3da0be270450ff884e6a71f8540d07459c87e986bd2aa04db4.jpg?ex=67fa1a9d&is=67f8c91d&hm=2ebd61f3071aa05ecbbcd234b6c54696b7227f14c80d3b52ed479c589143ee7a& https://cdn.discordapp.com/attachments/1360159358234918952/1360159359379964034/f312783ce30b44729325e0abd258fc7c0fcc5c4f3f4541b58aefd50b522679e3.jpg?ex=67fa1a9d&is=67f8c91d&hm=8facee228e395e20ea887edb73d1b958b726e0a01e120e9573f61b2ca3cbd1ee&
v
Hi there! šŸ‘‹ Sorry to hear you're experiencing high latency with your VAPI voice agent. I can't analyze the audio file you mentioned, but I can definitely help troubleshoot your latency issues based on the information you've provided about your setup. Looking at your configuration, there are several potential causes for the high latency you're experiencing: ## Model Performance The gpt-4-mini model you're using may have lower reasoning capabilities compared to other models, which could lead to longer processing times. According to [information I found](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333224316053225582), models with lower reasoning capability can take longer to process information. ## Start Speaking Plan Configuration Your Start Speaking Plan settings might be contributing to the latency: - You have Smart Endpointing turned off, which could be affecting how quickly your agent responds. [Documentation](https://docs.vapi.ai/customization/speech-configuration) suggests that enabling Smart Endpointing can help the system better detect when a user has truly finished speaking. - Your
onNoPunctuationSeconds
is set to 1.3 seconds, which means the system waits this long when there's no punctuation before determining the user has finished speaking. According to [information I found](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339201697188286525), tweaking this value can help with latency. ## Prompt Size Considerations While you mentioned reducing your prompt size (currently at 314 words), it's worth noting that [information suggests](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333880245681393756) prompt token lengths exceeding 2,500 tokens may lead to performance issues. Your current prompt size is likely below this threshold, but further optimization might help. ## Other Potential Factors - Network latency between your servers and VAPI
- API performance issues - The complexity of your voice application logic - Server configuration settings like
silenceTimeoutSeconds
,
responseDelaySeconds
, and
llmRequestDelaySeconds
## Suggested Actions 1. Try enabling Smart Endpointing in your Start Speaking Plan 2. Reduce your
onNoPunctuationSeconds
value (perhaps to 0.8-1.0 seconds) 3. Check your network connectivity and server configuration 4. Consider testing with a different model if possible 5. Review your server logs for any errors or warnings Would you like more specific information about any of these potential solutions? I'm happy to dive deeper into any area that might help resolve your latency issues! Sources: - [Discord conversation about model performance](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333224316053225582) - [VAPI documentation on speech configuration](https://docs.vapi.ai/customization/speech-configuration) - [Discord conversation about onNoPunctuationSeconds](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339201697188286525) - [Discord conversation about prompt token length](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333880245681393756)
h
@Vapi Support Bot check the call ids above
v
Hi there! šŸ‘‹ I'm unable to directly analyze the specific call IDs you've provided as I don't have access to VAPI's call logs system. However, I can help you understand how to use these call IDs to troubleshoot your high latency issues. ## How to Use Your Call IDs for Troubleshooting These call IDs are valuable for diagnosing your latency issues. Here's what you can do with them: ### 1. Check Call Logs in VAPI Dashboard You can find detailed information about these calls in the VAPI Dashboard under "logs > calls" [source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1325000684231196775). Look for error messages, warnings, or patterns in these specific calls. ### 2. Analyze Server and Client Logs Check your server logs, client logs, and API call history around the time these calls were made. Look for: - Error messages or warnings - Unusual delays in API responses - Network connectivity issues - Actions that might have triggered the latency [source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333877747453395014) ### 3. Look for Common Causes of Latency Based on call ID analysis, common causes of high latency include: - Network issues between your system and VAPI endpoints - API performance problems - Server configuration issues (especially with parameters like
silenceTimeoutSeconds
,
responseDelaySeconds
, and
llmRequestDelaySeconds
) - TURN server latency (if it's showing 1200-2000ms) - Issues with call transfers [source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1332286268805087272) ### 4. Contact VAPI Support For the most thorough analysis, contact VAPI support and provide these call IDs. They can: - Check detailed logs associated with these specific calls - Identify patterns or issues causing the delays
- Provide specific recommendations based on what they find in the logs [source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336875140990111796) Would you like more specific information about any of these troubleshooting approaches, or would you prefer I focus on other potential solutions for your latency issues? Sources: - [Discord conversation about call IDs in VAPI dashboard](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1325000684231196775) - [Discord conversation about analyzing logs with call IDs](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333877747453395014) - [Discord conversation about common causes of latency](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1332286268805087272) - [Discord conversation about contacting VAPI support with call IDs](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336875140990111796)
p
Well, you should see in call Logs what takes how much time
[INFO]
tag
d
enpointing lately is insane taking uo sometimes even 2-3 seconds
h
any idea why is that? my voice agent latencies are also crazy high right now i have no idea why
v
Hey, you need to change your start speaking plan. Set wait seconds to 0.6. Remove transcription endpointing plan. Set smart endpointing plan to LiveKit. Change the default wait function value to the following. Then try 2-3 test calls; you will observe the good changes.
Copy code
"smartEndpointingPlan": {
          "provider": "livekit",
          "waitFunction": "50 + 200 * x"
        }
2 Views