nano-edge-tts-standalone
Text to speech in 3.27M parameters, distilled from Kokoro-82M without running any of its networks or installing any of its software. It builds on nano-edge-tts v1, which replaced Kokoro's decoder and kept Kokoro's 28.5M-parameter text side; here the text side is replaced too.
From Kokoro it keeps only data: the phoneme vocabulary, the 28 English voice vectors, and the text front end. Everything learned is new:
- a text side (1.52M) that turns phonemes, their words' part-of-speech tags and the voice into features, durations, pitch and energy;
- a mapper (0.96M, 80 frames/s) and a renderer (0.79M, 160 frames/s) that set per-frequency gains on a pulse train and on white noise. Two inverse STFTs make the audio, and no network runs at audio rate.
Paper: Distilling Kokoro-82M into a 3.3M-Parameter Text-to-Speech Model.
To rebuild it: every checkpoint of the training chain with its arguments and logs (chain/),
the exact code, and one script from public books to these weights (code/).
| Kokoro-82M | v2.0 | v2.1 (this) | |
|---|---|---|---|
| learned parameters | 81.8M | 3.27M | 3.27M |
| weights on disk | 327 MB | 13 MB | 13 MB |
| Kokoro software to install | misaki, spaCy, espeak-ng | misaki, spaCy, espeak-ng | none |
| real-time factor, one CPU thread¹: PyTorch | 0.1415 | 0.0048 (29× faster) | 0.0050 (28× faster) |
| real-time factor, one CPU thread¹: ONNX Runtime | 0.0045 (31× faster) | ||
| peak memory with the front end¹: PyTorch | 1.78 GB | 0.60 GB | 0.71 GB |
| peak memory with the front end¹: ONNX Runtime | 0.60 GB | ||
| Whisper small.en word errors, 60 unseen sentences² | 36 | 39 | 35 |
| hard target words said, two recognisers, 27 voices³ | 81.8 % | 59.3 % | 78.7 % |
| Open TTS Leaderboard English sets, word error / UTMOS⁴ | 0.66 % / 4.51 | 0.77 % / 4.441 | 0.71 % / 4.467 |
¹ Phonemes to audio for the six sample sentences (about 45 s of audio), best of three, on an Apple-silicon laptop CPU
(code/eval/release_bench.py).
² Test sentences from three books used in no training set.
³ 4,806 targets: 34 words with rare or easily confused sounds (/ɔɪ/ as in "boy", pairs such as "voices"/"vices", consonant
clusters, possessives), alone, mid-sentence and sentence-final, and 20 short questions; a target counts as said only if
faster-whisper small.en and wav2vec2-large-960h both find it.
⁴ Every row of the four English sets, scored with the leaderboard's own pipeline. Ours run locally on one CPU thread; Kokoro's
as published on the leaderboard (version 1.7.0, other hardware).
Raw numbers in results/.
Versions
| version | what changed | where |
|---|---|---|
| 2.1 (this one) | The text side fine-tuned (FT4_map) so that it no longer loses words such as "boy" and "noise"; preferred over 2.0 in all 20 blind trials on such words (16 + 4 hidden repeats). The front end packaged, with the same leaderboard word error as Kokoro's own. Batched synthesis, a transformers wrapper, ONNX graphs. Updated 2026-11-24 with a decoder fine-tuned on this text side's features (G3_ft4_hb_sharp): leaderboard UTMOS 4.451 → 4.467, word error 0.72 → 0.71 %; heard as the same as the first 2.1 weights in all 24 blind trials. |
main; first 2.1 weights: tag v2.1-g2 |
| 2.0 | First release: text side T6_small. The version the Open TTS Leaderboard measures. |
tag v2.0 |
Version 2.0 and the first 2.1 weights use the decoder G2_t6_hb_sharp. Earlier files load with revision='v2.0' or revision='v2.1-g2'.
How it sounds
The same sentence through Kokoro-82M and this model:
| voice | Kokoro-82M | nano-edge-tts-standalone |
|---|---|---|
| af_heart | ||
| af_bella | ||
| am_michael | ||
| am_fenrir | ||
| bf_emma | ||
| bm_george |
Quick start
pip install torch safetensors huggingface_hub numpy soundfile
hf download drmhse/nano-edge-tts-standalone --local-dir nano-tts \
--include "nano_*.py" --include config.json --include nano-tts.safetensors --include "frontend/*"
cd nano-tts
python nano_tts.py "Hello from a very small model." --voice af_heart --out hello.wav
import soundfile as sf
from nano_tts import load
tts = load() # CPU; load(device='mps') or 'cuda' also work
audio = tts('Hello from a very small model.', voice='bm_george') # 24 kHz float32
sf.write('hello.wav', audio, 24000)
clips = tts.batch(['First sentence.', 'A second, longer one.'], voices='af_heart') # many texts at once
Voices are Kokoro's: af_*, am_* (American), bf_*, bm_* (British); only the one you ask for is downloaded. If
nano_frontend.py and frontend/ are not next to nano_tts.py, they are downloaded from this repository on first use.
transformers:
from transformers import AutoModel
model = AutoModel.from_pretrained('drmhse/nano-edge-tts-standalone', trust_remote_code=True)
audio = model.generate('Hello from a very small model.', voice='af_heart') # float32 tensor, 24 kHz
ONNX Runtime (no PyTorch):
pip install onnxruntime safetensors numpy
hf download drmhse/nano-edge-tts-standalone --local-dir nano-tts-onnx --include onnx_tts.py --include nano_frontend.py \
--include config.json --include voices.safetensors --include "frontend/*" --include "onnx/text_*" --include "onnx/decoder*"
cd nano-tts-onnx && python onnx_tts.py "Hello from a very small model." --voice af_heart --out hello.wav
The graphs draw no random numbers: onnx_tts.py passes the noise and shows the whole call sequence. Their output is within
0.003 of PyTorch's on the same input.
Files
| path | contents |
|---|---|
nano_tts.py |
The whole model in one file: text side, mapper, renderer with its post-filter, batching, loader, command line |
nano_frontend.py, frontend/ |
Kokoro's text front end without its dependencies: spaCy's tokenizer and tagger as exported data, misaki's rules and lexicons, number reading; for words no lexicon covers, espeak-ng's pronunciations precomputed for 915,000 words, else the g2p_en network |
nano-tts.safetensors, config.json |
The weights (text side FT4_map, decoder G3_ft4_hb_sharp) and their sizes, phoneme vocabulary and tag set |
configuration_nano_tts.py, modeling_nano_tts.py |
The transformers wrapper: same files, same output |
onnx_tts.py, voices.safetensors, onnx/ |
The ONNX runner, Kokoro's 28 English voices as one file, and the graphs: text_encoder, text_frames and decoder for the model, tagger and g2p_* for the front end's two small networks |
samples/ |
The clips above |
paper/ |
The paper (PDF, Typst source, figures) |
results/ |
End-to-end reports, voice and accent measures, listening results; results/v2.1/: the hard-word test, the leaderboard runs, the listening pages, the front end's checks against Kokoro's |
chain/ |
Every checkpoint of the training chain and the ablations, each with log.jsonl (its arguments first) and train.log |
code/ |
The training code as it ran, reproduce_v2.sh, the lab notebooks (code/notes/) |
The training chain
| stage | starts from | what it adds | steps |
|---|---|---|---|
T6_small |
nothing | the text side: distils Kokoro's text side on 91,812 sentences | 20,000 |
R0_mapper |
nothing | the mapper alone, matched to Kokoro's decoder features | 18,000 |
v2_paired |
R0 | mapper + renderer on spectral losses (expected power over four noise draws) | 15,000 |
v2_critic |
v2_paired | mapper frozen and cached; a critic on frozen WavLM layers | 30,000 |
F1 → F4 |
the one before | texture and periodicity losses, critic carried over | 35,000 |
F4_sharp |
F4 | the inference post-filter on the noise gains (no training) | — |
G2_t6_hb |
F4 | the small text side's features as input, a 4–12 kHz critic | 10,000 |
G2_t6_hb_sharp |
G2_t6_hb | the post-filter (no training): the v2.0 decoder | — |
FT4_map |
T6_small | 30,000 more sentences (short lines, questions, rare sounds), and a loss measured through the decoder's frozen mapper: the v2.1 text side | 4,000 |
G3_ft4_hb |
G2_t6_hb | the same recipe on FT4_map's features |
10,000 |
G3_ft4_hb_sharp |
G3_ft4_hb | the post-filter (no training): the released decoder | — |
G1_t6 (G2 without the 4–12 kHz critic) and the text-side ablations T1–T10 are in chain/G1_t6 and chain/ablations.
Every checkpoint loads with torch.load(path, weights_only=True) and holds the optimiser and critic states, so any stage can be
resumed or rerun from the one before and compared.
To rebuild everything (about 21 h on one Apple-silicon GPU, ~45 GB of disk):
hf download drmhse/nano-edge-tts-standalone --local-dir nts --include "code/*"
cd nts/code && pip install -r requirements.txt
zsh reproduce_v2.sh # ABLATIONS=1 zsh reproduce_v2.sh adds G1 and the text-side ablations
It downloads Kokoro-82M and 43 public-domain books from Project Gutenberg, rebuilds the data, runs every stage with its
recorded arguments, exports the weights with an output check against the training code, and measures them. Version 2.0's data
steps were checked against the originals: sentences, voices and training windows bit-identical, Kokoro's features equal to
float16 precision. GPU training is not bit-deterministic, so a rerun reproduces the recipe rather than the exact weights.
release_v2/build_espeak_lexicon.py rebuilds the front end's precomputed pronunciations (it needs espeak-ng and misaki).
Limitations
- English only: Kokoro's 28 American and British voices. Other languages and new voices are untested.
- Kokoro-82M is the target, so at best this model sounds like Kokoro.
- The post-filter that closed most of the audible gap adds some 4–8 kHz flutter and overshoots 2–4 kHz contrast (see the paper).
- Accent placement is measurably further from Kokoro's than Kokoro is from itself; long or very expressive passages may show it.
- Words outside the front end's lexicons and its precomputed words are guessed by a small network, less reliably than espeak-ng would read them (mostly rare names).
- Listening results come from one listener. Speed was measured on a laptop CPU, not on a phone.
Licence and credit
Apache-2.0, the same as Kokoro-82M. Kokoro-82M, its voices and the misaki front end are by
hexgrad (Apache-2.0); this model was distilled from it. The packaged front end
contains data exported from spaCy's en_core_web_sm (MIT), the g2p_en network (Apache-2.0,
frontend/g2p.LICENSE), and pronunciations computed with espeak-ng (GPL-3.0) for a word list drawn from CMUdict (BSD-2),
US first-name and surname lists (public domain), English Wikipedia word frequencies
(IlyaSemenov/wikipedia-word-frequency, MIT) and Project Gutenberg
books; no espeak-ng code is included. WavLM (Microsoft) was used only as a frozen feature extractor during training.
@misc{chumba2026nanottsstandalone,
title = {Kokoro-82M in 3.3M Parameters: A Small Text Side and a Frame-Rate Decoder, Reproducible End to End},
author = {Mike Chumba},
year = {2026},
url = {https://huggingface.co/drmhse/nano-edge-tts-standalone}
}
- Downloads last month
- 127
