remsky/Kokoro-FastAPI
Dockerized OpenAI-compatible wrapper for Kokoro-82M text-to-speech w/multiplatform CPU, AMD, NVIDIA GPU PyTorch; multi-speaker, voice-mixing, auto-stitching, caption timestamps, SSML, readalong web UI
What it solves
Kokoro-FastAPI provides a high-performance, Dockerized API wrapper for the Kokoro-82M text-to-speech (TTS) model. It simplifies the deployment of high-quality speech synthesis, allowing users to generate hours of audio in minutes while providing an OpenAI-compatible interface for easy integration into existing applications.
How it works
The project wraps the Kokoro-82M model in a FastAPI server, exposing endpoints that handle text-to-speech requests. It supports multiple hardware backends including CPU, NVIDIA GPUs (CUDA), AMD GPUs (ROCm), and Apple Silicon (MPS). The system handles text processing, voice mixing, and audio encoding into various formats (MP3, WAV, Opus, FLAC, AAC, PCM) before streaming or returning the final audio file.
Who it’s for
- Developers looking for a self-hosted, OpenAI-compatible TTS API.
- Content Creators needing fast, high-quality voice generation for long-form content.
- AI Application Builders integrating multi-speaker dialogue or complex speech control into their software.
Highlights
- OpenAI Compatibility: Uses a standard Speech endpoint for seamless integration.
- Multi-Language Support: Supports English (US/GB), Spanish, French, Hindi, Italian, Japanese, Brazilian Portuguese, and Mandarin Chinese.
- Advanced Voice Control: Features weighted voice combinations (mixing multiple voices), voice aliasing, and inline speaker switching via tags.
- Fine-grained Text Control: Supports inline tokens for pauses, IPA pronunciation, and speaking rates, as well as experimental SSML support.
- High Performance: Offers streaming support to reduce first-token latency and supports a wide range of hardware acceleration.
- Detailed Output: Can generate per-word or per-chunk timestamped captions.
Related
- Dispatch
- Project
- Project
- Project
- Project