kokoroTTS

Hangry Labs KokoroTTS logo

Hangry Labs KokoroTTS

Easy-to-run Kokoro text-to-speech Docker images with a browser UI and HTTP API included.

This Hangry Labs fork is made for ease of use. The aim is that anyone should be able to run text to speech without fighting Python environments, missing model files, or unclear setup: a person trying it at home, a developer wiring it into an app, or a professional evaluating it for a production environment. Install Docker, run one command from Quick Start, open the local link, and start generating speech.

You get:

Official Docker images are published here: hangrylabs/kokorotts on Docker Hub.

Voice examples are available here: hangry-labs.github.io/kokoroTTS/examples.

Hangry Labs home: nuggies.website.


Voice Examples

Preview multilingual product-intro MP3 samples from the full KokoroTTS image:

Open the voice examples page

GitHub does not render embedded audio players directly in README files, so direct MP3 links are also provided below.

Language Voice Sample
American English af_heart Listen to MP3
American English af_bella Listen to MP3
American English af_nicole Listen to MP3
American English af_aoede Listen to MP3
American English af_kore Listen to MP3
American English af_sarah Listen to MP3
American English af_nova Listen to MP3
American English af_sky Listen to MP3
American English af_alloy Listen to MP3
American English af_jessica Listen to MP3
American English af_river Listen to MP3
American English am_michael Listen to MP3
American English am_fenrir Listen to MP3
American English am_puck Listen to MP3
American English am_echo Listen to MP3
American English am_eric Listen to MP3
American English am_liam Listen to MP3
American English am_onyx Listen to MP3
American English am_santa Listen to MP3
American English am_adam Listen to MP3
British English bf_emma Listen to MP3
British English bf_isabella Listen to MP3
British English bf_alice Listen to MP3
British English bf_lily Listen to MP3
British English bm_george Listen to MP3
British English bm_fable Listen to MP3
British English bm_lewis Listen to MP3
British English bm_daniel Listen to MP3
Japanese jf_alpha Listen to MP3
Japanese jf_gongitsune Listen to MP3
Japanese jf_nezumi Listen to MP3
Japanese jf_tebukuro Listen to MP3
Japanese jm_kumo Listen to MP3
Mandarin Chinese zf_xiaobei Listen to MP3
Mandarin Chinese zf_xiaoni Listen to MP3
Mandarin Chinese zf_xiaoxiao Listen to MP3
Mandarin Chinese zf_xiaoyi Listen to MP3
Mandarin Chinese zm_yunjian Listen to MP3
Mandarin Chinese zm_yunxi Listen to MP3
Mandarin Chinese zm_yunxia Listen to MP3
Mandarin Chinese zm_yunyang Listen to MP3
Spanish ef_dora Listen to MP3
Spanish em_alex Listen to MP3
Spanish em_santa Listen to MP3
French ff_siwis Listen to MP3
Hindi hf_alpha Listen to MP3
Hindi hf_beta Listen to MP3
Hindi hm_omega Listen to MP3
Hindi hm_psi Listen to MP3
Italian if_sara Listen to MP3
Italian im_nicola Listen to MP3
Brazilian Portuguese pf_dora Listen to MP3
Brazilian Portuguese pm_alex Listen to MP3
Brazilian Portuguese pm_santa Listen to MP3

Quick Start

docker run -p 7860:7860 --gpus all hangrylabs/kokorotts:v0.2

Run on CPU:

docker run -p 7860:7860 hangrylabs/kokorotts:v0.2

Run on a specific GPU (example: GPU index 1):

docker run -p 7860:7860 --gpus "device=1" -e CUDA_VISIBLE_DEVICES=1 hangrylabs/kokorotts:v0.2

Then open: http://localhost:7860


API Usage Example

curl -X POST "http://localhost:7860/tts/generate" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello world!","voice":"af_heart"}' \
  -o output.wav

The modern synthesis endpoint is POST /tts/generate; POST /tts/convert remains available for older clients. When output_format is omitted, the API returns WAV audio as before. The web UI defaults to MP3 downloads because it is a more practical size for interactive use. To request a smaller response, add output_format with one of mp3, flac, or ogg:

curl -X POST "http://localhost:7860/tts/generate" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello world!","voice":"af_heart","output_format":"mp3"}' \
  -o output.mp3

Optional audio controls are available on /tts/generate, /tts/convert, and /tts/stream. They are neutral by default, so existing API clients do not pay the extra ffmpeg processing cost unless a control is changed:

curl -X POST "http://localhost:7860/tts/generate" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello world!","voice":"af_heart","output_format":"mp3","pitch_semitones":2,"tempo":1.1,"volume":0.9,"normalize":true}' \
  -o output.mp3

Useful discovery endpoints:

Use From Python

Install this package in a Python project and point the client at a running KokoroTTS server:

from kokorotts import KokoroTTSClient

tts = KokoroTTSClient("http://localhost:7860")

audio = tts.generate(
    text="Hello from my Python app.",
    voice="af_heart",
    output_format="mp3",
    pitch_semitones=2,
)

audio.save("hello.mp3")

About This Fork

This project is an independently maintained fork of the original Kokoro by hexgrad. The original work is licensed under the Apache License 2.0, and we thank the authors for their excellent research and contributions.

While Kokoro is an impressive model/library project, this Hangry Labs fork focuses on making it simple to run and integrate: Docker image, included UI, API support, offline-friendly assets, and practical examples out of the box.

License and attribution are preserved in LICENSE.

Support & Issues

If you encounter bugs, have feature requests, or need help using Hangry Labs KokoroTTS:


Docker Features


Docker Hub

You can explore all available Hangry Labs KokoroTTS container images on Docker Hub.

This is useful if you want to:

Current tag pattern:


Local Development

task image
task image-tiny
task imagerun
task imagerun-tiny
task imageweb
task imageapi

The default image is the full baked image and keeps model, voice, and required language assets inside the container for offline use. The tiny image keeps required runtime/language dependencies but skips baked Hugging Face model/voice assets and uses the persistent /app/.cache/huggingface Docker volume instead; run it online once to warm the cache, then reuse the same volume across rebuilt containers.

Hot-swap local app code into the container without rebuilding:

task localrun
task localrun-tiny
task logs
task client-test

task imagerun and task localrun mount a named Docker volume at /app/.cache/huggingface so lazy-downloaded Hugging Face assets survive container and image rebuilds. Baked run tasks seed missing cache files from the full image before startup, so the normal image stays offline-friendly even if the cache volume was first created by a tiny run. Use task nuke when you need a true from-scratch cache test.

Release from a clean tree:

task release DRY_RUN=1
task release

Version History

v0.3 Snapshot

v0.2

Run with:

docker run -p 7860:7860 --gpus all hangrylabs/kokorotts:v0.2
docker run -p 7860:7860 --gpus "device=1" -e CUDA_VISIBLE_DEVICES=1 hangrylabs/kokorotts:v0.2

v0.0.1


License

This fork is licensed under the Apache License 2.0.

Original work by hexgrad in Kokoro.