remsky /Kokoro-FastAPI

Dockerized OpenAI-compatible wrapper for Kokoro-82M text-to-speech w/multiplatform CPU, AMD, NVIDIA GPU PyTorch; multi-speaker, clone-tuning, caption timestamps, SSML, websockets, optional readalong web UI

★ 5,686⑂ 945👁 35⑃ 219● 298▤ 29
PythonApache-2.0Created 2024-12-30
Download: v0.10.0: Websockets/Realtime API, CPU Memory & API Keysv0.10.0 ↓0.10.02026-11-08
+4
Daily
5,686
stars
945
forks
35
watchers
219
prs
298
issues
29
releases

README

!FastKoko: Dockerized Kokoro-82M TTS, OpenAI-compatible API





 



 

 


Dockerized FastAPI wrapper for Kokoro-82M text-to-speech model. Generate hours of high quality speech in minutes.

- OpenAI-compatible Speech + Realtime (TTS only) endpoints, multi-language support
  - English (US/GB), Spanish, French, Hindi, Italian, Japanese, Brazilian Portuguese, Mandarin Chinese
- ElevenLabs and Cartesia compatible websockets for voice agents (LiveKit, Pipecat)
- Custom voicepacks via Inno Clone-Tuner
- Optional integrated WebUI; read-along long-generation
- Inline multi-speaker generation, weighted voice mixing with short aliases, SSML support
- Per-word, or per-chunk timestamped caption generation
- Phoneme endpoints: generate phonemes from text, or generate audio from phonemes
- Prebuilt multiplatform images
  - CPU and NVIDIA GPU (CUDA): linux/amd64 + linux/arm64
  - AMD GPU (ROCm, experimental): linux/amd64 only
- Apple Silicon (MPS) supported when running directly via UV (no image)


 Integration & Guides 
 

   



🌐Community projects that enable Kokoro-FastAPI as a backend

- Home Assistant
  - wyoming_openai, openai_tts, Kokoro-TTS, Kokoro-FastAPI App
- App stores and templates
  - Umbrel, Unraid Apps, GPUStack, jetson-containers
- Readers and audiobooks
  - openreader, epub_to_audiobook, audiobook-creator, Zotero-OpenReader
- Assistants and agents
  - xiaozhi-esp32-server, call-me, agent-cli, voice-chat-ai
- Browser
  - kokoro-extension, customtts



 Get Started


Quickest Start (docker run)

Pre-built multi-arch images with models baked in. 

:latest is available, but please pin to a release tag for stable usage.

No GPU (laptop, CPU-only server)
bash
docker run -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-cpu:latest


NVIDIA (GTX 900-series through RTX 40; ships cu126)
bash
docker run --gpus all -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-gpu:latest


NVIDIA RTX 50-series / Blackwell (ships cu128)
bash
docker run --gpus all -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-gpu:latest-cu128


NVIDIA arm64 (Jetson, GH200; same tag, ships cu129)
bash
docker run --gpus all -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-gpu:latest


AMD GPU (ROCm, experimental, x86_64 only)
bash
docker run --device=/dev/kfd --device=/dev/dri -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-rocm:latest


Apple Silicon (native MPS clone; the CPU image also works)
bash
./start-gpu_mac.sh


gpu:latest is the same image as gpu:latest-cu126. Configuration via environment variables, see the configuration guide.





Quick Start (docker compose) 

1. Install prerequisites, and start the service using Docker Compose (Full setup including UI):
   - Install Docker
   - Clone the repository:
        bash
        git clone https://github.com/remsky/Kokoro-FastAPI.git
        cd Kokoro-FastAPI

        cd docker/gpu    For NVIDIA GPU support
         or cd docker/cpu    For CPU support
         or cd docker/rocm   For AMD GPU (ROCm, experimental, amd64 only)
        docker compose up --build

Top issues

Discussions

Latest release

v0.10.0: Websockets/Realtime API, CPU Memory & API Keys v0.10.0 2026-11-08
Curated summary: CHANGELOG.md
 feat(api): add ElevenLabs and Cartesia compatible websocket TTS for voice agents by @remsky in https://github.com/remsky/Kokoro-FastAPI/pull/576
 feat(api): add OpenAI Realtime compatible TTS on /v1/realtime, Speech endpoint fields on all websockets by @remsky in https://github.com/remsky/Kokoro-FastAPI/pull/584
 fix(docker): preload jemalloc in the CPU image to reduce + keep memory flat by @YaannnTech in https://github.com/remsky/Kokoro-FastAPI/pull/595
 feat(api): optional API keys for the API routes by @davidcoulson in https://github.com/remsky/Kokoro-Fast

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON