I am noticing delay of around 2 to 3 second betwee...
# support
b
I am noticing delay of around 2 to 3 second between mine and AI's reply.On vapi dashboard it says 575ms but when actually calling using phone it is getting delays of around 2 to 3 seconds.
v
Hi there! 👋 I understand you're experiencing a delay between your input and the AI's reply that's longer than what's shown on the Vapi dashboard. I don't have specific information about how the Vapi dashboard calculates the 575ms latency metric in your case. However, I can definitely help explain potential causes for the discrepancy between the dashboard metrics and the 2-3 second delay you're experiencing during phone calls. According to the [documentation](https://docs.vapi.ai/introduction), Vapi aims for low latency of around 500-800ms voice-to-voice internationally. The discrepancy you're experiencing could be due to several factors: ### Network-Related Factors - **Network Latency**: High network latency between your system and the API endpoints can contribute significantly to delays [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1332286268805087272) - **TURN Server Latency**: If the TURN (Traversal Using Relays around NAT) server latency is high (1200-2000ms), it can impact call quality and cause delays [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333877747453395014) ### System and Configuration Factors - **API Performance**: Slowdowns in API performance can add to the overall delay [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1332286268805087272) - **Voice Application Logic**: Inefficient processes in your voice application could be causing delays [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1332286268805087272) - **Resource Utilization**: High CPU, memory, or bandwidth usage on your server can slow response times [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1332286268805087272)
- **VAPI Configuration**: Settings like
silenceTimeoutSeconds
,
responseDelaySeconds
, and
llmRequestDelaySeconds
can affect response times [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1332286268805087272) ### External Factors - **Third-Party Services**: If your application relies on external services, their response times could be adding to the delay [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1332286268805087272) - **Call Volume**: High call volumes can sometimes slow down response times [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1332286268805087272) - **Daily as Transport Layer**: Vapi uses Daily as a transport layer, which can take more than 5 seconds to start a call [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1340022322454855781) Would you like me to help you troubleshoot any specific aspect of these potential causes to help reduce the delay you're experiencing? Sources: - [Possible causes for discrepancy between Vapi dashboard latency and actual delay experienced when calling using a phone](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1332286268805087272) - [How to interpret latency metrics on the Vapi dashboard](https://docs.vapi.ai/introduction) - [Impact of network latency on Vapi call delay](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333877747453395014) - [Reasons for delay between user input and AI reply in Vapi](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1340022322454855781)
s
Had this issue before. Smart endpointing solved it.
b
@Shaneng I just selected the "Smart Endpoint" from the setting but still getting around 2 seconds before AI replies back. any tips? https://cdn.discordapp.com/attachments/1359184657392078898/1359192518926930016/image.png?ex=67f6962d&is=67f544ad&hm=d7636f2e1425835302cddc84751dcc6b0e1c4169ecdf1ce6d9d833d69db8d710&
s
If you've got background noise while talking to the assistant, you can also turn on the background denoising. In my experience, sometimes my assistant thinks the user is still speaking when there's a background noise which causes delay. Cons of this tho is when the user's reception is not that good, either they're breaking up or they're far from the mic, the assistant may think the actual response is also a background noise.
k
@baadshah2 Try close unnecessary applications during calls to free up system resources..
k
checking if this is resolved/solved for you?
b
No, still having issues
dont understand why there is delay of 2.5 seconds
@Shubham Bajaj
k
Hey! To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) This would really help us figure out what went wrong!
h
I am struggling with the same issue as well. Here are few test calls from my end: 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
b
So, the call id is 9d7c1c9b-ce02-49fd-b391-d4aed733a012 If you would notice the ai is taking on average 2 seconds to reply back
k
Hey Halli, please get a new support ticket for your issue.
The assistant's delayed response is due to end pointing, which determines the duration to wait before recognizing the user has finished speaking. - End Pointing Plan Configuration: You need to adjust the Smart End Pointing plan provider to livekit and update the wait function within the Start Speaking Plan for English Transcription. - Wait Function Optimization: Iterative testing with potential users is necessary to determine the optimal wait function values, as suggested values may not be suitable for all scenarios.
Copy code
startSpeakingPlan": {
  "waitSeconds": 0.6,
  "smartEndpointingPlan": {
          "provider": "livekit",
          "waitFunction": "50 + 200 * x"
        }
}
Let me know how it goes for you.
k
@Halil
b
I am still getting 2 second latency
here is new caller id after applying the settings that you said 25ed4dce-89b8-4c5a-942a-eb5338761b39
@Shubham Bajaj
k
Hey baadshah2, as mentioned, you need to perform A/B testing (iterative testing with your native users) to find out the optimal wait function values. In case you're getting 2-second latency, it might be because of your current wait function values. Try tweaking it and do 2-3 test calls.
If even after continuing testing you couldn't reduce the latency, please let me know and share the recent call IDs.