Kokoro: The 82M-Parameter TTS Model That Sounds Good on a Laptop CPU
"An 82-million-parameter model that runs on a phone shouldn't sound this good. Kokoro is the proof that for speech, small and local beats big and rented."
Text-to-speech has been the quiet embarrassment of the open-AI world: the good ones were closed and priced per character (ElevenLabs et al.), and the free ones sounded like a GPS from 2012. Kokoro broke that dichotomy. Published by hexgrad as Kokoro-82M, it's an Apache-2.0 speech model with just 82 million parameters — small enough to run on a laptop CPU with no GPU — yet it tops open TTS leaderboards and hit #1 on Hacker News.
For a blog about AI you can run yourself, Kokoro is the platonic ideal: tiny, free, permissively licensed, and completely offline. Let's run it, honestly.
1. What Kokoro Is
Kokoro (Japanese for "heart" or "mind") is an open-weight TTS model built on the StyleTTS 2 lineage. The name says the size: 82M parameters. In 2026, when frontier LLMs measure in hundreds of billions, 82M is almost a rounding error — yet for speech synthesis it's plenty.
The repo (hexgrad/kokoro) sits around 7,900 GitHub stars as of mid-July 2026. It's not the most-starred project in this batch, but it's arguably the most "it just works on a potato" one. The defining promise: natural, expressive narration without a GPU and without a bill.
2. The Voice Palette
Out of the box Kokoro ships 54 built-in voices spanning 9 language and accent groups:
- American English
- British English
- Spanish
- French
- Hindi
- Italian
- Japanese
- Brazilian Portuguese
- Mandarin Chinese
Voice style mixing is supported in community runtimes — e.g., blending af_sky and af_nicole with weights to get a hybrid timbre. That's a level of control usually locked behind enterprise TTS consoles.
3. Running It on a Plain CPU
The headline feature is CPU-only operation. One hands-on test ran it on an Apple M3 Pro with 18 GB RAM, no GPU, no cloud — and it generated real, playable samples.
The easiest CPU path is the community ONNX runtime, thewh1teagle/kokoro-onnx (MIT, ~2,600 stars). Install is seconds:
pip install kokoro-onnx soundfile
But — and this is the first trap — the pip package ships code, not weights. You must download two files manually from the kokoro-onnx releases page:
kokoro-v1.0.onnx(~310 MB)voices-v1.0.bin(~27 MB)
4. Rust Ports and an OpenAI-Compatible API
Kokoro's model format spawned a small ecosystem. Two notable Rust implementations:
- kokorox (
byteowlz/kokorox, GPL-3.0) — "Kokoro in Rust," insanely fast, with an OpenAI-compatible API server, streaming mode, and automatic language detection. Multi-language via espeak-ng. - Kokoros (
HeyWillow/Kokoros) — another Rust port with word-level timestamps (TSV sidecar), parallel instances for the API server, and system-wide install.
audio.speech endpoint, you can point the same code at a local Kokoro server and your app speaks for free, offline. That's a drop-in replacement for a paid TTS bill with zero model-API lock-in.
Sample rate is 24 kHz by default — perfectly fine for narration, audiobooks, and voice UIs, though not studio-music quality.
5. The Setup Traps (So You Don't Lose an Afternoon)
Two gotchas bit real testers; both are fixable:
Trap 1 — weights aren't in the package. Covered above: download kokoro-v1.0.onnx + voices-v1.0.bin by hand.
Trap 2 — the espeak-ng path bug. Kokoro turns text into phonemes with espeak-ng. The first synthesis often throws:
Error processing file '.../espeak-ng-data/phontab': No such file or directory
That /Users/runner/work/... path is a dead giveaway: the pip espeakng-loader wheel bundles a libespeak-ng compiled in CI with a hard-coded data path that doesn't exist on your machine. Setting ESPEAK_DATA_PATH does nothing, because kokoro-onnx never reads it — it takes the path from the bundled loader.
The fix that works: install a real system espeak-ng and point Kokoro at it explicitly via its EspeakConfig:
brew install espeak-ng # macOS
or: sudo apt-get install espeak-ng libespeak-ng-dev # Linux
Then pass the system path through Kokoro's config object. After that, synthesis is clean.
"The model is trivial. espeak-ng is the boss fight." — every Kokoro installer, eventually
6. Quality: Honest Expectations
Kokoro is genuinely good for its size, but set the bar correctly:
- Best voices (US English) sound natural and expressive — easily good enough for explainer videos, podcast drafts, audiobook prototyping, and accessibility TTS.
- Non-English voices are competent but less polished — accents are recognizable, prosody is decent, but they don't match the EN fluency.
- It is not ElevenLabs-level on every voice. Frontier hosted TTS still edges it on the most demanding emotional nuance. But Kokoro closes the gap far more than its parameter count suggests.
- 24 kHz is fine for speech, not for music or sound design.
7. The Honest Limitations
- English leads, others follow. If your product is ZH-only, test the Mandarin voice hard before committing.
- 24 kHz ceiling. Good for voice, not for anything needing audio fidelity beyond speech.
- Setup friction is real. Weights-download + espeak-ng path bug will bite a first-timer. Budget 20–40 minutes the first time.
- Single-speaker-at-a-time model. It's a TTS engine, not a dialog director; managing multiple characters is on you (voice mixing helps).
- Smaller community than the giants. ~7.9k stars means fewer tutorials than ElevenLabs-grade tooling, though the ONNX/Rust ports fill a lot of gaps.
- Not a model you train. Kokoro ships weights; fine-tuning is a separate, advanced endeavor.
8. What It Actually Costs (Real Numbers)
This is the part that makes CFOs smile:
- Software: $0 (Apache-2.0).
- Weights: $0 (open, ~337 MB total download).
- Compute: Runs on CPU. On an M3 Pro or any modern laptop, generation is real-time-ish to faster; no GPU rental.
- API (self-hosted): $0 — the OpenAI-compatible server is local.
- Vs cloud TTS: ElevenLabs-class pricing runs roughly $0.18–$0.30 per 1,000 characters or a $5–$25+/month subscription with volume caps. A 50,000-character audiobook (≈ a few hours of audio) costs $9–$15 on a hosted tier; on Kokoro it costs the electricity to run your CPU for a few minutes — effectively free.
9. Where Your Data Goes (Privacy Reality)
This is the cleanest sovereignty story in the entire batch:
- Your text never leaves your machine. Kokoro runs fully offline after the initial weights download. No API call, no telemetry, no transcript sent to a vendor.
- No account, no key. Unlike hosted TTS, there's nothing to authenticate with and nothing to bill you by character.
- The weights download is the only network touch. Grab
kokoro-v1.0.onnx+voices-v1.0.binonce, then air-gap if you like. - Rust servers are local-first. kokorox/Kokoros bind locally; expose them only if you intentionally proxy them.
10. Kokoro vs Cloud TTS
| | Kokoro (self-hosted) | Hosted TTS (e.g., ElevenLabs) |
|---|---|---|
| Cost | $0 (CPU) | $/1k chars or subscription |
| Data residency | Your machine | Vendor cloud |
| Best-voice quality | Very good (EN) | Excellent (all) |
| Languages | 9 groups, EN strongest | Broad, polished |
| Setup | Weights + espeak-ng | Zero (API key) |
| Latency | Local, fast | Network round-trip |
Choose Kokoro when privacy, cost-at-volume, or offline operation matter. Choose hosted when you need the absolute best voice across every language with zero setup.
11. Verdict
Kokoro is the small-model miracle the local-AI movement lives for: 82 million parameters, Apache-2.0, runs on a CPU, sounds genuinely good, and costs nothing to operate. The only friction is the first install — download the weights, fix the espeak-ng path, and you're speaking.
Pair it with an OpenAI-compatible server (kokorox/Kokoros) and you can replace a paid TTS line in your app with a local one your lawyers will love. For narration, accessibility, and offline voice UIs, Kokoro is the obvious self-hosted pick of 2026.
12. A Full Local Setup, End to End
Here's the whole first-run on a Mac/Linux, no GPU:
# 1. install the ONNX runtime package
pip install kokoro-onnx soundfile
2. download the weights (pip does NOT include them)
curl -L "https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0/kokoro-v1.0.onnx" -o kokoro-v1.0.onnx
curl -L "https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0/voices-v1.0.bin" -o voices-v1.0.bin
3. system espeak-ng (fixes the path bug)
brew install espeak-ng # macOS
sudo apt-get install espeak-ng libespeak-ng-dev # Linux
4. generate
python -c "
from kokoro_onnx import Kokoro
import soundfile as sf
k = Kokoro('kokoro-v1.0.onnx', 'voices-v1.0.bin')
audio, sr = k.create('Hello from my own laptop, no cloud required.', voice='af_sky')
sf.write('hello.wav', audio, sr)
print('wrote hello.wav')
"
That's it — a real WAV, generated offline, for the cost of CPU time.
13. Voice Mixing and Batch Generation
Kokoro's community runtimes let you blend voices and batch:
- Mixing:
voice='af_sky+af_nicole'with weights (af_sky.6+af_nicole.4) yields a hybrid timbre — handy for a signature brand voice. - Batch: loop over lines and write one WAV per line, or concatenate for a long narration. At CPU speed, an hour of audio takes roughly an hour of compute — no per-character bill.
- Timestamps: the Rust ports emit word-level
.tsvsidecars, perfect for subtitle alignment in video editors.
14. Serving It as an OpenAI-Compatible API
With kokorox you get a local server that speaks OpenAI's audio.speech shape:
koko openai --port 8080 --instances 2
Then swap your app's base URL:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8080/v1", api_key="not-needed")
resp = client.audio.speech.create(model="kokoro", voice="af_sky", input="Narrate this locally.")
Your existing OpenAI-calling code now speaks for free, offline. That's a drop-in replacement for a paid TTS line — same interface, zero per-character cost, zero data egress.
15. FAQ
Is it really free? Yes — Apache-2.0, weights open, runs on CPU.
English only? No — 9 language/accent groups, but US English is the strongest.
Why 24 kHz? Fine for speech; not for music. Perfect for narration and voice UIs.
Hard to install? First run has two traps (weights download, espeak-ng path) — both fixed above in ~20 minutes.
Can I use it commercially? Yes, Apache-2.0 permits commercial use.
Related
- Ollama: Run Open Weights on Your Own Machine — the local-model backbone; same "runs offline, free" philosophy for text.
- Open WebUI: The Local Chat Front-End for Your Models — a self-hosted UI you could pair with local speech.
- ComfyUI: Node-Based Local Generative Media — another local, offline media-generation tool in the same spirit.
Comments (0)
No comments yet. Be the first to comment!