https://retellai.com/?utm_source=discord&utm_medium=seo logo
How could I make latency better on my agent
# ❓・ai-evy-support
c
@AI Evy How could I make latency better on my agent?
a
Thanks for tagging me @Ciaran. I'll look through relevant sources and get back to you shortly.
### Answer Here are the main levers for reducing latency, starting with the biggest impact items: **Choose a faster LLM model**: Smaller models respond faster, while larger reasoning-oriented models are slower to first token. Latency also varies between providers for similarly-sized models [(1) ]() . **Shorten your prompt**: Every token adds to time-to-first-token on every turn. Keep system prompts tight, move rarely-needed detail to the knowledge base or tool descriptions, and turn off unnecessary Agent Handbook presets. Prompts beyond roughly 8k tokens become noticeably slower . **Enable fast tier**: This routes LLM calls through dedicated, high-priority infrastructure, reducing both average response time and call-to-call variance, though it costs more than the standard model rate . If those don't resolve it, diagnose by component using the per-call latency breakdown [(2) ]() : - **High LLM latency**: Check the Status Page for incidents; otherwise revisit model choice and prompt length [(1) ]() - **High ASR latency**: Switch to the speed-optimized transcription mode instead of accuracy-optimized (which waits ~200ms longer) , and turn off Boosted Keywords if enabled since it can add transcription latency - **High TTS latency**: Disable voice settings like emotion that can increase latency, and try a different voice provider if TTS dominates - **Choppy/unstable audio**: Usually network jitter or call-server load; run a ping test to api.retellai.com — round-trip times consistently above 300ms can cause spikes Also consider turning off unnecessary turtle-icon 🐢 features (aim to keep estimated latency under 1.5s) and geographic distance for international calls . To pinpoint the bottlene
ck for your specific agent, retrieve the latency breakdown via the Get Call API, which returns per-component metrics (e2e, asr, llm, tts, knowledge_base, s2s) each with p50/p90/p95/p99/min/max stats [(2) ]() :
Copy code
python
from retell import Retell
client = Retell(api_key="YOUR_API_KEY")
call = client.call.retrieve("CALL_ID")
print(call.latency)
If none of this resolves the issue, message support with your call ID, the steps you've tried, and current latency measurements [(1) ]() .
​ To learn more, see the sources I considered: [[1] Troubleshoot high latency](https://docs.retellai.com/reliability/troubleshoot-latency) [[2] Check actual latency](https://docs.retellai.com/reliability/check-actual-latency) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy If I give you the agent id, could you check the settings? Also; I have a call id which you can check. The End to end latency is 3600ms
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer I don't have the ability to access your account, look up agent settings, or retrieve call data directly — I can only work from documentation and reference material. [(1) ]() To investigate your call's 3600ms end-to-end latency, here's how to get the breakdown yourself: You can retrieve the per-call latency breakdown using the Get Call API, which returns detailed metrics for each component (e2e, asr, llm, tts, knowledge_base, s2s) :
Copy code
python
from retell import Retell
client = Retell(api_key="YOUR_API_KEY")
call = client.call.retrieve("CALL_ID")
print(call.latency)
Once you have that breakdown, compare each component against typical ranges: - **High LLM latency**: check the Status Page for incidents; otherwise revisit model choice and prompt length [(2) ]() - **High ASR latency**: switch to speed-optimized transcription mode if using accuracy mode (which adds ~200ms) , and disable Boosted Keywords if enabled since it adds transcription latency - **High TTS latency**: disable settings like emotion if enabled, and consider a different voice provider if TTS dominates If the sum of your asr, llm, and tts latencies is noticeably lower than your reported e2e latency, that gap could point to turn-taking pauses (the agent waiting to confirm the caller finished speaking) or other pipeline factors rather than the individual components themselves — this has been observed as a cause of unexpectedly high e2e latency relative to component latencies in past cases. [(3) ]() If you paste your specific call's latency object (the JSON with e2e/asr/llm/tts breakdown) here, I can help interpret which component is driving the 3600ms.
​ To learn more, see the sources I considered: [[1] Check actual latency](https://docs.retellai.com/reliability/check-actual-latency) [[2] Troubleshoot high latency](https://docs.retellai.com/reliability/troubleshoot-latency) [[3] High end to end latency in phone calls](https://discord.com/channels/1186424376300679209/1450956304288845855) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy Does this help? Latency(asr=LatencyAsr(max=276.0, min=174.0, num=6.0, p50=250.0, p90=269.0, p95=272.5, p99=275.3, values=[174.0, 245.0, 276.0, 262.0, 255.0, 245.0], sum=1457), e2e=LatencyE2E(max=4704.0, min=1257.0, num=5.0, p50=3615.0, p90=4277.599999999999, p95=4490.8, p99=4661.36, values=[4704.0, 1643.0, 3615.0, 1257.0, 3638.0], sum=14857), knowledge_base=None, llm=LatencyLlm(max=709.0, min=2.0, num=11.0, p50=622.0, p90=675.0, p95=692.0, p99=705.6, values=[2.0, 2.0, 709.0, 537.0, 579.0, 675.0, 664.0, 675.0, 643.0, 622.0, 615.0], sum=5723), llm_websocket_network_rtt=None, s2s=None, tts=LatencyTts(max=228.0, min=161.0, num=11.0, p50=197.0, p90=208.0, p95=218.0, p99=226.0, values=[228.0, 208.0, 185.0, 176.0, 197.0, 197.0, 161.0, 203.0, 183.0, 202.0, 168.0], sum=2108))
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
de and turn-taking behavior the gap remains unexplained, message support with your call ID and this latency breakdown for a deeper look .
### Answer Yes, this breakdown is helpful. Looking at your numbers: - **ASR**: p50 250ms, max 276ms — normal range, not a concern [(1) ]() - **LLM**: p50 622ms, max 709ms — reasonable, not the main driver - **TTS**: p50 197ms, max 228ms — low, not the main driver - **E2E**: p50 3615ms, max 4704ms — this is far higher than ASR + LLM + TTS combined The gap between your e2e numbers and the sum of asr/llm/tts is the key issue. Since asr+llm+tts per turn only adds up to roughly 1000ms at the high end, but e2e is running 3600-4700ms, most of that extra time isn't being spent in transcription, LLM generation, or speech synthesis — it's happening somewhere else in the pipeline. This matches a pattern seen before where end-to-end latency runs much higher than the sum of the individual components: it was attributed to turn-taking pauses, where the agent waits to confirm the caller has actually finished speaking before responding. That "pause" time counts toward e2e latency but doesn't show up in asr, llm, or tts [(2) ]() . To narrow this down: - Check if you're on the accuracy-optimized transcription mode, which waits about 200ms longer than speed-optimized mode before finalizing what it heard [(3) ]() - Review whether your conversations involve unusual speech patterns (pauses, short repeated words, etc.) that could cause turn-taking to wait longer than expected, since that was the case in the referenced example [(2) ]() - If your calls are international, geographic distance between regions can add to e2e latency as well [(3) ]() If after checking transcription mo
​ To learn more, see the sources I considered: [[1] Check actual latency](https://docs.retellai.com/reliability/check-actual-latency) [[2] High end to end latency in phone calls](https://discord.com/channels/1186424376300679209/1450956304288845855) [[3] Troubleshoot high latency](https://docs.retellai.com/reliability/troubleshoot-latency) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy Transcription Mode: Optimize for Accuracy Denoising Mode: Remove noise + Background Speech Vocab: General
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer Both of those settings are likely contributing to your high e2e latency: Transcription Mode: Optimize for Accuracy — this mode is specifically designed to wait for a sentence to be fully finalized rather than cutting it off early, which adds delay before the transcript (and therefore the turn-taking/response cycle) is finalized [(1) ]() . Switching to the speed-optimized mode removes that added wait, at the cost of some accuracy on cut-off sentences . Denoising Mode: Remove noise + Background Speech — this is the most aggressive denoising option. It "removes both background noise and background speech" and explicitly "may distort the waveform and can reduce speech-to-text accuracy in some cases," plus it carries a $0.005/min surcharge for the added processing [(2) ]() . That extra processing step also adds pipeline overhead on every turn. The documentation states "For most use cases,
Remove noise
is the recommended default ," and recommends only using the aggressive mode when you specifically have loud background speech with a single caller close to the mic — testing accuracy on real calls before rolling it out . Given your e2e (p50 3615ms) is far above the sum of your asr/llm/tts (roughly 1000ms combined) , the gap points to time spent outside those three measured stages — and both accuracy-optimized transcription and the heaviest denoising mode add exactly this kind of extra wait/processing time before a turn is considered final [(1) ]() [(2) ]() . Suggested changes to test: - Switch Transcription Mode to speed-optimized instead of accuracy-optimized [(1) ]() - Switch
Denoising Mode down to the default
Remove noise
(unless you specifically have loud background speech with one dominant close-mic speaker) [(2) ]() After changing these, re-run the latency breakdown to see if e2e drops closer to your asr+llm+tts sum.
​ To learn more, see the sources I considered: [[1] Increase transcription accuracy](https://docs.retellai.com/reliability/wrong-transcript) [[2] Handle background speech & noise](https://docs.retellai.com/build/handle-background-noise) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy Setting it to remove noise and optimize for speed has done the trick Examples: Latency(asr=LatencyAsr(max=630.0, min=0.0, num=10.0, p50=195.5, p90=379.7999999999999, p95=504.8999999999997, p99=604.98, values=[229.0, 0.0, 198.0, 123.0, 630.0, 352.0, 165.0, 27.0, 193.0, 330.0], sum=2247), e2e=LatencyE2E(max=3004.0, min=800.0, num=9.0, p50=1152.0, p90=2227.999999999999, p95=2615.9999999999995, p99=2926.4, values=[1167.0, 963.0, 3004.0, 923.0, 1847.0, 1041.9951171875, 800.0, 2034.0, 1152.0], sum=12931.9951171875), knowledge_base=None, llm=LatencyLlm(max=695.0, min=1.0, num=18.0, p50=483.5, p90=626.1, p95=646.55, p99=685.31, values=[1.0, 2.0, 638.0, 495.0, 585.0, 414.0, 525.0, 621.0, 545.0, 439.0, 384.0, 453.0, 468.0, 695.0, 498.0, 472.0, 471.0, 497.0], sum=8203), llm_websocket_network_rtt=None, s2s=None, tts=LatencyTts(max=233.0, min=157.0, num=15.0, p50=183.0, p90=200.6, p95=211.99999999999997, p99=228.79999999999998, values=[233.0, 195.0, 197.0, 191.0, 176.0, 203.0, 168.0, 182.0, 181.0, 183.0, 188.0, 190.0, 157.0, 167.0, 173.0], sum=2784))
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer Great progress. Your p50 e2e dropped from 3615ms to 1152ms, a significant improvement [(1) ]() . Looking at the new breakdown: - **ASR**: p50 195.5ms, though there's variance up to 630ms max — this variability lines up with switching away from the accuracy-optimized mode, which otherwise adds about 200ms extra wait before finalizing transcripts [(2) ]() - **LLM**: p50 483.5ms, max 695ms — the dominant contributor to e2e now, which tracks with LLM model choice and prompt length being the biggest latency levers [(1) ]() - **TTS**: p50 183ms, max 233ms — low and consistent, not a concern - **E2E**: p50 1152ms, max 3004ms — much closer to the asr+llm+tts sum now, though there's still some gap at the higher percentiles (p90 2228ms, p99 2926ms) The remaining gap between e2e and the component sum at higher percentiles could still involve turn-taking pauses, similar to what was seen before . If you want to tighten this further, the next biggest levers to check are LLM model choice (smaller models respond faster) and prompt length (prompts beyond roughly 8k tokens become noticeably slower) , or enabling fast tier for more consistent response times .
​ To learn more, see the sources I considered: [[1] Troubleshoot high latency](https://docs.retellai.com/reliability/troubleshoot-latency) [[2] Increase transcription accuracy](https://docs.retellai.com/reliability/wrong-transcript) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
c
@AI Evy LLM is GPT 4.1 Which would you recommend? I dont want the price of the call to go up much that's all 🙂
a
### Answer I don't have specific pricing or latency benchmark comparisons between GPT-4.1 and smaller models in the available sources, so I can't recommend an exact model swap with confidence on cost impact. What the sources do support: smaller models respond faster than larger, reasoning-oriented models, and latency also varies between providers for models of a similar size, so switching to a smaller model is the typical lever for reducing LLM latency without necessarily needing fast tier [(1) ]() . Since your LLM p50 (483.5ms) is now the dominant piece of your e2e latency, trimming that further would mean testing a smaller model than GPT-4.1 — but switching models changes your agent's behavior, not just its speed, so you'd want to re-test your prompt and flows after switching rather than treat it as a simple toggle . Beyond model choice, shortening your prompt is the other lever that reduces time-to-first-token on every turn, and it doesn't carry the cost/behavior tradeoffs of a model switch — every token in the prompt adds latency on every conversation turn, and prompts beyond roughly 8k tokens become noticeably slower . If your prompt has room to trim (moving rarely-needed detail to the knowledge base or tool descriptions, turning off unused Agent Handbook presets) , that's a lower-risk way to shave LLM latency before touching the model itself . I don't have documented pricing figures for GPT-4.1 specifically in these sources, so I can't quantify the cost delta of switching models. If you want, I can look into whether there's a specific smaller model recommendation for your use case — let me know your agent's task complexity and I can narrow it down.
​ To learn more, see the sources I considered: [[1] Troubleshoot high latency](https://docs.retellai.com/reliability/troubleshoot-latency) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy this is gpt 4.1 (fast tier) Latency(asr=LatencyAsr(max=282.0, min=0.0, num=5.0, p50=81.0, p90=206.39999999999992, p95=244.19999999999996, p99=274.44, values=[282.0, 81.0, 2.0, 93.0, 0.0], sum=458), e2e=LatencyE2E(max=1330.001953125, min=957.0, num=3.0, p50=1024.0, p90=1268.8015624999998, p95=1299.4017578125, p99=1323.8819140625, values=[1330.001953125, 1024.0, 957.0], sum=3311.001953125), knowledge_base=None, llm=LatencyLlm(max=989.0, min=2.0, num=12.0, p50=661.0, p90=962.2, p95=987.35, p99=988.67, values=[2.0, 2.0, 989.0, 645.0, 625.0, 708.0, 544.0, 677.0, 690.0, 570.0, 748.0, 986.0], sum=7186), llm_websocket_network_rtt=None, s2s=None, tts=LatencyTts(max=595.0, min=175.0, num=10.0, p50=197.0, p90=309.6999999999999, p95=452.3499999999997, p99=566.47, values=[278.0, 595.0, 204.0, 179.0, 175.0, 200.0, 190.0, 191.0, 215.0, 194.0], sum=2421))
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer This is a solid improvement — p50 e2e dropped to 1024ms with fast tier enabled on GPT-4.1 [(1) ]() [(2) ]() . Looking at the breakdown: - **ASR**: p50 81ms — very low, not a concern [(1) ]() - **LLM**: p50 661ms, max 989ms — still the dominant contributor to e2e, though fast tier is meant to reduce both average response time and call-to-call variance [(3) ]() [(2) ]() - **TTS**: p50 197ms, with one outlier at 595ms max — mostly low, not a major concern [(1) ]() - **E2E**: p50 1024ms — now tracking reasonably close to the LLM latency plus ASR/TTS overhead Since fast tier already routes your LLM calls through dedicated, high-priority infrastructure for more consistent performance [(3) ]() , and your LLM p50 (661ms) is still the largest single component, further latency gains at this point would mainly come from prompt length reduction — every token adds to time-to-first-token on every turn, and prompts beyond roughly 8k tokens become noticeably slower [(2) ]() . Since you're already prioritizing cost, note that fast tier costs more than the standard model rate, so this latency improvement does come with that tradeoff you'll want to weigh against your use case [(2) ]() [(3) ]() . If 1024ms p50 already meets your needs, I'd hold here rather than push further, since further reductions would mean either switching to a smaller model
(which changes agent behavior and needs re-testing) or accepting the fast tier cost premium you already have in place [(2) ]() .
​ To learn more, see the sources I considered: [[1] Check actual latency](https://docs.retellai.com/reliability/check-actual-latency) [[2] Troubleshoot high latency](https://docs.retellai.com/reliability/troubleshoot-latency) [[3] Configure LLM Options](https://docs.retellai.com/build/llm-options) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy One last thing... I just saw something about training my ai? Isnt the LLM just a general LLM, each new call is a fresh start?
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer Good question, and the sources actually give two different but related answers here. Each call is indeed a fresh start in the sense that the LLM itself isn't being retrained live per-call — your agent's behavior comes from the prompt, tools, and configuration you've set up (like the
general_prompt
,
states
, and model settings you've already configured on your Retell LLM) [(1) ]() [(2) ]() . There's no persistent memory carried between separate calls unless you explicitly pass context via dynamic variables or your own backend. That said, "training" in the sources refers to a broader two-step process, not per-call learning: - **Fine-tuning with call transcripts**: this is a separate, deliberate step where a model is fine-tuned on real conversation transcripts to improve its understanding of your specific domain and customer queries [(3) ]() [(4) ]() . This isn't something that happens automatically call-to-call — it's a distinct process you'd run to adapt the underlying model. - **Prompt engineering**: this is the main lever for controlling agent behavior without retraining, letting the AI adapt dynamically while staying consistent and on-brand . This is what you've been doing throughout this thread — adjusting settings and prompts to change how the agent responds. So to directly answer: yes, each call starts fresh from the LLM's perspective (no memory carry-over by default) , but the consistency and domain knowledge you see across calls comes from your prompt engineering and, optionally, fine-tuning on transcripts done ahead of time — not from the model learning during live calls .
​ To learn more, see the sources I considered: [[1] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) [[2] Get Retell LLM](https://docs.retellai.com/api-references/get-retell-llm) [[3] Training & Customizing AI Voice Agents | Retell AI](https://www.retellai.com/blog/training-and-customizing-voice-agents-with-retell-ai) [[4] How to Deploy Conversational AI | Retell AI](https://www.retellai.com/blog/how-to-deploy-conversational-ai) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.