How I built a sub-500ms latency voice agent from scratch

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

A developer built a custom voice agent orchestration layer from scratch in roughly one day, achieving ~400ms end-to-end latency — 2× faster than Vapi's equivalent setup. The post covers the full architecture: using Silero VAD for turn detection, Deepgram Flux for streaming transcription and turn-taking, Groq's llama-3.3-70b for ultra-low TTFT (~80ms), and ElevenLabs for TTS with pre-warmed WebSocket connections. Key lessons include: pipelining STT→LLM→TTS as a streaming chain rather than sequential steps, handling barge-ins by cancelling all in-flight requests simultaneously, and treating geographic co-location of services as a first-class design parameter. Deploying to Railway EU and using regional endpoints for Twilio, Deepgram, and ElevenLabs cut latency from 1.7s to ~790ms, and switching to Groq pushed it down to ~400ms. Source code is available on GitHub.

14m read timeFrom ntik.me
Post cover image
Table of contents
Why voice agents are hardStarting out: the turn-taking loopFirst pass: VAD and a pre-recorded responseWhere the VAD-only approach breaks downSecond pass: flux and a real voice agent pipelineRunning it locallyDeploying to productionModel selection
164 Impressions