Phase 4: LLM Orchestration for Voice · 45 min · Python · OpenAI SDK · Anthropic SDK
Model Selection for Voice Agents
First-token latency is the metric that matters for voice. Choose your LLM accordingly.
What you will learn
- Select voice-appropriate LLMs based on first-token latency, cost, and conversation complexity
- Compare GPT-4o-mini, Claude 3.5 Haiku, Llama 3.1 on Groq, and Gemini 2.0 Flash for voice
- Implement model routing: cheap model for simple queries, expensive for complex
- Measure and compare first-token latency across providers
The Problem
Voice agents have unique LLM requirements that text chatbots don't:
- Latency budget: Only 150-250ms for LLM (out of 500ms total)
- Streaming required: Must stream tokens for TTS pipeline
- Short responses: Voice responses must be concise (2-3 sentences)
- Tool calling: Must call APIs mid-conversation (check balance, book flight)
- Cost sensitivity: Per-call cost matters at scale
The Concept
LLM Requirements for Voice
| Requirement | Why It Matters | Target |
|---|
| TTFT (Time to First Token) | Caller waits in silence | <200ms |
| Streaming | Pipe tokens to TTS | Must support |
| Response length | Voice = short answers | System prompt controls |
| Tool calling | Check systems mid-call | Must support |
| Context window | Conversation history | 8K-128K tokens |
| Cost per call | Scale economics | <$0.01 per call |
Model Comparison for Voice
| Model | Relative latency | Quality | Cost/1M tokens (Oct 2026) | Tool Calling | Streaming | Best For |
|---|
| GPT-6.1 Sol | Moderate | Excellent | $2.00 in / $10.00 out | Yes | Yes | Premium agents |
| GPT-6 Luna | Low | Good | $0.10 in / $0.50 out | Yes | Yes | Standard agents |
| Claude Sonnet 5.5 | Low ("fast") | Excellent | $2.00 in / $10.00 out | Yes | Yes | Complex reasoning |
| Claude Haiku 5.5 | Lowest ("fastest") | Good | $0.10 in / $0.50 out | Yes | Yes | Fast, cheap |
| Small open model (self-hosted) | Lowest on local GPU | Fair | $0 API (you pay for the GPU) | Yes | Yes | Ultra-low latency, privacy |
Latency labels come from the providers' own descriptions; time-to-first-token (TTFT) moves with load, region and prompt length, so measure TTFT on your own traffic before committing to a latency budget. Prices change too; check the provider's pricing page when you build.
Why is a small model like GPT-6 Luna often better than GPT-6.1 Sol for voice agents?
Voice replies are usually 2-3 sentences and rarely need deep reasoning, so the quality gap is small, while a smaller model typically returns its first token sooner, which is the part of the latency budget the caller feels. On price: $0.10 vs $2.00 per 1M input tokens is 20x. At 100K calls/month with ~500 input tokens each: GPT-6.1 Sol = $100/month of input cost, GPT-6 Luna = $5/month. Use the larger model only for complex reasoning (multi-step tool calling, nuanced negotiation).
The Latency Budget Breakdown
An example budget. The TTFT rows are illustrative; replace them with what you measure.
| Component | Budget | Large model | Small model | Self-hosted small |
|---|
| ASR | 150ms | 150ms | 150ms | 150ms |
| LLM TTFT | 200ms | 250ms | 150ms | 80ms |
| TTS TTFB | 100ms | 120ms | 120ms | 120ms |
| Network | 50ms | 50ms | 50ms | 50ms |
| Total | 500ms | 570ms | 470ms | 400ms |
Model Selection Decision Flow
Cost Analysis at Scale
| Volume | GPT-6.1 Sol or Claude Sonnet 5.5 ($2/$10) | GPT-6 Luna or Claude Haiku 5.5 ($0.10/$0.50) |
|---|
| 1K calls | $2.00 | $0.10 |
| 10K calls | $20.00 | $1.00 |
| 100K calls | $200 | $10.00 |
| 1M calls | $2,000 | $100 |
Assumes 500 input tokens, 100 output tokens per call
This lesson is free
You've read the first 2 sections. The rest covers Build, Check Yourself, Key Terms & Next. A free account opens all of it, with its practice questions and its lab. No card.
Create a free account — the opening phases of 29 of 35 courses, and the first lesson of every phase, are free, no credit card.
Browse all courses · View pricing · DeVenture Academy