# Kokoro-FastAPI-zh

Kokoro-FastAPI-zh is a self-hosted OpenAI-compatible text-to-speech API for homelabbers that serves the Kokoro-82M-v1.1-zh Chinese speech model, giving OpenAI-compatible applications a local Chinese TTS endpoint. It is open source and self-hosted, installable on Unraid.

Canonical page: https://ourlocalhost.com/app/2967/kokoro-fastapi-zh

## Description

Kokoro-FastAPI-zh is a self-hosted OpenAI-compatible text-to-speech API for homelabbers that serves the Kokoro-82M-v1.1-zh Chinese speech model, giving OpenAI-compatible applications a local Chinese TTS endpoint.

## Platform availability

Available on 1 of 10 platforms: Unraid.

## Health score

33/100 (Low), based on 5 of 5 factors.
- Maintained: 47 (last commit 263 days ago)
- Popular: 28 (23 GitHub stars)
- Easy to install: 35 (1 install platform, install notes, Docker image)
- Light to run: 30 (4 GB minimum RAM)
- Security check: 10 (3 serious findings, 7 minor, CI, tests)

## Security check

3 serious findings: Uses anyio 4.8.0, which has a known critical vulnerability; Uses certifi 2024.12.14, which has a known critical vulnerability; Uses h11 0.14.0, which has a known critical vulnerability.
Automated checks on commit 0c919d8, 16 Nov 2026. Not an audit.

## Links

- Unraid: https://ca.unraid.net/apps/kokoro-fastapi-zh-0brpq601fobd04?q=Kokoro-FastAPI-zh

## Common questions

### What changes are required to use the GPU image instead of the default CPU image?

Use the GPU repository image, set USE_GPU=true, and add the container arguments --gpus=all --runtime=nvidia. Those GPU flags should not be left on CPU hosts.

### Which model and voice are configured by default in this fork?

The default REPO_ID is hexgrad/Kokoro-82M-v1.1-zh, with model v1_1_zh/kokoro-v1_1-zh.pth and voice zf_094.

### How does it handle English segments when generating Chinese audio?

When lang_code is set to 'z', en_callable is enabled and English segments are processed by the English pipeline.

### What TCP port should a reverse proxy or client target for the API?

Use port 8880 for the OpenAI-compatible TTS API.

---
Source: Our Local Host (https://ourlocalhost.com/app/2967/kokoro-fastapi-zh), the self-hosted and open-source app directory.
