HA-Apps

Kokoro-FastAPI for Home Assistant

Kokoro-FastAPI web UI with text ready to speak

Kokoro-FastAPI by remsky is a text-to-speech server for the Kokoro-82M voice model.

This app runs it locally on your Home Assistant host, so spoken replies never leave your network. It is a wrapper around the work the Kokoro-FastAPI folks did. Use it with the Kokoro TTS HACS integration to give Assist and your automations a natural voice.

Highlights

Requirements

This app runs Kokoro on the CPU, so it needs a fast host. To speak a reply without interruptions, the CPU has to generate audio faster than it plays. If it can’t, you hear pauses in long replies, even in the middle of words.

CPU Generation speed Long replies
Intel Core i3-7100U (2 cores) About 0.9x real time Pauses
AMD Ryzen 7 PRO 6860Z (8 cores) About 3x real time Smooth

On slower hosts, you can run Kokoro-FastAPI on a faster machine in your network and point the Kokoro TTS integration to it, or use a lighter voice engine such as Piper.

Installation

  1. If not already done in HA, add this repository (https://github.com/YaannnTech/HA-Apps) to Settings → Apps → Install Apps → ⋮ → Repositories → Add, or simply press this button:
    Add Repository
  2. Install Kokoro-FastAPI.
  3. Start the app and wait for the model to finish loading.
  4. Add and configure the Kokoro TTS HACS integration.

Click Open Web UI, or open http://HOME_ASSISTANT_IP:8880/web/ to try voices in the Kokoro-FastAPI web UI.

Settings

All settings are on the app’s Configuration tab:

Setting What it does
API Log Level How much detail Kokoro writes to the app log: Debug, Info, Warning or Error. Only Debug logs every HTTP request, including Home Assistant’s health checks every few seconds.
Default Voice Default Kokoro voice identifier. Use Open Web UI to browse and preview voices.
Enable Web UI Serves Kokoro’s web UI at http://HOME_ASSISTANT_IP:8880/web/.
Support SSML Enables Speech Synthesis Markup Language, including pauses and other supported speech controls.