Skip to content
mentoor

Topic 2 of 5 · 4 min read

Measuring voice latency percentiles

Goal: Read per-stage latency traces from a test run and report the p95 round trip and the stage that drives it.

For a voice agent, report latency as percentiles of time to first audio, broken down by stage: the median says how it usually feels, the p95 says how often it feels broken. An average blends the two and hides the slow calls.

Check yourself · 1 of 3

Why report p95 latency for a voice agent rather than only the average?

Choose one answer

Why it matters

In conversation, a pause longer than about a second feels wrong, and a caller who hears nothing starts talking again, which breaks the turn. A pipeline of speech-to-text, a language model and text-to-speech is as slow as its slowest stage on that turn, and the slow turns are what people remember. Suppose 100 turns take 0.8 seconds and 5 take 4 seconds. The average looks fine and one turn in twenty is a dead line.

How to do it

  1. Define the clock. The usual measure is time to first audio: from the moment the caller stops speaking to the first sound the caller hears. Write the start and stop events down, so every run measures the same thing.
  2. Trace every stage. Record timestamps for end of speech detected, transcript final, model first token, first audio chunk generated, first audio played. Tracing in LiveKit, Pipecat or OpenTelemetry gives you these per turn.
  3. Collect enough turns. Percentiles from ten turns are noise. Run a scenario set that produces hundreds of turns, and test under load as well as one call at a time.
  4. Report p50, p95 and p99 per stage. Sort the turns, take the value 95 per cent of the way up. The stage with the largest p95 contribution is where to work.
  5. Compare like with like. Same scenarios, same region, same time of day, and a note of the model version.

Before and after

Before: "Average latency is 1.1 seconds, good enough."

After:

Stage p50 p95
End of speech detection 0.25 s 0.40 s
Transcription 0.15 s 0.30 s
Model first token 0.45 s 1.90 s
First audio 0.20 s 0.35 s
Total 1.05 s 2.95 s

The model's first token drives the tail. Speeding up text-to-speech would barely help.

What goes wrong

  • Averaging percentiles. Do not average per-call p95 values. Pool the turns and compute once.
  • Measuring on a fast office network. Cellular callers and distant regions add time you did not measure.
  • Counting the first turn only. The first turn often includes a cold start. Report it separately, then look at later turns.

Examples

Reading a trace

One turn: caller stops at 0.00 s, final transcript at 0.40 s, model first token at 1.95 s, first audio generated at 2.15 s, first audio played at 2.30 s. Time to first audio is 2.30 s. The biggest gap is 1.55 s between transcript and first token, so the model call is the stage to investigate.

Why the average lies

Twenty turns: nineteen take 0.9 s and one takes 6.0 s. The average is 1.15 s, which sounds acceptable. The p95 is 0.9 s or 6.0 s depending on the method, so use enough turns that the tail shows up as a stable number.

Key points

  • Time to first audio, from the caller's last word to the first sound heard, is the headline latency measure for a voice agent.
  • Percentiles show the experience of slow calls: p50 is typical, p95 is the one-in-twenty bad turn.
  • Per-stage traces show which stage, such as transcription or model first token, drives the tail.
  • Percentiles need hundreds of turns and realistic load to mean anything.
  • Pool turns before computing a percentile; never average percentiles from separate calls.

Common mistakes

  • Reporting only the average round trip.
  • Calling a single stage's time the total latency.
  • Computing percentiles from a handful of calls.
  • Testing latency on the developer's network and one region only.

Check yourself · 2 of 3

What is time to first audio in a voice pipeline?

Choose one answer

Check yourself · 3 of 3

A trace shows model first token p95 at 1.9 s while the other stages stay under 0.4 s at p95. Where should you work first?

Choose one answer

Practice items, not counted towards your mastery.

Start here