Kokoro

Python inference library for the open-weight Kokoro-82M text-to-speech model

Library
PyPI
v0.9.4
8,470stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
36/100Needs Attention
Development Activity0
Maintenance0
Community64
Maturity40
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture78
Code Quality74
Innovation88
Learning Curve84

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.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search