This repo exports gated Kyutai Pocket TTS checkpoints to ONNX and writes bundle outputs directly into the sibling pocket-tts-onnx runtime repo.
Published exported weights and inference code:
It currently targets:
english_2026-04french_24lgermangerman_24litalianitalian_24lportugueseportuguese_24lspanishspanish_24l
For each language bundle, the exporter writes:
bundle.jsontokenizer.modelbos_before_voice.npyflow_lm_main.onnxflow_lm_flow.onnxmimi_decoder.onnxmimi_encoder.onnxtext_conditioner.onnx
If quantization is enabled, it also writes:
flow_lm_main_int8.onnxflow_lm_flow_int8.onnxmimi_decoder_int8.onnxmimi_encoder_int8.onnxtext_conditioner_int8.onnx
Output goes to:
pocket-tts-onnx/onnx/<language>/
- Install dependencies:
sfw pip install -r requirements.txt- Export one bundle:
python export.py --language english_2026-04- Export one bundle and quantize in place:
python export.py --language english_2026-04 --quantize- Export from a local config file instead of a named language:
python export.py --config /path/to/model.yaml- Run strict verification during export:
python export.py --language english_2026-04 --exactexport.py is the entry point. It runs:
scripts/export_mimi_and_conditioner.pyscripts/export_flow_lm.pyscripts/quantize.pyif--quantizeis enabled
The exporter also writes bundle metadata used by the pocket-tts-onnx runtime:
- tokenizer filename
- state manifests for FlowLM and Mimi
- sample/frame metadata
- BOS-before-voice tensor path
- preprocessing flags such as
remove_semicolons
FlowLM is exported as two graphs:
flow_lm_main: transformer backbone plus state updatesflow_lm_flow: stateless flow-matching step
This keeps the LSD loop in the runtime and allows dynamic step counts and temperature control.
Pocket TTS uses stateful streaming modules internally. During export, those modules are patched so their caches and counters become explicit ONNX inputs and outputs.
The bundle format preserves the v2 voice-cloning path:
mimi_encoder.onnxencodes reference audiobos_before_voice.npyis exported for models that prepend a learned BOS-before-voice embedding- bundle metadata records the state layout needed by the runtime
Quantization uses onnxruntime.quantization.quantize_dynamic and targets MatMul operators. This is the safe CPU-oriented path used by this repo.
pocket-tts-onnx-export/
├── export.py
├── onnx_export/
│ ├── bundle_metadata.py
│ ├── export_utils.py
│ └── wrappers.py
├── pocket_tts/
├── scripts/
│ ├── export_flow_lm.py
│ ├── export_mimi_and_conditioner.py
│ └── quantize.py
├── pocket-tts-onnx/
│ └── onnx/
└── requirements.txt
Install from:
sfw pip install -r requirements.txtMain packages:
torchonnxonnxruntimehuggingface_hubsafetensorssentencepiecescipy
This exporter is wired for the gated voice-cloning repo:
kyutai/pocket-tts
It does not target the older no-voice-cloning release.
This repo includes modified code derived from kyutai-labs/pocket-tts.
- Original Pocket TTS code: MIT
- Export/runtime bundle artifacts: subject to the upstream model and dataset terms from Kyutai / Hugging Face