Kokoro
Python inference library for the open-weight Kokoro-82M text-to-speech model
Repository Health
Technical Analysis
Kokoro is a Python inference library for Kokoro-82M, an open-weight text-to-speech model with just 82 million parameters. Despite its lightweight architecture, it delivers quality comparable to much larger models while being faster and more cost-efficient.
The library exposes a simple KPipeline API that turns text into audio waveforms across multiple languages, using the misaki grapheme-to-phoneme library under the hood with espeak-ng as a fallback. With Apache-licensed weights, Kokoro can be deployed anywhere from production services to personal projects.
What You Get
- A KPipeline API for text-to-speech generation from Python
- Access to the lightweight, Apache-licensed Kokoro-82M model weights
- Multi-language support via language codes and named voices
- Grapheme-to-phoneme conversion through the misaki library
- 24 kHz audio output suitable for files or streaming playback
Common Use Cases
- Adding offline or self-hosted speech synthesis to an application
- Generating voiceovers and narration from text
- Prototyping voice features in notebooks like Google Colab
- Deploying a low-cost TTS service without proprietary API dependencies
Under The Hood
Architecture - The kokoro package exposes a KPipeline that orchestrates the TTS flow: text is normalized and phonemized via the misaki G2P library (with espeak-ng fallback for out-of-dictionary and non-English input), then fed through the Kokoro-82M neural model to produce 24 kHz audio, yielded segment by segment so callers can stream or write each chunk.
Tech Stack - A Python inference library built on PyTorch, distributed via PyPI with a pyproject.toml and uv.lock; it depends on the companion misaki grapheme-to-phoneme package and pulls the open-weight Kokoro-82M model from Hugging Face. The repo also includes a kokoro.js port for browser/JS inference.
Code Quality - The repository includes a tests/ directory, examples, and a demo, but shows low recent development activity and infrequent maintenance per its health signals; the core Python surface is small and focused, which keeps it approachable despite the light maintenance cadence.
API Design - The public API is intentionally minimal: instantiate KPipeline with a language code, call it with text and a voice, and iterate over generated audio. This low-boilerplate design makes the library easy to adopt in notebooks and services, with advanced options layered on top for voices and phoneme control.
Used by 2 apps in this directory
SurfSense
Search · AI Assistants
The open-source, unlimited NotebookLM alternative with real-time collaboration, a desktop app, and no vendor lock-in.
Voicebox
AI Development · Productivity
Clone voices, dictate anywhere, and give AI agents your voice — all locally.