All posts

A latency budget for voice agents

/AI/4 min read

Seven stages with medians adding up to 820 ms do not give an 820 ms agent. Simulated with realistic spread, the median turn takes 891 ms, the 95th percentile 1,407 ms, and a third of all replies take over a second. Adding up per-stage p95s would have predicted 1,890.

A latency budget divides a target response time among the stages that make up a voice agent's reply, so that each component has a number to hit. It is the main planning tool for making an agent feel conversational.

It is also easy to get subtly wrong, because latencies are not fixed numbers. Each stage varies from turn to turn, and the way variable stages add up is not the way their averages suggest.

The stages

Measured from the instant the user stops speaking to the instant they hear the first audio:

stagemedian95th percentile
network in40 ms70 ms
endpointing150400
speech-to-text finalisation50120
LLM time to first token250700
LLM to end of first sentence160260
TTS time to first audio90200
network out and playback buffer80140
sum820 ms1,890 ms

The medians are a well-tuned cascade. The 95th percentiles reflect what each stage looks like on a bad turn: a hesitant user making endpointing wait, a long conversation history slowing the model's first token, a busy TTS server.

How the stages actually add up

Neither column's sum is the answer. To see what users experience, I modelled each stage as a skewed (log-normal) distribution matching those medians and 95th percentiles, and simulated 200,000 turns:

total latency
sum of stage medians820 ms
actual median turn891 ms
actual 95th percentile1,407 ms
actual 99th percentile1,782 ms
sum of stage 95th percentiles1,890 ms
turns over 800 ms67.6%
turns over 1,000 ms32.2%

Two lessons are in that table.

The median total is worse than the sum of medians. Latencies are skewed — they can be much slower than usual, but not much faster — so each stage's average sits above its median, and the averages add up. An agent built from 820 ms of medians gives a median turn of 891 ms, and two-thirds of turns miss an 800 ms target.

The 95th percentile total is better than the sum of 95th percentiles. It is unlikely that every stage has a bad turn at once. Budgeting each stage at its p95 and adding them up predicts 1,890 ms; the real p95 is 1,407 ms. A budget built that way is too pessimistic and leads to over-engineering the wrong stages.

200,000 SIMULATED TURNS 820 Σ medians 891 median 1,000 ms32.2% beyond 1,407 p95 1,890 Σ p95s medians add up to too little; p95s add up to too much budget on simulated or measured totals, not on sums of per-stage numbers
Skew pushes the typical turn above the sum of typical stages; independence pulls the tail below the sum of tails.

Where to spend effort: the variance

The same model shows which stages make the tail. Ranked by how much they vary:

stagemeanstandard deviation
LLM time to first token304 ms211 ms
endpointing179 ms117 ms
TTS time to first audio101 ms52 ms
LLM to first sentence167 ms50 ms
speech-to-text finalisation58 ms33 ms
network out85 ms30 ms
network in42 ms15 ms

Two stages account for most of the spread: the language model's time to first token and endpointing. That is where the slow turns come from, and where work pays off:

  • First token: keep prompts short and stable so prompt caching works, use a smaller or faster model for simple turns, keep inference servers below saturation, start generating speculatively before the user finishes.
  • Endpointing: model-based turn detection, so clear endings are answered quickly and only ambiguous ones wait.

Shaving 20 ms off network-in will never be noticed. Cutting the LLM's p95 from 700 ms to 400 ms will.

Building the budget properly

  1. Set targets on the total, at a percentile. For example: median under 800 ms, p95 under 1,200 ms. Users remember the slow turns.
  2. Measure every stage on every turn, with timestamps, in production. Lab numbers on short prompts and idle servers are optimistic.
  3. Combine by simulation or from real totals, not by adding columns.
  4. Attack variance first, in the stages that have the most of it.
  5. Hide what you cannot remove. Fillers, acknowledgements and speculative starts move the perceived response earlier even when the full answer is not ready.

What to take away

A latency budget splits the time from "user stops" to "agent speaks" across seven or so stages. Because each stage varies, the totals behave unintuitively: medians summing to 820 ms gave a median turn of 891 ms and a third of turns over a second, while p95s summing to 1,890 ms gave a real p95 of 1,407 ms.

Set targets on the total at a percentile, measure every stage in production, and spend effort where the variance is — almost always the model's first token and endpointing.