--- license: apache-2.0 pipeline_tag: text-to-speech library_name: onnxruntime language: - de - en - es - fr - hi - it - ja - pl - pt - zh base_model: - hexgrad/Kokoro-82M - hexgrad/Kokoro-82M-v1.1-zh tags: - kokoro - onnx - on-device - multilingual - kotlin-multiplatform - android - jvm - web --- # Complete Kokoro catalog for ONNX Runtime and Kotlin Multiplatform All 157 voices published in the pinned official Kokoro v1.0 and v1.1-zh repositories, plus the native Polish and German voices, converted for on-device ONNX Runtime use. Version 2.1.1 contains **159 voices**, **10 languages / 11 locale profiles**, and **4 compatible FP32 models**. The catalog is designed for a language picker followed by a voice picker. A client downloads only the model required by the selected voice, one 510 KiB voice file, its tokenizer, and—where available—the selected language's text frontend. It never needs to download the entire repository. ## Available language profiles | Profile | Voices | Models used | Text frontend | |---|---:|---|---| | English, United States (`en-US`) | 22 | v1.0 + v1.1-zh | Phonemis bundled | | English, United Kingdom (`en-GB`) | 9 | v1.0 + v1.1-zh | Phonemis bundled | | Spanish (`es-ES`) | 3 | v1.0 | Phonemis bundled | | French (`fr-FR`) | 1 | v1.0 | Phonemis bundled | | Hindi (`hi-IN`) | 4 | v1.0 | Phonemis bundled | | Italian (`it-IT`) | 2 | v1.0 | Phonemis bundled | | Japanese (`ja-JP`) | 5 | v1.0 | external adapter required | | Portuguese (`pt-BR`) | 3 | v1.0 | Phonemis bundled | | Mandarin Chinese (`zh-CN`) | 108 | v1.0 + v1.1-zh | external adapter required | | Polish (`pl-PL`) | 1 | native Polish fine-tune | Phonemis bundled | | German (`de-DE`) | 1 | native German fine-tune | Phonemis bundled | The complete, machine-readable voice list is in [`catalog.json`](catalog.json). The 108 Mandarin voices comprise all 8 v1.0 Mandarin voices and all 100 v1.1-zh Mandarin voices. The three English voices introduced with v1.1-zh are included as well and correctly point to that model variant. ## Download-on-demand client flow 1. Fetch [`catalog.json`](catalog.json) from the immutable `v2.1.1` revision. 2. Show `languages`, then the selected language's `voices`. 3. Read the selected voice's `modelId` and resolve it in top-level `models`. 4. Resolve that model's `tokenizerId` in top-level `tokenizers`. 5. Download the model artifact, tokenizer artifact, selected voice artifact, and—if `textFrontend.status` is `bundled`—the frontend artifacts. 6. Verify each file's `sizeBytes` and `sha256` before activating it. 7. Cache by artifact path or SHA-256 so shared models are not downloaded again. Resolve every artifact path relative to the catalog URL. Pinning the catalog to `v2.1.1` therefore pins every dependent file to the same immutable release. The schema is versioned at [`schema/kokoro-catalog.schema.json`](schema/kokoro-catalog.schema.json). A typical installation is about 311 MiB for a model, 510 KiB for a voice, a tiny tokenizer JSON, and up to roughly 15 MiB for a bundled text frontend. The four models total about 1.21 GiB only if a user deliberately chooses voices that require every variant. ## Inference contract Each ONNX graph takes: - `input_ids`: `int64[1, sequence_length]`, with token `0` at both ends; - `style`: `float32[1, 256]`; - `speed`: `float32[1]`. It returns a mono `float32` waveform at 24 kHz and one `int64` duration per input token. Batch size is fixed at one. The phoneme sequence is dynamic from 1 through 510 Unicode code points, excluding the two boundary tokens. Voice files are raw little-endian `float32[510, 256]` matrices. Select row `phonemeCodePointCount - 1`. On Kotlin/JVM, count Unicode code points rather than UTF-16 code units; combining marks such as the nasalization mark in `ɔ̃` are separate code points. ## Text frontends Phonemis assets are bundled for `en-us`, `en-gb`, `de`, `fr`, `es`, `it`, `pl`, `pt`, and `hi`. Version 2.1.1 publishes each neural frontend as a ready-to-open ONNX graph, so clients no longer need to convert the upstream weight container at runtime. They produce Kokoro-compatible IPA without shipping eSpeak or a GPL component. English packs also include the full lexicon and part-of-speech tagger required for best results. Japanese and Mandarin model/voice packs are fully included and accept phoneme input. Their official Python path uses `misaki[ja]` and `misaki[zh]`, but this repository does not pretend those Python frontends are portable KMP libraries. Their catalog status is therefore `external-required`. A future KMP adapter can be added without changing model or voice IDs. No eSpeak executable, GPL component, Misaki package, Open JTalk dictionary, or UniDic dictionary is distributed here. ## Validation Version 2.1.1 preserves the complete 2.0.0 validation baseline and additionally validates all nine prebuilt Phonemis graphs with ONNX Runtime 1.29 CPU inference. Validation covers: - JSON Schema and SHA-256 verification for all 183 catalog artifacts; - ONNX structural validation and Apache-2.0/source metadata checks for all 4 models; - ONNX Runtime 1.29 CPU inference for every one of the 159 voices; - 13 natural-language cases covering every profile and both Chinese model generations; - 1-, 128-, and 510-phoneme boundary cases for each model; - ONNX Runtime Web 1.29 WebAssembly inference for each model, including the 510-phoneme boundary. - deterministic prebuilding, size/SHA-256 verification, and a real inference smoke for every bundled Phonemis ONNX frontend. Results are recorded in [`validation/package-validation.json`](validation/package-validation.json) and the `validation/web-*.json` files. Actual frontend outputs are recorded in [`validation/frontend-validation.json`](validation/frontend-validation.json). Default-voice WAV previews are available under `samples/`. Kokoro deliberately injects a small amount of excitation noise, so export validation checks exact durations plus high PyTorch/ONNX waveform correlation rather than bit-identical samples. To rebuild the local catalog and repeat validation: ```bash python scripts/sync_upstream_assets.py python scripts/export_all_onnx.py python scripts/build_catalog.py python scripts/validate_package.py npm install npm run validate:web ``` The synchronizer uses anonymous requests, exact source revisions, source LFS SHA-256 hashes, and fixed voice-count assertions. Source and converted hashes are recorded in [`sources/upstream-assets.json`](sources/upstream-assets.json) and [`SOURCES.lock.json`](SOURCES.lock.json). Maintainers can publish a fully validated folder after authenticating with the Hugging Face CLI: ```bash python scripts/publish_hf.py /kokoro-kmp-models --tag v2.1.1 ``` ## Scope and compatibility “All voices” means all voices present in the two pinned official upstream releases plus the pinned Polish/German mobile fine-tunes. Future upstream additions require a new immutable catalog release. Voice files are not freely interchangeable between model variants; always honor `voice.modelId`. Text normalization and pronunciation should still be tested at application level for names, abbreviations, mixed-language text, numbers, and unusual punctuation. The models are deliberately unquantized to prioritize quality over download size. ## License Kokoro, its configurations, the Polish/German fine-tunes, converted ONNX graphs, speaker embeddings, and this packaging remain under **Apache License 2.0**. The repository license has not been changed. Phonemis assets remain under their upstream **MIT License**. See [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md) for exact provenance and license boundaries.