PyKokoro Documentation
PyKokoro is a Python library for text-to-speech synthesis using the Kokoro TTS model. It provides high-quality, natural-sounding speech generation with support for multiple languages, voices, and advanced features like pause control and text splitting.
Contents:
- Quick Start Guide
- Installation Guide
- Basic Usage
- Advanced Features
- Pipeline Usage and Stages
- API Reference
- Examples
- Changelog
- [0.8.4] - Unreleased
- [0.8.3] - 2026-08-06
- [0.8.2] - 2026-08-05
- [0.8.1] - 2026-08-04
- [0.8.0] - 2026-08-01
- [0.7.4] - 2026-07-30
- [0.7.2] - 2026-07-29
- [0.7.1] - 2026-07-28
- [0.7.0] - 2026-07-27
- [0.6.5] - 2026-02-11
- [0.6.4] - 2026-01-31
- [0.6.3] - 2026-01-28
- [0.6.2] - 2026-01-27
- [0.6.1] - 2026-01-25
- [0.6.0] - 2026-01-25
- [0.5.1] - 2026-01-23
- [0.5.0] - 2026-01-23
- [0.4.0] - 2026-01-17
- [0.3.0] - 2026-01-14
- [0.2.0] - 2026-01-11
- [0.1.0] - 2026-01-07
Features
High-Quality TTS: Natural-sounding speech synthesis using the Kokoro model
Multiple Languages: Support for English (US/GB), Spanish, French, German, Italian, Portuguese, Hindi, Japanese, Korean, and Chinese
Voice Selection: Choose from 54 voices (v1.0) or 103 voices (v1.1-zh) with various styles and accents
Voice Blending: Create custom voice styles by blending multiple voices
Text Normalization: Automatic say-as support for numbers, dates, phone numbers, and more using SSMD markup
Pause Control: Add precise pauses using SSMD break syntax:
...c,...s,...p,...500msSmart Text Splitting: Automatically split long text at sentence, paragraph, or clause boundaries
Language-Aware spaCy Models: Auto-resolve spaCy package names from language + size
Phoneme-Based Generation: Generate speech directly from phonemes for precise control
GPU Acceleration: Optional GPU support for faster generation
Flexible Audio Processing: Trim silence, adjust speed, and more
Composable Pipeline Stages: Swap doc parsing, splitting, g2p, and audio stages
Quick Example
from pykokoro import GenerationConfig, KokoroPipeline, PipelineConfig
config = PipelineConfig(
voice="af_bella",
generation=GenerationConfig(speed=1.0),
)
pipe = KokoroPipeline(config)
result = pipe.run("Hello, world! This is a test.")
# Save to file
import soundfile as sf
sf.write("output.wav", result.audio, result.sample_rate)
Installation
Install via pip:
pip install pykokoro
Or with GPU support:
pip install pykokoro[gpu]
Requirements
Python 3.9 or higher
NumPy
ONNX Runtime
espeak-ng (for phonemization)
Optional: GPU with CUDA/ROCm for acceleration
Getting Help
GitHub Issues: https://github.com/remixer-dec/pykokoro/issues
Documentation: https://pykokoro.readthedocs.io
Examples: See the
examples/directory in the repository
License
PyKokoro is released under the MIT License. The Kokoro model itself is subject to its own license terms.