# Repository Briefing: nazdridoy/kokoro-tts
> Source: https://repoforai.com/repo/nazdridoy/kokoro-tts (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/nazdridoy/kokoro-tts
- **Official Docs / Website**: https://huggingface.co/hexgrad/Kokoro-82M
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: B+ (66/100 · Maintenance 12/35 · Adoption 17/25 · Releases 17/20 · License 20/20)
- **Latest Release**: v2.3.2 (2026-08-22) — https://github.com/nazdridoy/kokoro-tts/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: CLI, Local AI, GPU
- **Momentum**: 2,067 ★ total (+5 24h / +22 7d) · 189 forks
- **Topics**: `audiobook`, `epub`, `kokoro`, `kokoro-tts`, `pdf`, `podcast`, `python`, `tts`
- **When to Use**: Best for: Readers turning EPUBs or PDFs into chapter-organized audio, and teams that want local text-to-speech in a shell or batch workflow. Skip if: You need a ready-made hosted API, remote audio streaming, or voice cloning from recordings.

## Overview
```text
### Architecture & Core Mechanics
Kokoro TTS is a Python CLI, invoked as `kokoro-tts` or `python -m kokoro_tts`, with local inference through `kokoro-onnx==0.3.9`. It reads TXT, EPUB, PDF, or stdin. For structured documents it extracts chapter information, then breaks long text into smaller segments for synthesis, local playback, or file output. The default model and voice assets are separate: `kokoro-v1.0.onnx` and `voices-v1.0.bin`.

The dependency stack includes EbookLib and Beautiful Soup 4 for ebook and markup handling, PyMuPDF, `pymupdf-layout`, and `pymupdf4llm` on the PDF side, and `sounddevice` and `soundfile` on the audio side. The practical integration surface is a subprocess with arguments, stdin, and output files. There is no established plugin contract or network service interface; playback streaming should not be treated as a streaming API.

### Key Capabilities & Differentiators
Preset voices cover US and UK English (`en-us`, `en-gb`), French (`fr-fr`), Italian (`it`), Japanese (`ja`), and Mandarin (`cmn`). `--lang` selects the language, `--speed` adjusts delivery, and `--voice` accepts either one preset or a weighted mix such as `af_sarah:60,am_adam:40`. Blending gives users a way to tune existing voices; it is not evidence of voice cloning from a recording.

EPUB processing preserves chapter titles and structure, while PDF chapter detection works from the table of contents or content. Output can be a single WAV or MP3 file, or chunks organized for chapter assembly with `--split-output` and `--merge-chunks`. `--stream` plays audio locally as it is generated. For troubleshooting, `--debug` exposes processing details including EPUB NCX parsing and discovered chapter metadata.

### Trade-offs & Limitations
Compared with a hosted service such as ElevenLabs, this CLI keeps document handling and inference on the user's machine and is straightforward to script from a shell. In return, the operator manages the Python environment, model files, compute capacity, and any GPU compatibility work. If the requirement is a shared remote endpoint, the CLI is a component to wrap and operate, not a ready-to-deploy service.

Document-aware processing reduces manual chapter splitting, but chapter detection and reading order are still worth spot-checking before converting an entire book, particularly for complex PDFs. Compare voice quality on representative text rather than assuming parity with hosted offerings. The CLI carries an MIT license; deployment and redistribution reviews should separately cover the model, voice assets, dependencies, and rights to the source documents.

### Hardware & Deployment Guide
Use Python 3.11 or 3.12; the package excludes Python 3.13 and later. Install from PyPI with `uv tool install kokoro-tts` or `pip install kokoro-tts`, or run the cloned `kokoro_tts` module after installing dependencies. Fetch `kokoro-v1.0.onnx` and `voices-v1.0.bin` separately. The default lookup expects both in the working directory; once the dependencies and assets are in place, synthesis runs locally without a hosted TTS endpoint.

v2.3.0 introduced custom model and voice paths and stricter model-file validation. v2.3.2 replaced deprecated `fitz` API usage for PDF-processing compatibility. Start with CPU inference, then measure end-to-end conversion time, peak RAM, and output size using representative files. GPU support is available, but there is no established VRAM requirement or speedup figure. For parallel batches, check aggregate memory and storage on the intended host.
```

## Key Capabilities
```text
- Runtime: Local Kokoro inference through `kokoro-onnx==0.3.9`, with separate ONNX model and voice files.
- Document structure: EPUB chapter and NCX handling; PDF chapter detection from the table of contents or content.
- Shell integration: Pipe text through stdin with `-`, and pass an explicit `--voice` for unattended runs.
- Voice controls: Weighted preset blending with `--voice`, language selection with `--lang`, and speech-rate control with `--speed`.
- Audio workflow: Local `--stream` playback, WAV or MP3 export, and `--merge-chunks` to assemble chunks into chapter files.
- Release evolution: v2.3.0 added custom asset paths and stricter validation; v2.3.2 replaced deprecated PDF-processing API usage.
```

## Quick Start / Clone
```bash
# Using uv (recommended)
uv tool install kokoro-tts

# Using pip
pip install kokoro-tts
```
