← All IntelIntel / article
Engineering Rag
- Source
- elevenlabs.io
- Publisher
- ElevenLabs
- Author
- ElevenLabs editorial sitemap
- Date
Why it matters
Racing several small models for query rewriting, with a raw-message fallback after one second, halved median RAG latency without a single-provider . The pattern applies to any agent that runs retrieval on every turn.
Key takeaways · AI-distilled
- ElevenLabs found query rewriting, which collapses dialogue history into a self-contained query, accounted for more than 80% of its latency while it depended on one externally hosted .
- The redesign sends each rewrite to several models at once, including self-hosted Qwen 3-4B and 3-30B-A3B, and keeps the first valid response.
- ElevenLabs reports latency fell at every percentile: median 326ms to 155ms, p75 436ms to 250ms, and p95 629ms to 426ms.
- Racing also smoothed peak-hour slowdowns from external providers: during one provider's outage, conversations continued on the self-hosted models, and ElevenLabs says the extra compute cost was negligible because it already runs that infrastructure.
Terms in this piece · Glossary
- RAG — Retrieval-augmented generation — fetching relevant documents first and pasting them into the model's context so it answers from your data instead of memory.
- Dependency — Anything a program needs to run that its author did not write: the language, its standard library, or a separately installed package.
- Retrieval — Selecting evidence relevant to the current request.
- Large language model — A model trained on large amounts of data to process and generate language.
Read the source elevenlabs.io
More from ElevenLabs editorial sitemap
Recommended reads

