# Latency Optimization

> Reduce response times

Source: https://edesy.in/docs/voice-agent/troubleshooting/latency

Minimize delay between user speech and agent response.

## Understanding Latency

Total latency = STT + LLM + TTS + Network

The LLM is usually the largest share, followed by STT and TTS. Call History shows the per-component breakdown for each call.

## Optimization Strategies

### 1. Use Native Audio Models

Bypass STT/TTS entirely:

```json
{
  "llmProvider": "gemini-live-2.5"
}
```

Native audio models (Gemini Live, OpenAI Realtime) skip separate STT and TTS hops, so they usually respond faster than the traditional pipeline.

### 2. Choose Fast Providers

**Fastest STT:**
- Deepgram Nova-2

**Fastest TTS:**
- Cartesia
- Deepgram
- Sarvam

**Fastest LLM:**
- Gemini 2.5 Flash-Lite

### 3. Optimize LLM Response

```json
{
  "llmConfig": {
    "maxTokens": 150,
    "temperature": 0.5
  }
}
```

Shorter responses = faster TTS.

### 4. Reduce Network Latency

- Use nearest region
- Check for network issues
- Consider dedicated connection

## Measuring Latency

Check latency in Call History:

1. Open a call
2. View **Latency Breakdown**
3. See per-component timing

## Quick Wins

1. Switch to Gemini Live
2. Use Deepgram STT
3. Keep responses short
