Skip to content
Visual explainer 3h to learn 5 steps

Measure voice agent latency and set a latency budget

Measure time to first audio, turn latency, tool delays and dropout recovery, and set a latency budget across gateway, model and tool.

By Invicly Tech, , in n8n, AI Automation and Voice Agents. About 8 minutes to read.

Topic 30 of 43

In short

Callers notice delay quickly. You measure time to first audio, turn latency and tool delay, then split a total budget across the voice gateway, the model and any tool the agent waits for. You also test overlapping speech and dropouts, because averages hide the bad moments.

Think of it like this: A latency budget is like a commute: if you must arrive in 30 minutes, you decide how long for the walk, the train and the last stretch, and you notice when one leg runs over.

Explained simply

On a phone call, silence feels long. If the assistant takes three seconds to answer, callers wonder whether the line is dead. So voice teams measure delay carefully and set targets.

The most important number is time to first audio: how long it takes, after the caller stops speaking, before they hear the start of the reply. Turn latency covers the whole exchange. Tool delay is how long the agent waits for something like a calendar lookup.

A latency budget splits your target across the steps. The gateway needs some, the model needs some, and a tool call needs some. When the total is too long, the budget shows you which step to fix first, instead of guessing.

Averages hide pain. If nine turns take one second and one takes six, the average looks fine but the caller remembers the six. So report percentiles such as p95, and test hard cases on purpose: people talking over each other and a connection that briefly drops.

Press Play on a diagram to walk through it one step at a time.

FlowWhere one turn spends its time
  1. 1
    Caller stops

    Turn detection waits a short moment

  2. 2
    Gateway

    Audio travels to the provider

  3. 3
    Model

    Thinks and starts the reply

  4. 4
    Tool call

    Optional lookup, such as availability

  5. 5
    First audio

    Caller hears the answer begin

SequenceOne turn with a tool call
Caller
Voice gateway
Model
Availability tool
  1. 1Speaks, then stops
    Caller to Voice gateway: Speaks, then stops
  2. 2Turn sent to model
    Voice gateway to Model: Turn sent to model
  3. 3Tool call: check slots
    Model to Availability tool: Tool call: check slots
  4. 4Result within timeout
    Availability tool to Model: Result within timeout
  5. 5First audio chunk
    Model to Voice gateway: First audio chunk
  6. 6Caller hears the reply
    Voice gateway to Caller: Caller hears the reply

In depth

What to measure and where

Add timestamps at each hop and write them with the call ID. You want four moments: the caller stops speaking, the model receives the turn, the first audio chunk leaves the provider, and the first chunk plays. Subtract to get each leg. Measure tool calls separately, from the moment the model requests a tool to the moment the result returns. Collect many turns, not a few. Without this data you cannot tell whether slowness comes from the network, the model or your own service.

  • Time to first audio (the headline number)
  • Turn latency (full exchange)
  • Tool latency (per tool, with timeouts)
  • Dropout count and recovery time

Setting the budget

Pick a target for p95 time to first audio. Then assign a share to each step, leaving a little slack. Turn detection itself waits a short moment to be sure the caller has finished, and that wait counts. If a tool is on the critical path, give it a strict timeout and a spoken filler or fallback when it is late. Another option is to answer quickly from known data and run slow work in the background, so the caller is not left waiting.

CompareWays to meet a tight budget
Speed up the step
  • Cache availability
  • Smaller tool payloads
  • Closer region
Move it off the turn
  • Answer now, confirm later
  • Run slow work in n8n
  • Send the result as a text or email
Hide the wait
  • Short spoken filler
  • Ask a follow-up question
  • Use only when needed

Testing overlap and dropouts

Real conversations are messy. Test a caller who starts talking mid-sentence, two short utterances back to back, and silence in the middle of a turn. Then test the network: add delay and packet loss with a network tool or a browser throttle and watch what the agent does. Does it recover, repeat itself, or hang? Record the recovery time. Use synthetic audio so the same test can be repeated after each change.

  • Overlapping speech with fixed timing
  • Long pauses inside a turn
  • Packet loss and jitter on purpose
  • Reconnect and resume checks

Learn it in 5 short steps

About 35m each. Track them with a timer in your plan.

  1. 1
    Measure time to first audio~35m
  2. 2
    Measure turn and tool latency~35m
  3. 3
    Test overlapping speech~35m
  4. 4
    Test dropout recovery~35m
  5. 5
    Split the latency budget~35m

Key points

  • Time to first audio is from the caller finishing speaking to the first sound of the reply.
  • Report percentiles (p50 and p95), not only the average.
  • A synchronous tool call sits inside the turn, so give it a strict timeout and a small share of the budget.
  • Test overlapping speech and dropped packets on purpose, not only clean audio.

Key terms

Tap a card to flip it. 0/5 known

Examples

text
Target time to first audio: 1200 ms (p95)
  Turn detection wait:   300 ms
  Gateway round trip:    150 ms
  Model start:           450 ms
  Tool call (timeout):   250 ms
  Slack:                  50 ms

A sample budget for one turn. Numbers are for illustration; measure your own.

Compute p50 and p95 from logged turns

Scenario: you logged time to first audio for 200 synthetic turns. Steps: sort the values and read the 50th and 95th percentile positions. Evidence: p95 is clearly higher than p50, which shows the slow tail. Rollback: if a change makes p95 worse, revert it.

ts
function pct(values: number[], p: number) {
  const s = [...values].sort((a, b) => a - b);
  const i = Math.min(s.length - 1, Math.ceil((p / 100) * s.length) - 1);
  return s[i];
}
console.log("p50", pct(ttfa, 50), "p95", pct(ttfa, 95));

A timeout and a safe fallback for a slow tool

Scenario: the availability lookup sometimes takes two seconds. Steps: race the call against a 400 ms timer. If the timer wins, the tool returns a safe message and the agent says it will check and follow up. Evidence: the call continues smoothly and no wrong slot is offered.

ts
const timeout = new Promise((r) => setTimeout(() => r(null), 400));
const result = await Promise.race([lookupSlots(day), timeout]);
if (!result) {
  return { ok: false, message: "Calendar is slow. I will confirm by message." };
}
return { ok: true, slots: result };

Quick reference

  • Time to first audio: end of caller speech to first reply sound.
  • Report p50 and p95, never only the average.
  • Budget each step: turn detection, gateway, model, tool.
  • Give synchronous tools a hard timeout and a safe fallback.
  • Test overlap, long pauses, jitter and packet loss on purpose.
  • Use synthetic audio so tests repeat exactly.

Common mistakes

  • Reporting only the average, which hides the slow turns callers actually remember.
  • Measuring on a fast office network and ignoring mobile conditions.
  • Letting a tool wait for a calendar with no timeout.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1What does time to first audio measure?

Question 2

2Why report p95?

Question 3

3A tool call is on the critical path and slow. What helps most?

Question 4

4Which test is most useful for dropout recovery?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    Write the four timestamps you need to measure time to first audio for one turn.

  2. Exercise 2medium

    Split a 1200 ms p95 target into a budget for turn detection, gateway, model, tool and slack.

  3. Exercise 3hard

    Design a test plan that checks overlapping speech and dropout recovery using synthetic audio, and say what you record.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

What is a good latency for a voice agent?
It depends on the use case, but replies that begin within about a second or so feel natural. Measure your own and set a target.
Why is the first audio chunk the key number?
Callers react to when the assistant starts to speak, not when it finishes.
Do tool calls slow the turn?
Yes, if the model waits for them. Keep them fast, bounded by a timeout, or move slow work to the background.

Go deeper

ShareXLinkedInWhatsApp