Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Modal 12 min read Case study mediumAdept

One-second voice-to-voice latency with Modal, Pipecat, and open models

A conversational voice bot on Modal reaches roughly one-second voice-to-voice latency. It uses Pipecat to orchestrate an STT → RAG → LLM → TTS pipeline with Parakeet-tdt-v3, Qwen3-4B-Instruct on vLLM, Kokoro TTS, and ChromaDB with all-MiniLM-L6-v2 retrieval. The main latency levers are running the stateful Pipecat bot on CPU while GPU services autoscale independently, using Pipecat's local VAD and SmartTurn to segment audio instead of streaming STT, and tuning vLLM for time-to-first-token. On the network side, the bot talks to services over WebSockets through Modal Tunnels that bypass the input plane, with a spawned FunctionCall session restoring autoscaling, and services are pinned to clustered regions near the user. Latency was measured by recording real conversations and diarizing them with Pyannote across region and tunnel configurations.

Related posts

  • Reachy Mini goes fully local

    Hugging Face mediumAdept

    Reachy Mini's conversation app can now run entirely on local hardware using the speech-to-speech library, a cascaded VAD → STT → LLM → TTS pipeline that exposes a Realtime API-compatible /v1/realtime WebSocket. The recommended stack is Silero VAD, Parakeet-TDT 0.6B v3 for STT, Qwen3-TTS, and Gemma 4 served by llama.cpp. The LLM can also run in-process via MLX or Transformers, or behind any Responses API server such as vLLM (≥0.21.0 for tool-call streaming), HF Inference Endpoints or OpenAI. LLM inference is the main latency bottleneck, so the guide recommends disabling thinking tokens and enabling multi-token prediction where the model supports it.

  • FastRTC: The Real-Time Communication Library for Python

    Hugging Face mediumAdept

    FastRTC is a Python library for building real-time audio and video AI applications over WebRTC or WebSockets without needing WebRTC expertise. A `Stream` wrapped around a `ReplyOnPause` handler provides built-in voice activity detection and turn taking, auto-generates a Gradio test UI, and can be mounted onto any FastAPI app for production. Bundled speech-to-text (Moonshine) and text-to-speech (Kokoro) models, optimized for CPU inference, let a few lines of code chain STT, an LLM and TTS into a voice chat. `fastphone()` exposes the stream through a free phone number with a Hugging Face token.

  • How Decagon shipped real-time voice AI on Modal

    Modal hardMaster

    Decagon Voice 2.0 cut latency by 65% by replacing large frontier models with small open-source models fine-tuned through augmented multi-domain data, curriculum and mixed-objective SFT, and reinforcement learning. Modal's inference team trained a custom EAGLE3 draft model for speculative decoding by forking SpecForge, pre-training on broad conversational data and fine-tuning on Decagon's domain data, which gave 38% higher accept lengths than open-source baselines. They also built an asynchronous scheduler that made SGLang's speculative decoding sync-free, removing CPU stalls from the critical path, eliminating GPU idle time on H200s and improving throughput by up to 12%. The scheduler work is being upstreamed to SGLang.

  • Build Low-Latency Multilingual Voice Agents: Open Weights & Full Deployment Control with NVIDIA Magpie TTS

    Hugging Face easyNovice

    NVIDIA Magpie TTS Multilingual is a 364M-parameter open-weights text-to-speech model covering 12 languages, with Modern Standard Arabic, Korean and Brazilian Portuguese newly added. It is aimed at cascaded voice-agent pipelines where teams run their own ASR, LLM and TTS. Served as a NIM on-prem, it reaches 32–79 ms time-to-first-audio on a single stream across B200, H100, DGX Spark and A100. On B200 at 64 concurrent streams it delivers 239 ms TTFA at about 320× real time. The latency comes from frame stacking, which predicts two audio frames per decoder step, plus a local transformer that models codebook dependencies to recover quality. The release also lowers CER and raises speaker similarity on French and Spanish, and recommends specific sampling settings such as cfg_scale 2.5 and temperature 0.6.

  • Mr. Bones: A Pirate-Voiced Halloween Chatbot Powered by Docker Model Runner

    Docker mediumAdept

    A Home Depot animatronic skeleton becomes a pirate-voiced Halloween chatbot. A Raspberry Pi 5 captures speech and transcribes it with Vosk, then sends it to LLaMA 3.1 8B (Q4) served by Docker Model Runner on a gaming PC with an RTX 5070. ElevenLabs Flash speaks the reply, and Bluetooth audio drives the skeleton's jaw. The local model cut response time from about 4.5s with the ChatGPT API to 1.5s, and chunking the LLM output to the TTS service reduced perceived lag. A detailed system prompt keeps answers in character, kid-safe and short, and the post notes the remaining weak spots: dependence on the network and the multi-tier setup.

The quest for software engineering knowledge.

Look:
Layout: