AI Card Bao NWIGAKCBISGAME.AICARDBAO.COM
Home / open source / Kokoro
AI TOOL / #12975

Kokoro

A lightweight TTS system with only 82MB of parameters – can be run on CPUs without the need for GPUs, making it ideal for generating large amounts of English subtitles.

Introduction

An inference library for Kokoro-82M. You can pip install kokoro.

Kokoro is an open-weight TTS model with 82 million parameters. Despite its lightweight architecture, it delivers comparable quality to larger models while being significantly faster and more cost-efficient. With Apache-licensed weights, Kokoro can be deployed anywhere from production environments to personal projects.

Usage

You can run this basic cell on Google Colab. Listen to samples.

!pip install -q kokoro>=0.9.4 soundfile
!apt-get -qq -y install espeak-ng > /dev/null 2>&1
from kokoro import KPipeline
from IPython.display import display, Audio
import soundfile as sf
import torch
pipeline = KPipeline(lang_code='a')
text = '''
[Kokoro](/kˈOkəɹO/) is an open-weight TTS model with 82 million parameters. Despite its lightweight architecture, it delivers comparable quality to larger models while being significantly faster and more cost-efficient. With Apache-licensed weights, [Kokoro](/kˈOkəɹO/) can be deployed anywhere from production environments to personal projects.
'''
generator = pipeline(text, voice='af_heart')
for i, (gs, ps, audio) in enumerate(generator):
    print(i, gs, ps)
    display(Audio(data=audio, rate=24000, autoplay=i==0))
    sf.write(f'{i}.wav', audio, 24000)

Under the hood, kokoro uses misaki, a G2P library at https://github.com/hexgrad/misaki

Advanced Usage

You can run this advanced cell on Google Colab.

# 1️⃣ Install kokoro
!pip install -q kokoro>=0.9.4 soundfile
# 2️⃣ Install espeak, used for English OOD fallback and some non-English languages
!apt-get -qq -y install espeak-ng > /dev/null 2>&1

# 3️⃣ Initalize a pipeline
from kokoro import KPipeline
from IPython.display import display, Audio
import soundfile as sf
import torch
# 🇺🇸 'a' => American English, 🇬🇧 'b' => British English
# 🇪🇸 'e' => Spanish es
# 🇫🇷 'f' => French fr-fr
# 🇮🇳 'h' => Hindi hi
# 🇮🇹 'i' => Italian it
# 🇯🇵 'j' => Japanese: pip install misaki[ja]
# 🇧🇷 'p' => Brazilian Portuguese pt-br
# 🇨🇳 'z' => Mandarin Chinese: pip install misaki[zh]
pipeline = KPipeline(lang_code='a') #  graphemes/text
    print(ps) # ps => phonemes
    display(Audio(data=audio, rate=24000, autoplay=i==0))
    sf.write(f'{i}.wav', audio, 24000) # save each audio file

Windows Installation

To install espeak-ng on Windows:

  1. Go to espeak-ng releases
  2. Click on Latest release
  3. Download the appropriate *.msi file (e.g. espeak-ng-20191129-b702b03-x64.msi)
  4. Run the downloaded installer

For advanced configuration and usage on Windows, see the official espeak-ng Windows guide

MacOS Apple Silicon GPU Acceleration

On Mac M1/M2/M3/M4 devices, you can explicitly specify the environment variable PYTORCH_ENABLE_MPS_FALLBACK=1 to enable GPU acceleration.

PYTORCH_ENABLE_MPS_FALLBACK=1 python run-your-kokoro-script.py

Conda Environment

Use the following conda environment.yml if you're facing any dependency issues.

name: kokoro
channels:
  - defaults
dependencies:
  - python==3.9
  - libstdcxx~=12.4.0 # Needed to load espeak correctly. Try removing this if you're facing issues with Espeak fallback.
  - pip:
      - kokoro>=0.3.1
      - soundfile
      - misaki[en]

Acknowledgements

Visits:54 Updated:2026-12-04 AI tools

Related

Bige AI PPT PenGrid AI PPT is a product developed under the 135 Editor, one of the leading graphic and text layout tools in China. It is an online AI-based service that allows users to create PPTs with just one click. Relying on advanced models such as DeepSeek-R1/V3 and DouBao Pro, users simply need to enter the theme for their presentation or import relevant documents, and the AI will quickly generate the required PPT content for them. F-Droid F-Droid is an Android app store. Unlike Google Play or some other Chinese app stores, F-Droid only lists free and open-source software (FOSS) and places a strong emphasis on privacy and security. Every app is verified. F-Dr uBlock uBlock Origin (uBO) – is a free, open source web ad content blocking plug-in known for its extremely low memory and CPU usage. It can block ads, trackers, cryptocurrency miners, ad pop-ups, annoying anti-blockers, malicious Crx Search CrxSearch is a website dedicated to downloading browser extensions, designed to address the issue of inaccessibility to the Chrome Extension Store. This platform supports the download of extensions for four different browsers: Google Chrome, Edge, Firefox, and Opera. Its usage is also very straightforward. Rough and uneven surfaces Atoall is an all-round online file format conversion platform that supports the conversion of over 200 different file types, covering categories such as videos, audio files, images, documents, and e-books. It meets the daily needs of individual users, media professionals, and developers alike. Since it operates in the cloud, there is no need for... WeChat Red Packet Cover 2025 For the 2025 Year of the Snake, I’ve customized a few more exclusive WeChat red envelope covers for the Year of the Snake! This year, the official red envelope cover platform gave me 60,000 free quotas, and in addition to that, I’m also using a paid distribution model. The paid model requires 14 WeChat Beans to get one.) Of course, teaching someone to fish is better than giving them a fish, so today I’ll mainly...