Downloads · 30 days
0
KevinAHM/pocket-tts-onnx
pocket-tts-onnx is a text-to-speech model from KevinAHM. Use it when you need text read aloud. It is set up for pocket-tts-onnx. The card lists the license as cc-by-4.0.
ONNX export of Pocket TTS for lightweight multilingual text-to-speech with zero-shot voice cloning.
Downloads · 30 days
0
Access
Public
Updated Apr 21, 2026
Repo size
12.2 GB
Likes
37
Public
Click a slice to open those files.
.onnx12.1 GB · 100%
From the Hugging Face model README
ONNX export of Pocket TTS for lightweight multilingual text-to-speech with zero-shot voice cloning.
Pocket TTS is a compact text-to-speech model from Kyutai that supports voice cloning from short audio samples. This ONNX export provides:
english_2026-04, french_24l, german, german_24l, italian, italian_24l, portuguese, portuguese_24l, spanish, and spanish_24lThis export uses a dual model split for the Flow LM:
flow_lm_main - Transformer/conditioner (produces conditioning vectors)
flow_lm_flow - Flow network only (Euler integration for latent sampling)
This architecture enables:
Performance depends on the selected language bundle, precision, CPU, and lsd_steps.
english_2026-04, german, italian, portuguese, and spanish are much smaller and faster than the *_24l bundles.flow_lm_main, flow_lm_flow, and mimi_decoder size for CPU inference.mimi_encoder.onnx and text_conditioner.onnx remain FP32.Thread count is automatically tuned to avoid over-subscription on the small sequential matmuls in the autoregressive loop (intra_op_num_threads=min(cpu_count, 4), inter_op_num_threads=1). This alone provides a ~2x speedup over default ORT settings on multi-core machines.
generate): Uses threaded parallel decoding — the mimi decoder runs in a background thread, decoding 12-frame chunks while the flow loop generates the next frames. This overlaps generation and decoding for maximum throughput.stream): Uses adaptive chunking (starts at 2 frames). This ensures instant start (low TTFB) while scaling up chunk sizes for throughput.from pocket_tts_onnx import PocketTTSOnnx
# Load the English bundle (INT8 by default)
tts = PocketTTSOnnx(
models_dir="onnx",
language="english_2026-04",
)
# Generate speech with built-in voice state
audio = tts.generate(
text="Hello, this is a test.",
voice="alba",
)
# Generate speech with voice cloning from audio
audio = tts.generate(
text="Hello, this is a test of voice cloning.",
voice="reference_sample.wav"
)
# Save output
tts.save_audio(audio, "output.wav")
Adjust generation diversity with the temperature parameter:
# More deterministic (lower temperature)
tts = PocketTTSOnnx(temperature=0.3)
# Default balance
tts = PocketTTSOnnx(temperature=0.7)
# More diverse/expressive (higher temperature)
tts = PocketTTSOnnx(temperature=1.0)
Trade off speed vs quality with lsd_steps:
# Default
tts = PocketTTSOnnx(lsd_steps=1)
# Slower, potentially smoother
tts = PocketTTSOnnx(lsd_steps=4)
For real-time applications with low time-to-first-audio:
for chunk in tts.stream("Hello world!", voice="reference_sample.wav"):
play_audio(chunk) # Process each chunk as it arrives
# German bundle with built-in voice
tts = PocketTTSOnnx(language="german", precision="fp32")
audio = tts.generate("Hallo zusammen. Dies ist ein deutscher Test.", voice="alba")
Built-in voice names are loaded from each bundle's metadata. Voice cloning also accepts:
.safetensors prompt-state fileRoot-level files under onnx/ and the root tokenizer.model are still present for backward compatibility with older integrations that expect the original single-model layout.
New integrations should use the per-language bundle directories under onnx/<language>/.
python generate.py "Hello, this is a test." alba output.wav --language english_2026-04
python generate.py "Hallo zusammen." samples/reference.wav output.wav --language german --precision fp32
pocket-tts-onnx/
├── onnx/
│ ├── flow_lm_main.onnx # Legacy root-level file kept for backward compatibility
│ ├── flow_lm_main_int8.onnx # Legacy root-level file kept for backward compatibility
│ ├── flow_lm_flow.onnx # Legacy root-level file kept for backward compatibility
│ ├── flow_lm_flow_int8.onnx # Legacy root-level file kept for backward compatibility
│ ├── mimi_decoder.onnx # Legacy root-level file kept for backward compatibility
│ ├── mimi_decoder_int8.onnx # Legacy root-level file kept for backward compatibility
│ ├── mimi_encoder.onnx # Legacy root-level file kept for backward compatibility
│ ├── text_conditioner.onnx # Legacy root-level file kept for backward compatibility
│ ├── english_2026-04/
│ │ ├── bundle.json
│ │ ├── tokenizer.model
│ │ ├── bos_before_voice.npy
│ │ ├── flow_lm_main.onnx
│ │ ├── flow_lm_main_int8.onnx
│ │ ├── flow_lm_flow.onnx
│ │ ├── flow_lm_flow_int8.onnx
│ │ ├── mimi_decoder.onnx
│ │ ├── mimi_decoder_int8.onnx
│ │ ├── mimi_encoder.onnx
│ │ └── text_conditioner.onnx
│ ├── german/
│ ├── german_24l/
│ ├── french_24l/
│ ├── italian/
│ ├── italian_24l/
│ ├── portuguese/
│ ├── portuguese_24l/
│ ├── spanish/
│ └── spanish_24l/
├── reference_sample.wav # Example voice reference
├── tokenizer.model # Legacy root tokenizer kept for backward compatibility
├── pocket_tts_onnx.py # Inference wrapper
├── generate.py # CLI script
├── requirements.txt # Python dependencies
└── README.md
onnxruntime>=1.16.0
numpy
soundfile
sentencepiece
scipy # Only needed if resampling from non-24kHz audio
huggingface_hub
safetensors
Install with:
pip install -r requirements.txt
kyutai/pocket-tts via Hugging Face.mimi_encoder.onnx.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.