The mattmireles/kokoro-coreml staged export of hexgrad/Kokoro-82M, with its weights compressed from float16 to 8-bit. Same stages, same bucket layout, same inputs and outputs — only smaller.
| float16 | this repo | |
|---|---|---|
| distinct weight bytes | 205 MB | 110 MB |
| compiled on device | 578 MB | 326 MB |
Post-training weight quantization with coremltools.optimize.coreml.linear_quantize_weights
(coremltools 9.0, mode="linear_symmetric", dtype=int8, granularity="per_channel") applied to
the published float16 .mlpackage files. No re-export from PyTorch, so the graphs are byte-for-byte
the upstream ones apart from the weight encoding. Core ML expands the weights back to float16 when
the model loads, so nothing about how you call these models changes.
Three groups of weights are deliberately left in float, selected by operation type and shape so that every bucket variant is treated identically:
conv_transpose upsamplers — no published 8-bit Kokoro quantizes these,
because onnxruntime structurally cannot, so there is no evidence either way and they are cheap
to keep;conv_post, shape 22×128×7) — the one layer independent
reports agree adds audible static when quantized, and it is about 20 KB;Bucket variants of a stage still share byte-identical weight files after quantization, so a consumer that de-duplicates identical weights keeps that saving.
Judged against the float16 export it was built from, not against PyTorch:
The renders are not sample-identical to float16 and are not meant to be. Timing moves by tens of milliseconds on some phonemes.
The stages take phonemes, not text: bring your own G2P (misaki, or MisakiSwift on Apple
platforms). runtime/kokoro-vocab.json maps phoneme characters to token ids and
runtime/hnsf_weights.json carries the harmonic-source weights. The pipeline that drives these
stages is mattmireles/kokoro-coreml's
KokoroPipeline; the stage split, the buckets and the tensor contract are all upstream's.
manifest.json lists every file with its SHA-256 and byte count, for pinning.
Apache-2.0, inherited. In order: hexgrad trained and released Kokoro-82M; yl4579 authored the StyleTTS 2 architecture it builds on; mattmireles did the Core ML conversion and the staged export this repo compresses; the voice files are hexgrad's, repacked by onnx-community. This repo adds the quantization and nothing else. Not affiliated with or endorsed by any of them, or by Apple.
Kokoro-82M was trained on permissive and non-copyrighted audio. Its card records these Creative Commons Attribution sources, reproduced here as its licence asks:
coreml/kokoro_decoder_pre_10s.mlpackage/Data/com.apple.CoreML/weights/weight.bin 32 MiBcoreml/kokoro_decoder_pre_15s.mlpackage/Data/com.apple.CoreML/weights/weight.bin 32 MiBcoreml/kokoro_decoder_pre_3s.mlpackage/Data/com.apple.CoreML/weights/weight.bin 32 MiBcoreml/kokoro_decoder_pre_7s.mlpackage/Data/com.apple.CoreML/weights/weight.bin 32 MiBcoreml/kokoro_decoder_har_post_10s.mlpackage/Data/com.apple.CoreML/weights/weight.bin 22 MiBcoreml/kokoro_decoder_har_post_15s.mlpackage/Data/com.apple.CoreML/weights/weight.bin 22 MiBcoreml/kokoro_decoder_har_post_3s.mlpackage/Data/com.apple.CoreML/weights/weight.bin 22 MiBcoreml/kokoro_decoder_har_post_7s.mlpackage/Data/com.apple.CoreML/weights/weight.bin 22 MiBcoreml/kokoro_duration_t256.mlpackage/Data/com.apple.CoreML/weights/weight.bin 19 MiBcoreml/kokoro_duration_t128.mlpackage/Data/com.apple.CoreML/weights/weight.bin 19 MiBcoreml/kokoro_f0ntrain_t120.mlpackage/Data/com.apple.CoreML/weights/weight.bin 13 MiBcoreml/kokoro_f0ntrain_t280.mlpackage/Data/com.apple.CoreML/weights/weight.bin 13 MiBcoreml/kokoro_f0ntrain_t400.mlpackage/Data/com.apple.CoreML/weights/weight.bin 13 MiBcoreml/kokoro_f0ntrain_t600.mlpackage/Data/com.apple.CoreML/weights/weight.bin 13 MiBvoices/af_alloy.bin 510 KiBvoices/af_aoede.bin 510 KiBvoices/af_bella.bin 510 KiBvoices/af_heart.bin 510 KiBvoices/af_jessica.bin 510 KiBvoices/af_kore.bin 510 KiBvoices/af_nicole.bin 510 KiBvoices/af_nova.bin 510 KiBvoices/af_river.bin 510 KiBvoices/af_sarah.bin 510 KiBvoices/af_sky.bin 510 KiBvoices/am_adam.bin 510 KiBvoices/am_echo.bin 510 KiBvoices/am_eric.bin 510 KiBvoices/am_fenrir.bin 510 KiBvoices/am_liam.bin 510 KiBvoices/am_michael.bin 510 KiBvoices/am_onyx.bin 510 KiBvoices/am_puck.bin 510 KiBvoices/am_santa.bin 510 KiBvoices/bf_alice.bin 510 KiBvoices/bf_emma.bin 510 KiBvoices/bf_isabella.bin 510 KiBvoices/bf_lily.bin 510 KiBvoices/bm_daniel.bin 510 KiBvoices/bm_fable.bin 510 KiBvoices/bm_george.bin 510 KiBvoices/bm_lewis.bin 510 KiBhexgrad/Kokoro-82M