A lightweight text-to-speech (TTS) application designed to run efficiently on CPUs.
Forget about the hassle of using GPUs and web APIs serving TTS models. With Kyutai's Pocket TTS, generating audio is just a pip install and a function call away.
Supports Python 3.10, 3.11, 3.12, 3.13 and 3.14. Requires PyTorch 2.5+. Does not require the gpu version of PyTorch.
Trying it from the website, without installing anything
Navigate to the Kyutai website to try it out directly in your browser. You can input text, select different voices, and generate speech without any installation.
Trying it with the CLI
The generate command
You can use pocket-tts directly from the command line. We recommend using
uv as it installs any dependencies on the fly in an isolated environment (uv installation instructions here).
You can also use pip install pocket-tts to install it manually.
This will generate a wav file ./tts_output.wav saying the default text with the default voice, and display some speed statistics.
bash
1uvx pocket-tts generate
2# or if you installed it manually with pip:3pocket-tts generate
Modify the voice with --voice and the text with --text. We provide a small catalog of voices.
You can take a look at this page which details the licenses
for each voice.
The --voice argument can also take a plain wav file as input for voice cloning.
You can use your own or check out our voice repository.
We recommend cleaning the sample before using it with Pocket TTS, because the audio quality of the sample is also reproduced.
Feel free to check out the generate documentation for more details and examples.
For trying multiple voices and prompts quickly, prefer using the serve command.
The serve command
You can also run a local server to generate audio via HTTP requests.
bash
1uvx pocket-tts serve
2# or if you installed it manually with pip:3pocket-tts serve
Navigate to http://localhost:8000 to try the web interface, it's faster than the command line as the model is kept in memory between requests.
Processing an audio file (e.g., a .wav or .mp3) for voice cloning is relatively slow, but loading a safetensors file -- a voice embedding converted from an audio file -- is very fast. You can use the export-voice command to do this conversion. See the export-voice documentation for more details and examples.
You can use this package as a simple Python library to generate audio from text.
python
1from pocket_tts import TTSModel
2import scipy.io.wavfile
34tts_model = TTSModel.load_model()5voice_state = tts_model.get_state_for_audio_prompt(6"alba"# One of the pre-made voices, see above7# You can also use any voice file you have locally or from Hugging Face:8# "./some_audio.wav"9# or "hf://kyutai/tts-voices/expresso/ex01-ex02_default_001_channel2_198s.wav"10)11audio = tts_model.generate_audio(voice_state,"Hello world, this is a test.")12# Audio is a 1D torch tensor containing PCM data.13scipy.io.wavfile.write("output.wav", tts_model.sample_rate, audio.numpy())
You can have multiple voice states around if
you have multiple voices you want to use. load_model()
and get_state_for_audio_prompt() are relatively slow operations,
so we recommend to keep the model and voice states in memory if you can.
For faster voice loading, you can export voice states to safetensors files:
python
1from pocket_tts import TTSModel, export_model_state, import_model_state
23model = TTSModel.load_model()45# Export a voice state for fast loading later6voice_state = model.get_state_for_audio_prompt("alba")7export_model_state(voice_state,"alba.safetensors")89# Later, load it quickly (much faster than processing audio)10voice_state = import_model_state("alba.safetensors")11audio = model.generate_audio(voice_state,"Hello world!")
We tried running this TTS model on the GPU but did not observe a speedup compared to CPU execution,
notably because we use a batch size of 1 and a very small model.
Development and local setup
We accept contributions! Feel free to open issues or pull requests on GitHub.
You can find development instructions in the CONTRIBUTING.md file. You'll also find there how to have an editable install of the package for local development.
In-browser implementations
Pocket TTS is small enough to run directly in your browser in WebAssembly/JavaScript.
We don't have official support for this yet, but you can try out one of these community implementations:
pocket-tts-unity by @lookbe - A Unity 6 integration for Pocket-TTS.
Prohibited use
Use of our model must comply with all applicable laws and regulations and must not result in, involve, or facilitate any illegal, harmful, deceptive, fraudulent, or unauthorized activity. Prohibited uses include, without limitation, voice impersonation or cloning without explicit and lawful consent; misinformation, disinformation, or deception (including fake news, fraudulent calls, or presenting generated content as genuine recordings of real people or events); and the generation of unlawful, harmful, libelous, abusive, harassing, discriminatory, hateful, or privacy-invasive content. We disclaim all liability for any non-compliant use.
Authors
Manu Orsini*, Simon Rouard*, Gabriel De Marmiesse*, Václav Volhejn, Neil Zeghidour, Alexandre Défossez