What do you want to do?
3 use cases
-
Turn a script into WAV files in a few lines
Run a KPipeline with the af_heart voice and save each generated chunk as audio.
View prompt
Using hexgrad/kokoro, install it with pip and espeak-ng, then write a script that reads <my text file> with KPipeline(lang_code='a') and voice af_heart and saves numbered WAV files.
-
Generate speech in Spanish, French, Hindi or Japanese
Switch the pipeline's lang_code to voice text in other supported languages.
View prompt
With hexgrad/kokoro, generate <my paragraph> in Spanish and French using KPipeline with lang_code e and f, and save each language to its own WAV.
-
Speed up Kokoro on an Apple Silicon Mac
Enable MPS fallback so Kokoro uses the Mac GPU.
View prompt
Using hexgrad/kokoro on my Mac, set up a script and run it with `PYTORCH_ENABLE_MPS_FALLBACK=1 python run-your-kokoro-script.py`, then compare timing with and without the variable.
Quick start with Kokoro
- Check you have what it needs: Python with pip (the README conda file uses Python 3.9); espeak-ng installed for fallback and some languages; Optional: an Apple Silicon Mac for MPS acceleration.
- Open hexgrad/kokoro on GitHub and read the README and license.
- Install with
!pip install -q kokoro>=0.9.4 soundfilein Colab, or the same pip install locally - Install espeak-ng with
!apt-get -qq -y install espeak-ng > /dev/null 2>&1on Colab or Debian - Create KPipeline(lang_code='a') and call it with your text and voice='af_heart'
- Write each audio chunk with sf.write at 24000
These steps come from our top use case, Turn a script into WAV files in a few lines, which also has a copy-paste agent prompt.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for hexgrad/kokoro
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeAbout this repo
- Who it is forDevelopers and creators who want fast, lightweight, open TTS they can run themselves.
- Why it is hot9.8k stars, talked about in 2 AI sources we track
- LanguageJavaScript
- Sourcegithub.com/hexgrad/kokoro ยท Back to Hot repos
Requirements
- Python with pip (the README conda file uses Python 3.9)
- espeak-ng installed for fallback and some languages
- Optional: an Apple Silicon Mac for MPS acceleration
Add this badge to your README
Maintain Kokoro? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/hexgrad-kokoro/?utm_source=github&utm_medium=badge&utm_campaign=hexgrad-kokoro)
HTML
<a href="https://dedupedai.com/use-cases/hexgrad-kokoro/?utm_source=github&utm_medium=badge&utm_campaign=hexgrad-kokoro"><img src="https://dedupedai.com/badge/hexgrad/kokoro.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about Kokoro
What is Kokoro?
kokoro is the inference library for Kokoro-82M, an open-weight text-to-speech model with 82 million parameters that rivals larger models while being faster and cheaper to run. A KPipeline turns text into 24 kHz audio with voices like af_heart, and supports American and British English, Spanish, French, Hindi, Italian, Japanese, Brazilian Portuguese and Mandarin. It is an open-source project on GitHub: https://github.com/hexgrad/kokoro.
How do I use Kokoro?
Install with !pip install -q kokoro>=0.9.4 soundfile in Colab, or the same pip install locally; then install espeak-ng with !apt-get -qq -y install espeak-ng > /dev/null 2>&1 on Colab or Debian; create KPipeline(lang_code='a') and call it with your text and voice='af_heart'. The use cases on this page give the full steps and a copy-paste agent prompt for each job.
Who is Kokoro for?
Developers and creators who want fast, lightweight, open TTS they can run themselves.
What can I do with Kokoro?
3 use cases so far, for example: Turn a script into WAV files in a few lines; Generate speech in Spanish, French, Hindi or Japanese; Speed up Kokoro on an Apple Silicon Mac. Each has steps and a copy-paste agent prompt.
What do I need to run Kokoro?
Python with pip (the README conda file uses Python 3.9); espeak-ng installed for fallback and some languages; Optional: an Apple Silicon Mac for MPS acceleration.
What are alternatives to Kokoro?
Other hot AI repos in Content: Voice Studio, Impeccable, Chatterbox, F5 TTS, Whisper CPP.
Is Kokoro safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.