huggingface/speech-to-speech
Build voice agents with open-source models
What it solves
Building a voice agent usually means paying for cloud APIs and dealing with keys. This project gives you a complete open-source pipeline that runs entirely on your own computer — no API key, no cloud service. It's designed for low-latency, natural voice conversations and is already in production as the conversation backend for thousands of Reachy Mini robots.
How it works
The system is a cascade of four components, each running in its own thread and connected by queues:
- Voice Activity Detection (VAD) – Silero VAD detects speech boundaries and handles turn-taking.
- Speech to Text (STT) – Parakeet TDT transcribes your spoken input (with optional live partial transcripts).
- Language Model (LLM) – Qwen3.5-4B generates the response, streaming text and tool calls.
- Text to Speech (TTS) – Qwen3-TTS synthesizes audio and streams it back to you.
Every stage is swappable — you can pick different backends for each component. The server speaks the OpenAI Realtime protocol over WebSocket and WebRTC, so any app already built for OpenAI's Realtime API can simply point to your own machine instead. The pipeline also supports optional speech-to-viseme extraction for timed mouth shapes on avatars or robots.
Who it's for
Developers and hobbyists who want to build voice assistants, chatbots, or hardware interfaces without relying on external services. It's especially relevant if you're working with robots, need offline capability, or want to keep conversations fully private on your own hardware.
Highlights
- Fully local and offline: everything runs on your computer after the first model download.
- OpenAI Realtime compatible: drop-in replacement for hosted OpenAI services.
- Modular and extensible: each pipeline stage (VAD, STT, LLM, TTS) has multiple interchangeable backends.
- Interruption-aware: user speech can cut off the assistant's reply, making conversations feel natural.
- Production‑tested: powers thousands of Reachy Mini robots in the field.
- Tools support: optional local Python tools can be called from the client.
Related
- Dispatch
- Project
- Project
- Project
- Project