| name | elevenlabs-performance-tuning |
| description | Optimize ElevenLabs TTS latency with model selection, streaming, caching, and
audio format tuning. Use when experiencing slow TTS responses, implementing
real-time voice features, or optimizing audio generation throughput.
Trigger with "elevenlabs performance", "optimize elevenlabs", "elevenlabs
latency", "elevenlabs slow", "fast TTS", "reduce elevenlabs latency", or
"TTS streaming".
|
| allowed-tools | Read, Write, Edit |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","voice","ai","elevenlabs","performance","optimization"] |
| compatibility | Designed for Claude Code |
ElevenLabs Performance Tuning
Overview
Optimize ElevenLabs TTS latency and throughput through model selection, streaming strategies, audio format tuning, and caching. Latency ranges from ~75ms (Flash) to ~500ms (v3) depending on configuration.
The two highest-leverage, lowest-effort levers — model choice (Step 1) and output format (Step 2) — are documented inline below. The four deeper integrations (HTTP streaming, WebSocket streaming, caching, parallel generation) are summarized here with copy-ready code in the full implementation walkthrough.
Prerequisites
- ElevenLabs SDK installed (
@elevenlabs/elevenlabs-js)
- An ElevenLabs API key exported as
ELEVENLABS_API_KEY (used by the SDK and passed as xi_api_key on the WebSocket handshake)
- Understanding of your latency requirements
- Audio playback infrastructure (browser, mobile, server-side)
Instructions
Step 1: Model Selection for Latency
The single biggest performance lever is model choice:
| Model | Avg Latency | Quality | Languages | Use Case |
|---|
eleven_flash_v2_5 | ~75ms | Good | 32 | Real-time chat, IVR, gaming |
eleven_turbo_v2_5 | ~150ms | Good | 32 | Balanced speed/quality |
eleven_multilingual_v2 | ~300ms | High | 29 | Narration, content creation |
eleven_v3 | ~500ms | Highest | 70+ | Maximum expressiveness |
function selectModel(useCase: "realtime" | "balanced" | "quality" | "max_quality"): string {
models = {
: ,
: ,
: ,
: ,
};
models[useCase];
}