Kokoro Runs High-Quality TTS Locally on CPU — Even a Decade-Old One
Kokoro is an 82-million-parameter text-to-speech model that produces convincing, multilingual speech entirely on a CPU, keeping audio generation local and off the cloud. Despite its small size, it handles English, Mandarin, and Hindi and ships around 50 voices, most tuned for English. The privacy angle is the point: no text leaves the machine, and the GPU stays free for other work like LLM inference.
Setup is deliberately low-friction. A prebuilt Kokoro-FastAPI container (roughly 5 GB, since the voice weights are bundled) exposes both a browser UI and an OpenAI-speech-API-compatible endpoint, so existing tools that already speak the OpenAI format can be repointed with a single environment variable. Sample JavaScript and Python clients generate MP3 output and auto-play it if SoX is installed. Voices are selectable via an environment variable.
Performance is the standout claim. On a short paragraph, synthesis took about 1.5 seconds on a modern AMD Ryzen chip and 4.5–4.7 seconds on an Apple M2 Pro or a 12-year-old Intel i7-4770K — fast enough to be practical on aging hardware. For teams needing speech-to-text as well, the article points to Speaches, an alternative OpenAI-compatible container that adds Whisper but requires downloading voice weights separately. Paired with a local LLM, the combination lets users listen to model responses instead of reading them.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.