kyutai-labs/pocket-tts

A TTS that fits in your CPU (and pocket)

Pocket TTS – lightweight CPU‑only text‑to‑speech

What it is – Pocket TTS is a Python library (and CLI) that turns written text into spoken audio. It ships a 100 M‑parameter neural TTS model that runs efficiently on a regular CPU, so you don’t need a GPU or a remote web API. The project also provides training scripts, a small set of pre‑made voices, and a way to clone any voice from a short audio clip.

Key capabilities

  • CPU‑first: works with the CPU‑only PyTorch build; on a MacBook Air M4 it can generate speech ~6× faster than real‑time using only two cores.
  • Low latency: first audio chunk appears in ~200 ms, enabling streaming output.
  • Multi‑language: English, French, German, Portuguese, Italian, Spanish, Dutch (more can be added).
  • Voice cloning: supply a wav file (or a pre‑computed safetensors embedding) to synthesize speech in that speaker’s timbre.
  • Streaming / infinite‑length text: the model can keep producing audio for arbitrarily long inputs.
  • CLI & HTTP server: pocket-tts generate for one‑off files, pocket-tts serve for a local REST endpoint with a tiny web UI.
  • Python API: TTSModel.load_model(), get_state_for_audio_prompt(), generate_audio() – returns a 1‑D torch tensor you can write with scipy.io.wavfile.
  • In‑browser possibilities: community ports to WebAssembly, ONNX‑Runtime‑Web, Rust‑based XN, etc.
  • Training code: a training/ folder lets you fine‑tune or train new models; community‑trained checkpoints are listed in the README.

How to get started

  1. Install the package (CPU‑only PyTorch recommended):
    pip install pocket-tts                     # or `uv add pocket-tts`
    # on Linux, avoid the CUDA wheels:
    pip install pocket-tts --extra-index-url https://download.pytorch.org/whl/cpu
    
  2. Generate a wav with the CLI:
    pocket-tts generate --text "Hello world" --voice alba
    
    The file tts_output.wav appears in the current directory and speed stats are printed.
  3. Run a local server for repeated calls:
    pocket-tts serve   # then POST to http://localhost:8000
    
  4. Use the library in code:
    from pocket_tts import TTSModel, export_model_state
    model = TTSModel.load_model()
    voice = model.get_state_for_audio_prompt("alba")
    audio = model.generate_audio(voice, "Hello from Python!")
    
    Export a voice embedding for fast reuse:
    export_model_state(voice, "alba.safetensors")
    

Community & extensions

  • Several alternative runtimes (MLX for Apple Silicon, Candle, ONNX, C++, C#, Rust, etc.) let you run Pocket TTS on embedded devices, Windows, or directly in the browser.
  • A growing list of community‑trained language models (Czech, Hindi, Korean, Persian, Indonesian, …) can be invoked via the --config flag.
  • The project is open‑source, accepts contributions, and provides a CONTRIBUTING.md for developers.

When to use it

  • You need fast, offline TTS on a laptop, server, or edge device without GPU drivers.
  • You want to embed TTS in a Python app, a CLI tool, or a lightweight web service.
  • You prefer a small model footprint (≈100 M parameters, a few hundred MB) over large, cloud‑only solutions.

Links

Related

  • Project
  • Project
  • Project
  • Project
  • Project