SuperAPI AI Directory

speech-to-speech

Low-latency, fully modular voice-agent pipeline (VAD → STT → LLM → TTS) from Hugging Face. Exposes an OpenAI Realtime-compatible WebSocket API; every component is swappable, supporting fully local or API-backed deployment. Used in production as the conversation backend for Reachy Mini robots.

Open website

About this tool

Speech-to-Speech is an open-source voice agent project developed by Hugging Face, with the goal of letting users build low-latency voice dialogue systems using open-source models, and it can run entirely on a local computer. A single command starts a conversation, with no API key and no cloud service required.

Purpose

This project is used to build voice agents, chaining speech recognition, language model inference, and speech synthesis into a low-latency conversational pipeline. It can run as a standalone application, or serve as a conversation backend for other applications, robots, and clients to connect to. The official description states that it is already in production use as the conversation backend for thousands of Reachy Mini robots.

Main capabilities

The pipeline is composed of four components in cascade, each running in a separate thread and connected through queues:

  • Voice Activity Detection (VAD): by default uses Silero VAD v5, detecting speech boundaries and turn-taking.
  • Speech-to-Text (STT): transcribes one turn of user speech, with optional real-time partial transcription.
  • Language Model (LLM): generates replies, supporting streaming text and tool calling.
  • Text-to-Speech (TTS): synthesizes audio and streams it back to the client.

The default pipeline is Silero VAD → Parakeet TDT → Qwen3.5-4B → Qwen3-TTS, and each stage can be replaced via CLI parameters. The project also supports optional speech-to-viseme extraction, providing lip shapes with timing information for avatars and robot clients after TTS, enabled via --enable_visemes.

The server implements the OpenAI Realtime protocol, supports WebSocket and WebRTC, and has real-time transcription and low-latency turn-taking capabilities. The WebSocket client connection address is /v1/realtime. The server implements the core Realtime event set: inbound includes input_audio_buffer.append, session.update, conversation.item.create, conversation.item.truncate, response.create, response.cancel; outbound includes speech start/stop, streaming transcription, audio deltas, tool calls, and response.done. The official description states that this is a tested core subsetset, and does not claim to be fully equivalent to the complete OpenAI Realtime API.

In addition, --enable_llm_proxy allows the realtime server to expose the configured remote LLM as an ordinary OpenAI-compatible endpoint, so that clients can concurrently perform tasks such as summarization, titling, and background agents beyond voice conversations.

Usage

Requires Python 3.10+ (3.11 recommended). After installation, run a single command to start a conversation: speak, pause, and the assistant will answer through the speakers; press Ctrl+C to stop. The first run will download models, which takes a few minutes. Headphones are recommended, or add --local_audio_block_mic_during_playback to prevent the assistant from hearing its own voice.

On Ubuntu, the audio libraries must be installed first: sudo apt-get install libportaudio2 libsndfile1. The default Linux Qwen3-TTS wheel targets CUDA 12.8 and Ubuntu 24.04. On Windows, use .venv\Scripts\Activate.ps1 to activate the environment.

Connect your own application: the local command runs the server and the microphone client in the same process; when running only the server, it listens on ws://127.0.0.1:8765/v1/realtime. You can connect using the packaged audio client, the browser demo, any client that uses the core OpenAI Realtime events (the OpenAI Agents SDK has been tested on both transports), or LiveKit Agents.

The LLM backend is replaceable: you can change the local model (--model_name), connect via a local Responses API with llama.cpp, or hand the LLM off to a hosted provider (--llm_backend responses-api or chat-completions). When using the default speech model, 24 GB of unified memory is recommended on Mac, and 16 GB of VRAM on NVIDIA, of which about 8 GB is used for the speech pipeline.

It also supports direct audio input mode (--stt none --llm_backend chat-completions), which sends each completed VAD audiosegment directly to the audio input model; this mode does not support the responses-api backend.

Use cases

Suitable for privacy-focused voice conversation applications that want to run fully locally; suitable for developers who need to replace any pipeline component; suitable for applications built for the OpenAI Realtime API that want to point to a local machine; suitable for scenarios such as robots and avatars that require low-latency voice interaction and lip sync.

Limitations

  • The first run requires downloading models, which takes several minutes.
  • The default Linux Qwen3-TTS wheel targets CUDA 12.8 and Ubuntu 24.04; other systems should refer to the CUDA instructions.
  • The server itself does not perform authentication or rate limiting. When the LLM proxy is enabled, it should only be used on a trusted network or deployed behind a gateway responsible for access control.
  • Direct audio input mode must explicitly set an audio-capable --model_name; the default model does not accept audio input.
  • Some optional components have dependency conflicts, for example DeepFilterNet requires numpy<2, which conflicts with Pocket TTS, which requires numpy>=2.
  • --mode is deprecated and will stop working soon.
  • No official information is provided regarding charges, pricing, etc.