Model or dataset
lucasjinreal/Kokoros avatar
lucasjinreal/Kokoros

Kokoros: running the Kokoro TTS model from a Rust binary named koko

🔥🔥 Kokoro in Rust. https://huggingface.co/hexgrad/Kokoro-82M Insanely fast, realtime TTS with high quality you ever have.

832 stars117 forksRustApache-2.0

At a glance

What is it?
Kokoros wraps the Kokoro-82M text-to-speech model in Rust, giving you a koko command for the terminal, an OpenAI-compatible server for streaming audio, and word-level timestamps as a TSV sidecar. The build needs an Opus codec and a downloaded ONNX model, so the first run is not instant.
Who is it for?
Adopt Kokoros if you want speech synthesis you can call from a shell script or an OpenAI-compatible endpoint without running Python, and you are willing to download the model and voice files yourself. Do not adopt it if you need broad language coverage today, because only English is listed as fully supported while Chinese, Japanese and German are partial, and do not expect the multi-model support that the successor project, Crane, advertises.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 18 days ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A CLI for a model, plus a crate and a server

Kokoros provides what the README calls insanely fast Kokoro inference in Rust, so you can have a built TTS engine powered by Kokoro and run it with a single command of koko. The repository is a Cargo workspace with three members, koko, kokoros and kokoros-openai, and each name describes a layer. koko is the command line binary you run from a terminal. kokoros is the crate, described as providing easy to use TTS ability, which is what you would depend on if you are embedding synthesis in a Rust application. kokoros-openai is the server layer. The model itself is not trained here. It is the Kokoro model published on Hugging Face as Kokoro-82M, and the README describes it as a trending top 2 TTS model on Hugging Face. The stated model size is a relative small 87M parameters, and the README claims that still results in extremely good quality voices. So the value here is not the model, it is the runtime: a native binary that starts fast and runs on your own hardware.

The build needs Opus and a model file before it can speak

There are two system dependencies and they are platform specific. On macOS the README gives a single brew command:

bash
brew install pkg-config opus

On Linux, Ubuntu and Debian, the equivalent is:

bash
sudo apt-get install pkg-config libopus-dev

Then the model and voice data have to be fetched. The all-in-one script is:

bash
bash download_all.sh

and it pulls two files, the Kokoro ONNX model at checkpoints/kokoro-v1.0.onnx and the voices data file at data/voices-v1.0.bin. If you would rather fetch them one at a time, scripts/download_models.sh and scripts/download_voices.sh do it individually. Building the binary itself is a normal Cargo release build:

bash
cargo build --release

There is also a Nix path, nix develop followed by cargo build --release, with a .#cuda variant that pairs with a --features kokoros/cuda build for NVIDIA hardware. And a Dockerfile that does the same thing in two stages, building on rust:1.88.0-slim-trixie and running on debian:sid-slim, exposing port 3000 with the koko binary as the entrypoint. The install.sh script is optional and copies the koko binary to /usr/local/bin and the voice data to $HOME/.cache/kokoros/.

Two modes, text and file, with per-line output naming

The command line has two main modes and the file mode is the one that shows the design. For a single string, you pass text and the audio lands in tmp/output.wav by default:

bash
mkdir -p tmp
./target/release/koko text "Hello, this is a TTS test"

The destination is changeable with --output or the short -o form. For a file, the koko file mode synthesizes each line separately, and for a three line file you get tmp/output_0.wav, tmp/output_1.wav and tmp/output_2.wav. The naming pattern is templated, so -o song/lyric_{line}.wav writes one file per line with the line number substituted:

bash
./target/release/koko file lyrics.txt -o "song/lyric_{line}.wav"

That per-line behaviour is the practical reason to prefer file mode over one big string. A model that produces one continuous waveform cannot be split back into sentences later without cutting mid-word, so synthesizing line by line gives you addressable segments for free. If you are building something that plays a lyric or a narration track and needs to line up with something else, that difference is the whole feature. The help output is available with ./target/release/koko -h.

Word-level timestamps arrive as a TSV sidecar

A --timestamps flag produces a .tsv file with per-word timings alongside the WAV, and the file has three columns, word, start_sec and end_sec. The sidecar path is derived automatically by replacing the .wav extension with .tsv, and the sample rate is 24 kHz by default with times in seconds to three decimal places. In text mode:

bash
./target/release/koko text \
  --output tmp/output.wav \
  --timestamps \
  "Hello from the timestamped model"

which creates tmp/output.wav and tmp/output.tsv, and in file mode each line N produces tmp/line_N.wav and tmp/line_N.tsv. The README also gives a copy-paste path that skips the shell scripts entirely, using the timestamped Kokoro ONNX model hosted on Hugging Face with a curl command that writes it to checkpoints/kokoro-v1.0.onnx and a second curl for the voices file into data/voices-v1.0.bin. The CLI uses the files directly if they already exist in those directories, and the unified voices-v1.0.bin is compatible with the timestamped model. For a captioning or karaoke-style application, these timings are the feature that makes lip sync or highlighting possible without a separate alignment pass.

An OpenAI-compatible server for streaming audio

The server layer speaks the OpenAI API shape, which means an existing client can talk to it without modification. The update entry for 2025.07.12 describes an HTTP API with streaming and parallel processing infrastructure, where the OpenAI-compatible server supports streaming audio generation with a "stream": true parameter, reaching one to two seconds of time to first audio. There is a work-in-progress parallel TTS processing mode behind an --instances flag, an improved logging system with Unix timestamps, and natural-sounding voice generation through advanced chunking. The earlier entries show the trajectory. On 2025.01.15 the OpenAI compatible server was added with the format still under polish, and the same day a phonemizer was added so that Kokoros could infer end to end without other dependencies, following the Espeak-ng tokenizer and phonemizer support on 2025.01.13. Style mixing came on 2025.01.17, where you can pick a style combination such as af_sky.4+af_nicole.5 to hear a different effect, and CLI streaming mode with --stream arrived on 2025.01.22. Language support is narrower than the feature set, though: English is listed as complete, while Chinese, Japanese and German are all marked as partly supported.

The repository points at its own successor

The README opens with links to issues for Zonos Rust, Spark-TTS and Orpheus-TTS, all marked as on the way, and then states that there is now a cleaner and faster Kokoro model in a separate repository, Crane, with more TTS and ASR model support in it. That is the most important line in the document for an adopter, because it tells you where the maintainer's attention has moved. Kokoros is a working, popular implementation that was announced in January 2025 with an ASMR demo clip and a digital human demo, and it has a Discord community for people interested in Rust Kokoro. The repository is not archived and the last push was on 2026-10-05, so it is still being touched. But the licence is Apache-2.0, which is permissive, and the model file itself comes from Hugging Face under its own terms, so a project that starts from the Kokoro model today is arguably better served by the successor that the author recommends. The choice is not urgent, but it is a decision to make deliberately rather than by default.

No releases, so the build is the version

The repository has no GitHub releases, which means there is no tag to pin a dependency to and no versioned artefact to download. The Cargo workspace uses resolver 2 with the three members listed earlier, and the crate names carry the kokoros spelling while the command is koko and the repository is Kokoros, which is a small consistency wrinkle to keep in mind when you search for it. The build metadata is in a Dockerfile that pins rust:1.88.0-slim-trixie as the builder and debian:sid-slim as the runner, and the runner installs pkg-config, libssl-dev, libsonic-dev and libpcaudio-dev alongside the binary, with the data and checkpoints directories copied in from the build stage. Note that the runner image is Debian sid, a rolling distribution, so the container is not byte-for-byte reproducible across time even though the Rust toolchain is pinned. The repository also carries a flake.nix and flake.lock for the Nix path, and a Dockerfile that runs download_all.sh during the build, which means a container build performs network downloads as part of the image build rather than at runtime.

Editorial conclusion

Adopt Kokoros if you want speech synthesis you can call from a shell script or an OpenAI-compatible endpoint without running Python, and you are willing to download the model and voice files yourself. Do not adopt it if you need broad language coverage today, because only English is listed as fully supported while Chinese, Japanese and German are partial, and do not expect the multi-model support that the successor project, Crane, advertises. Before you commit, run the koko text command once on your own machine to hear the voice quality, check that the model and voice files download to the checkpoints/ and data/ paths the CLI expects, and note that the repository has no GitHub releases to pin.

Frequently asked questions

What is Kokoros?

It is an Apache-2.0 licensed Rust port of the Kokoro TTS model, published on Hugging Face as Kokoro-82M. The workspace has three members: the koko command line binary, the kokoros crate for embedding synthesis, and kokoros-openai for the server.

How do I build Kokoros and get the model?

Install the system dependencies first, pkg-config and opus on macOS or pkg-config and libopus-dev on Linux, then run bash download_all.sh to fetch checkpoints/kokoro-v1.0.onnx and data/voices-v1.0.bin, then build with cargo build --release.

Does Kokoros support word-level timestamps?

Yes. Adding --timestamps produces a TSV sidecar next to each WAV with three columns, word, start_sec and end_sec. The sample rate is 24 kHz by default and times are in seconds with three decimal places.

Which languages does Kokoros support?

English is listed as supported, while Chinese, Japanese and German are each marked as partly supported. The README also notes that there is now a newer Kokoro model in the separate Crane repository with more TTS and ASR model support.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. lucasjinreal/Kokoros on GitHub
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/lucasjinreal-kokoros.svg)](https://hysenlabs.com/projects/lucasjinreal-kokoros)