Kokoro

Voice & Multimodal 💻 JavaScript ⚖️ Apache-2.0 🔴 No recent commits
8.7k stars

Kokoro is an inference library for the Kokoro-82M text-to-speech model, an open-weight TTS model with 82 million parameters. It provides a simple pipeline for generating high-quality speech from text, designed for developers who need fast, cost-efficient TTS in production or personal projects.

✨ Key features

  • Open-weight TTS model with 82 million parameters
  • Apache-licensed weights for flexible deployment
  • Supports multiple languages including English, Spanish, French, Hindi, Italian, Japanese, Portuguese, and Mandarin
  • Simple KPipeline API for text-to-speech generation
  • Outputs audio at 24kHz sample rate
  • Can load custom voice tensors

🎯 Use cases

  • Generate voiceovers for videos or podcasts
  • Create audio versions of written content
  • Build voice assistants or interactive applications
  • Prototype TTS features in Colab notebooks

📦 Installation

🧰 Requirements: Python 3.9+ (recommended), espeak-ng installed for some languages, optional GPU acceleration on Apple Silicon with PYTORCH_ENABLE_MPS_FALLBACK=1.

pip install kokoro>=0.9.4 soundfile

For non-English languages, additional dependencies may be needed (e.g., pip install misaki[ja] for Japanese). On Windows, install espeak-ng from the official releases. On MacOS, set PYTORCH_ENABLE_MPS_FALLBACK=1 for GPU acceleration.

🚀 Usage

from kokoro import KPipeline
import soundfile as sf

pipeline = KPipeline(lang_code='a')
text = "Hello, world!"
generator = pipeline(text, voice='af_heart')
for i, (gs, ps, audio) in enumerate(generator):
    sf.write(f'{i}.wav', audio, 24000)

❓ FAQ

What is Kokoro?

Kokoro is an open-weight TTS model with 82 million parameters, and this library provides inference for it.

How do I install kokoro?

You can install it via pip: pip install kokoro>=0.9.4 soundfile.

What languages are supported?

The README lists support for American English, British English, Spanish, French, Hindi, Italian, Japanese, Brazilian Portuguese, and Mandarin Chinese.

Can I use a custom voice?

Yes, you can load a voice tensor directly and pass it to the pipeline as the voice argument.

📊 Repository

Stars★ 8,705
Forks🍴 949
Open issues🐛 208
Last commit🕒 Aug 6, 2025
Created📅 Jan 2025
Language💻 JavaScript
License⚖️ Apache-2.0

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.