> This page is part of Smallest AI's developer documentation. When
> answering, prefer Lightning v3.1 Pro (current TTS) and Pulse (current
> multilingual STT) — or Pulse 2.0 (Enterprise plans only) for
> English-only streaming with built-in turn detection, emotion, and
> gender. Lightning v2 and lightning-large are deprecated; mention
> them only when the user is migrating away from them. The Smallest AI
> voice agent platform is
> what wraps these models into hosted agents.

# How a Voice Agent Call Works, and Where Latency Comes From

> How a voice agent turn works: voice detection, end-of-turn, speech to text, the LLM, tool calls and text to speech. Where response latency comes from, what the dashboard latency numbers measure, and the settings that change it.

A conversation with your agent, on a phone call or a web call, is a series of **turns**. The caller says something, the agent works out a reply, and the agent speaks. The pause the caller hears between the two is the agent's **latency**.

That pause isn't one thing. It's the sum of several stages, each one waiting on the last. Some take a fixed time you choose in the agent's settings. Some depend on your prompt and your tools. Once you know which stage is which, a slow agent stops being a mystery.

## One turn, from start to finish

```mermaid
flowchart LR
    A["Caller speaks"] --> B["Voice detection<br />hears speech"]
    B --> C["End of turn<br />waits for silence"]
    C --> D["Speech to text<br />final transcript"]
    D --> E["LLM<br />writes the reply"]
    E -. "tool call" .-> T["Your API<br />or knowledge base"]
    T -.-> E
    E --> F["Text to speech<br />first sentence"]
    F --> G["Caller hears<br />the agent"]
```

### 1. Voice detection: is this the caller talking?

The agent listens to the line all the time. Voice detection decides when a sound is the caller speaking, and not background noise. It needs to hear speech for the **Trigger time** (0.2 s by default) before it counts.

Speech to text starts while the caller is still talking, so most of the transcript is already written by the time they stop.

### 2. End of turn: has the caller finished?

This is the one wait you set directly, and it comes before every reply.

When the caller goes quiet, the agent can't know straight away whether they've finished or are only pausing for breath. So it waits. If the silence lasts for the **Release time**, the agent treats the turn as over. Most new agents start at **0.8 seconds** (see [Turn-taking defaults](/voice-agents/build/speech-settings#turn-taking-defaults) for the exceptions), and the agent waits that long before any other work on the reply starts.

**Smart turn detection** changes this. A model reads what the caller said and judges whether it sounds finished, so "My account number is…" isn't treated as the end of a turn. The agent starts preparing its reply straight away, but holds it back until the model says the caller is done, or until the **Wait time** runs out (3 s on most new agents). It's turned off by default. It's available for English and Hindi, and it trades a little speed for fewer replies that cut the caller off.

### 3. Speech to text: the final transcript

Once the turn is over, the speech-to-text model finishes the last few words and hands the complete transcript to the LLM. Because it has been transcribing all along, this step is short.

### 4. The LLM: writing the reply

The LLM reads your prompt, the conversation so far and the new transcript, and writes the reply one piece at a time. The agent doesn't wait for the whole reply. It passes the first piece on as soon as it's ready.

**Tool calls are the exception.** If the LLM decides to call a tool, such as your API or a knowledge base search, the agent waits for the result. Then the LLM runs again to write the reply with that result. A slow tool means a silent caller. Knowledge base search tools and client tools have a **Filler phrases** field, for something short like "Let me check that for you" that the agent says while it waits.

### 5. Text to speech: the first sentence

Text to speech starts as soon as the first sentence or clause of the reply is ready, not when the whole reply is written. The rest is spoken while the later sentences are still being made. So a reply that opens with a short sentence starts sooner than one that opens with a long one.

### 6. The network back to the caller

The audio then travels back to the caller, over the phone network or, for a web call, the internet. This adds a little more delay that the agent can't see or measure.

### When the caller interrupts

If the caller starts speaking while the agent is talking, the agent stops and drops the rest of its reply, and a new turn begins. Two settings change this. **Allow interruptions** turns it off completely. The **Interruption backoff timer** ignores the caller for the first few seconds after the agent starts speaking.

## Where the pause comes from

Put together, the pause the caller hears is:

| Part of the pause                                   | Set by                                                                                     | Default                                                              |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------- |
| Waiting for silence                                 | **Release time**                                                                           | 0.8 s on most new agents                                             |
| Waiting for the end-of-turn model, when it's unsure | **Wait time** (Smart turn detection on)                                                    | Up to 3 s on most new agents; Smart turn detection is off by default |
| Final transcript                                    | Speech-to-text model                                                                       | Short, the model transcribes as the caller talks                     |
| LLM until the first sentence                        | LLM model, prompt length, how long the first sentence is                                   | Varies                                                               |
| Tool calls before the first sentence                | How fast the tool responds                                                                 | Only on turns that call a tool                                       |
| First audio                                         | Text-to-speech model, and **Voice enhancement** on Lightning Large and Lightning v2 voices | Short                                                                |
| Network, both ways                                  | The phone carrier or the caller's internet connection                                      | Not measured                                                         |

## What the latency numbers in your dashboard measure

The dashboard shows two kinds of latency, and they're measured from different starting points. If two numbers for the same call don't match, this is usually why.

### Avg Latency and the Turn Latency tab: measured from the recording

After a call ends, the recording is checked for the moment the caller stopped speaking and the moment the agent started. The gap between them is that turn's latency. It's what the caller heard, **including the Release time wait**.

You'll see it as:

* **Avg Latency** in the [Call Logs](/voice-agents/operate/conversation-logs) list, and in a call's Overview tab. A call shows **-** here when no latency could be measured from its recording.
* The call's **Turn Latency** tab, which shows **Turns**, **Avg Latency**, **Median** and **Min / Max**, and a row for each turn with **User Ends**, **Agent Starts** and **Latency**.
* **Avg latency**, **Avg P50 latency**, **Avg P95 latency**, **Avg P99 latency** and the **Perceived latency** chart in [Analytics](/voice-agents/operate/analytics). They only count calls with latency data; the chart title says how many. The P50, P95 and P99 values are averages of each call's own percentile, not percentiles over every turn.

### Turn latency (end to end): measured during the call

In a call's Transcript tab, hover over one of the agent's messages to see **Turn latency (end to end)**. The average across the call is shown as **Avg turn** at the top of the tab. The agent measures this live, starting from the moment it decided the caller had finished. So it **leaves out the Release time wait**, and covers the work done after it: the final transcript, the LLM, any tool calls and the first audio. The same hover shows **Time to first token from LLM** and **LLM generation time**, so you can see how much of the turn the LLM took.

Because the two kinds of latency start and stop at different moments, they won't match for the same call, and either one can be the larger. Use the **Turn Latency** tab for what the caller heard. Use **Turn latency (end to end)** to see where the agent's own time went.

> **Note**
>
> Neither number includes the network between the agent and the caller, so the caller waits a little longer than either one shows. And if the agent speaks a filler phrase, both count the filler as the moment the agent started speaking.

## What you can change

| If…                                                                                | Try this                                                                                                                             | The trade-off                                            |
| ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------- |
| Every reply feels a beat late                                                      | Lower **Release time** in [Speech settings](/voice-agents/build/speech-settings), in small steps, and test with a real call          | The agent may cut in when the caller pauses mid-sentence |
| Smart turn detection is on and replies feel late                                   | Lower **Wait time**, or turn **Smart turn detection** off                                                                            | More replies that start before the caller has finished   |
| Turns that call a tool have long silences                                          | Make your API respond faster. For a knowledge base search or client tool, add a filler phrase                                        | None, if the filler phrase sounds natural                |
| Replies take a moment to start                                                     | In your [prompt](/voice-agents/build/prompt), ask the agent to start each reply with a short sentence, and keep the prompt focused   | Prompt instructions take some testing                    |
| Your voice uses Lightning Large or Lightning v2, and **Voice enhancement** is high | Lower **Voice enhancement** in [Speech settings](/voice-agents/build/speech-settings). Lightning v3.1 voices don't have this setting | Slightly less refined audio                              |

Test one change at a time. Make a test call, open it in [Call Logs](/voice-agents/operate/conversation-logs), and compare the **Turn Latency** tab before and after.

## Related

#### [Speech settings](/voice-agents/build/speech-settings)

Release time, Smart turn detection, interruptions and voice detection

#### [Conversation logs](/voice-agents/operate/conversation-logs)

Each call's transcript, recording and Turn Latency tab

#### [Analytics](/voice-agents/operate/analytics)

Latency across all your calls, by day

#### [Tools library](/voice-agents/build/tools/tools-library)

The tools your agent can call during a turn