Build Voice AI agents locally!
HuggingFace's speech-to-speech is a fully modular voice agent pipeline that runs entirely on open-source models. Every component is swappable and every stage runs in its own thread connected by queues.
The pipeline exposes an OpenAI Realtime-compatible WebSocket API. Any existing OpenAI Realtime client can point at this server instead of OpenAI by changing one URL.
Here is how it works:
1. Voice Activity Detection - Silero VAD v5 detects speech boundaries and turn-taking
2. Speech to Text - transcribes the user's turn with optional live partial transcripts
3. Language Model - generates the response, streaming text and tool calls
4. Text to Speech - synthesizes audio and streams it back to the client
Every stage has multiple interchangeable backends you can select via CLI flags. For a fully local setup, run Gemma 4 via llama.cpp alongside the pipeline with Parakeet TDT for STT and Qwen3-TTS for speech output. No API keys needed.
Key capabilities:
• OpenAI Realtime-compatible WebSocket API - drop-in replacement
• Fully local with no API keys via llama.cpp + Parakeet TDT + Qwen3-TTS
• STT: Parakeet TDT, Whisper, Faster Whisper, Paraformer
• TTS: Qwen3-TTS, Kokoro, Pocket TTS, ChatTTS, MMS TTS
• Multilingual with automatic language detection
• Four run modes: Realtime, Local, Raw WebSocket, TCP Socket
100% open source.
I've shared the link in the replies!