Kokoro FastAPI OpenAI-Compatible Text-to-Speech Server
Kokoro-FastAPI is a Dockerized FastAPI wrapper around the Kokoro-82M text-to-speech model with OpenAI-compatible speech endpoints. It supports local TTS serving, multi-language synthesis, web UI access, and timestamped audio generation workflows.
Prerequisites
Docker
Installation
Use the upstream install or setup path that matches your environment:
- docker run -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-cpu:latest # CPU, or:
- docker run --gpus all -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-gpu:latest # NVIDIA GPU, or:
- docker run --device=/dev/kfd --device=/dev/dri -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-rocm:latest # AMD GPU (ROCm, experimental, amd64 only)
- git clone https://github.com/remsky/Kokoro-FastAPI.git
Requirements and caveats from upstream:
- Install prerequisites, and start the service using Docker Compose (Full setup including UI):
Basic usage or getting-started notes:
Pre built images are available to run, with arm/multi-arch support, and baked in models
Named versions should be pinned for your regular usage.
Extracted from upstream docs: https://raw.githubusercontent.com/remsky/Kokoro-FastAPI/HEAD/README.md