Downloads · 30 days
168
50% of all-time downloads
soniqo/Kokoro-82M-LiteRT
Kokoro-82M-LiteRT is a text-to-speech model from soniqo. Use it when you need text read aloud. It is set up for litert. The card lists the license as apache-2.0.
Kokoro-82M exported as a staged FP32 LiteRT bundle for CPU text-to-speech. It produces 24 kHz Float32 audio with the included afheart voice.
Downloads · 30 days
168
50% of all-time downloads
All-time downloads
333
Public
Repo size
620 MB
Likes
0
Public
Click a slice to open those files.
.tflite620 MB · 99%
From the Hugging Face model README
Kokoro-82M exported as a staged
FP32 LiteRT bundle for CPU text-to-speech. It produces 24 kHz Float32 audio
with the included af_heart voice.
The current bundle (v2.0.0) has a 120-frame (3 s) contract and packed token LSTMs, so its durations match upstream Kokoro. The v1.0.0 60-frame files stay in the repository for older releases.
| Property | Value |
|---|---|
| Parameters | 82M |
| Architecture | Non-autoregressive, single pass |
| Format | LiteRT / TFLite |
| Precision | FP32 |
| Model files | 334,176,844 bytes total (319 MiB) |
| Sample rate | 24 kHz |
| Public text input | 128 token slots |
| Active text encoder/recurrent window | 32 token slots |
| Output tensor | 120 frames / 72,000 samples / 3.0 seconds |
| Runtime safety boundary | 116 frames / 69,600 samples / 2.9 seconds |
| Included voice | af_heart |
Every token LSTM runs over its valid prefix, as upstream Kokoro's packed sequences do: the backward direction starts at the last phoneme, so padding never reaches a valid output. Only the 32 token slots ALBERT fills are evaluated, and each input projection runs once per sequence outside compact LiteRT loops.
Longer text is supported by host-side chunking, up to 32 tokens per invocation at speed 1.0. The model-reported duration is checked after the recurrent stage. Output above 116 frames must be discarded and retried as smaller text; the final four tensor frames are reserved as right context.
v1.0.0's recurrent graph walked the zero padding before reaching the last phoneme and predicted durations too short, most for short replies. With corrected durations its 60-frame tensor holds only a word or two per piece.
| File | Bytes | SHA-256 |
|---|---|---|
kokoro-encoder.tflite | 47,877,656 | 60ac2065c78cc5ec724b3a43beb6789c084a03121018f664c561c131ce65ecaa |
kokoro-recurrent-packed32-120.tflite | 45,057,700 | 01eabd16c2b9b16376442bbc2ff9ff709e47948833cbc5060e45f55a1a32b514 |
kokoro-vocoder-120.tflite | 241,241,488 | 55adae7d19fd95ca998476e03157bb88bd38f805063ce780de0984eceb98e8af |
config.json | <2 KB | Runtime geometry and artifact hashes |
vocab_index.json | 1,822 | IPA symbol-to-token mapping |
us_gold.json | 3,000,469 | Primary English pronunciation dictionary |
us_silver.json | 3,099,517 | Fallback English pronunciation dictionary |
voices/af_heart.bin | 1,024 | Default 256-value Float32 voice embedding |
v1.0.0 files, used with the same encoder:
| File | Bytes | SHA-256 |
|---|---|---|
kokoro-recurrent-equivalent32.tflite | 45,004,644 | 560b6318be2ac91dbeba928a634097fc6f1c30229b016f9dedacc0a6a64d2865 |
kokoro-vocoder.tflite | 240,647,344 | d8cc32713beeab8fadfb4190d5a7ada4d832ae2ecd16b82570c891f02d0e6ff6 |
The chained bundle was compared with FP32 PyTorch using packed sequences, on identical token, voice, speed, and harmonic-phase inputs.
| Check | Result |
|---|---|
| Waveform correlation | 0.99924 |
| Magnitude-spectrogram correlation | 0.99982 |
| Duration maximum absolute error | 0 |
| Duration mismatch count | 0 |
| Recurrent equivalence matrix | 0 mismatches across 42 length/speed cases |
Through the speech-core wrapper, a physical Galaxy S23 Ultra and an arm64
emulator produce bit-identical audio.
Samsung Galaxy S23 Ultra (SM-S918B, Snapdragon 8 Gen 2), Android 16,
LiteRT 2.1.5, XNNPACK, eight threads (taskset ff), both bundles on the same
day. Timing uses one warm-up and ten measured runs per bundle, each batch
started from thermal status 0, for the reply "Sure, I can help with that. The meeting has been
moved to Friday afternoon at two o'clock, and I will remind you an hour before
it starts." Quality is Parakeet TDT v3 over 21 assistant replies synthesized
on the phone.
| Bundle | 24-word reply | Pieces | Peak RSS | Replies transcribed exactly | Word errors |
|---|---|---|---|---|---|
| v2.0.0, 120 frames | 6.7 s | 5 | 1,062 MiB | 19 of 21 | 1.9% |
| v1.0.0, 60 frames | 9.4 s | 14 | 1,003 MiB | 15 of 21 | 6.2% |
#include <speech_core/models/litert_kokoro_tts.h>
speech_core::LiteRTKokoroTts tts(
"kokoro-encoder.tflite",
"kokoro-recurrent-packed32-120.tflite",
"kokoro-vocoder-120.tflite",
"voices",
".",
/*hw_accel=*/false,
/*num_threads=*/8);
tts.set_speed(1.0f);
tts.set_seed(1234);
tts.synthesize("Hello world.", "en",
[](const float* pcm, size_t samples, bool is_final) {
// 24 kHz mono Float32 PCM
});
The wrapper reads the frame contract from the graphs and includes the English phonemizer, proactive token chunking, the duration guard, retry splitting, waveform checks, and final audio assembly. Older speech-core releases load only the v1.0.0 files.
Build and run the physical benchmark:
cmake --build speech-core/build --target speech_kokoro_litert_bench
speech_kokoro_litert_bench /path/to/this/bundle \
--variant packed32-120 --threads 8 --warmup 1 --runs 10
Converted from hexgrad/Kokoro-82M. The bundle uses explicit harmonic phases, compact FP32 recurrent loops, and a LiteRT-compatible iSTFT path.