Views
No views yet
english_2026-04, french_24l, german, german_24l, italian, italian_24l, portuguese, portuguese_24l, spanish, and spanish_24lflow_lm_main - Transformer/conditioner (produces conditioning vectors)
flow_lm_flow - Flow network only (Euler integration for latent sampling)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.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.1from pocket_tts_onnx import PocketTTSOnnx
2
3# Load the English bundle (INT8 by default)
4tts = PocketTTSOnnx(
5 models_dir="onnx",
6 language="english_2026-04",
7)
8
9# Generate speech with built-in voice state
10audio = tts.generate(
11 text="Hello, this is a test.",
12 voice="alba",
13)
14
15# Generate speech with voice cloning from audio
16audio = tts.generate(
17 text="Hello, this is a test of voice cloning.",
18 voice="reference_sample.wav"
19)
20
21# Save output
22tts.save_audio(audio, "output.wav")temperature parameter:1# More deterministic (lower temperature)
2tts = PocketTTSOnnx(temperature=0.3)
3
4# Default balance
5tts = PocketTTSOnnx(temperature=0.7)
6
7# More diverse/expressive (higher temperature)
8tts = PocketTTSOnnx(temperature=1.0)lsd_steps:1# Default
2tts = PocketTTSOnnx(lsd_steps=1)
3
4# Slower, potentially smoother
5tts = PocketTTSOnnx(lsd_steps=4)1for chunk in tts.stream("Hello world!", voice="reference_sample.wav"):
2 play_audio(chunk) # Process each chunk as it arrives1# German bundle with built-in voice
2tts = PocketTTSOnnx(language="german", precision="fp32")
3audio = tts.generate("Hallo zusammen. Dies ist ein deutscher Test.", voice="alba").safetensors prompt-state fileonnx/ and the root tokenizer.model are still present for backward compatibility with older integrations that expect the original single-model layout.onnx/<language>/.1python generate.py "Hello, this is a test." alba output.wav --language english_2026-04
2python generate.py "Hallo zusammen." samples/reference.wav output.wav --language german --precision fp32pocket-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.mdonnxruntime>=1.16.0
numpy
soundfile
sentencepiece
scipy # Only needed if resampling from non-24kHz audio
huggingface_hub
safetensorspip install -r requirements.txtkyutai/pocket-tts via Hugging Face.mimi_encoder.onnx.