█

AI/TLDR

Kokoro

An 82M-parameter open-weight text-to-speech model that runs fast on modest hardware

Audio, Music & VoiceOpen source
Language
Python
License
Apache-2.0
$pip install kokoro>=0.9.4 soundfile

Overview

Kokoro is an open-weight text-to-speech (TTS) model with 82 million parameters, paired with the `kokoro` Python inference library. Despite the small size, its authors say it produces quality comparable to larger models while running faster and at lower cost. The weights are Apache-licensed, so you can use it in both production and personal projects.

It's aimed at developers who need to turn text into speech without standing up heavy infrastructure. Because the model is small, it can run on modest hardware, including CPUs, which makes it a fit for local apps, batch jobs, and experiments where a large hosted TTS service would be overkill.

Within the speech and audio space, Kokoro covers the core text-to-speech task across several languages, including American and British English, Spanish, French, Hindi, Italian, Japanese, Brazilian Portuguese, and Mandarin Chinese. Under the hood it uses the `misaki` grapheme-to-phoneme library and `espeak-ng` for some fallbacks and non-English languages.

What it does

  • Compact 82M-parameter model that runs on modest hardware, including CPUs
  • Apache-licensed open weights, usable in production or personal projects
  • Simple Python API through the `KPipeline` class
  • Multilingual via per-language `lang_code` values (American/British English, Spanish, French, Hindi, Italian, Japanese, Brazilian Portuguese, Mandarin Chinese)
  • Selectable voices (for example `af_heart`) plus adjustable speed and text-splitting
  • Outputs 24 kHz audio you can save directly with soundfile

Getting started

Install the kokoro package and espeak-ng, then create a pipeline and generate audio from text. The example below mirrors the README's basic quickstart.

Install kokoro and espeak-ng

Install the kokoro library and soundfile from pip, plus the espeak-ng system package (used for English out-of-distribution fallback and some non-English languages). On Linux you can install espeak-ng with apt; on Windows download the installer from the espeak-ng releases page.

bashbash
pip install kokoro>=0.9.4 soundfile
apt-get -y install espeak-ng

Generate and save audio

Create a KPipeline with a language code (here 'a' for American English), pick a voice, and write each chunk to a WAV file at 24 kHz.

pythonpython
from kokoro import KPipeline
import soundfile as sf

pipeline = KPipeline(lang_code='a')
text = 'Kokoro is an open-weight TTS model with 82 million parameters.'
generator = pipeline(text, voice='af_heart')
for i, (gs, ps, audio) in enumerate(generator):
    print(i, gs, ps)
    sf.write(f'{i}.wav', audio, 24000)

Match voice to language

Make sure lang_code matches your chosen voice. Other codes include 'b' (British English), 'e' (Spanish), 'f' (French), 'h' (Hindi), 'i' (Italian), 'j' (Japanese), 'p' (Brazilian Portuguese), and 'z' (Mandarin Chinese). Japanese and Mandarin need extra misaki extras (pip install misaki[ja] or misaki[zh]).

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Add local text-to-speech to an app without depending on a hosted TTS API
  • Generate voiceovers or audio versions of articles and documents in batch
  • Run speech synthesis on CPU-only or low-resource machines
  • Prototype multilingual voice features across English, Spanish, French, Hindi, and more

How Kokoro compares

Kokoro alongside other open-source audio, music & voice tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Whisper★ 111kOpenAI's speech recognition model that transcribes and translates audio across many languages.
VoiceStudio★ 89.6kA local-first desktop voice studio that clones and designs voices, dubs video, and handles dictation, running 16 text-to-speech and 11 speech-recognition engines on your own hardware.
GPT-SoVITS★ 63.8kAn open-source WebUI that clones a voice from a short audio sample and turns text into speech, with zero-shot and few-shot fine-tuning.
Voicebox★ 58.7kLocal-first voice studio that clones a voice from a short sample, generates speech across seven TTS engines and 23 languages, handles system-wide dictation, and speaks for agents over MCP.
VibeVoice★ 55kMicrosoft's text-to-speech model for generating long, expressive multi-speaker audio like podcasts.
whisper.cpp★ 54.7kA dependency-free C/C++ port of Whisper built on ggml, running speech recognition on CPU, Metal, CUDA, Vulkan and NPUs from phones to servers.
Coqui TTS★ 46.1kA library of text-to-speech models including the multilingual XTTS voice-cloning model.
Kokoro★ 9.7kAn 82M-parameter open-weight text-to-speech model that runs fast on modest hardware