> For the complete documentation index, see [llms.txt](https://docs.vntranslator.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vntranslator.com/features/extensions/text-to-speech/kokoro-tts.md).

# Kokoro TTS

{% hint style="info" %}
**Kokoro TTS** is an offline TTS engine based on the [Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M) model. It supports multiple languages including English, Japanese, and Chinese, and runs on CPU without requiring a GPU.
{% endhint %}

### Installation

There are two ways to install Kokoro TTS: using **UV** (recommended) or **PIP**.

<details>

<summary><strong>Install via UV (Recommended)</strong></summary>

UV is a fast Python package manager that handles all dependencies automatically in an isolated environment.

**Step 1 - Install UV**

Open **PowerShell** and run the following command:

```powershell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```

For alternative installation methods, refer to the [UV Installation Guide](https://docs.astral.sh/uv/getting-started/installation/).

**Step 2 - Verify the Installation**

After the installation is complete, restart PowerShell and verify that UV is installed correctly by running:

```powershell
uv --version
```

You should see the installed UV version printed in the terminal.

**Step 3 - Clone or Download the Repository**

**Clone via Git&#x20;*****(recommended)***

If you have [Git](https://git-scm.com/downloads) installed, open PowerShell and run:

```powershell
git clone https://github.com/remsky/Kokoro-FastAPI.git
cd Kokoro-FastAPI
```

**Download as ZIP**

If you do not have Git installed, you can download the repository manually:

1. Go to <https://github.com/remsky/Kokoro-FastAPI>
2. Click the **Code** button, then select **Download ZIP**
3. Extract the downloaded ZIP file to a folder of your choice
4. Open PowerShell, navigate to the extracted folder:

```powershell
cd path\to\Kokoro-FastAPI
```

**Step 4 - Run Kokoro TTS**

Start the Kokoro TTS server using the provided startup script for CPU:

```powershell
.\start-cpu.ps1
```

UV will automatically install all required dependencies on the first run.

</details>

<details>

<summary><strong>Install via PIP</strong></summary>

If you prefer to install Kokoro TTS manually using PIP, follow these steps.

**Step 1 - Clone or Download the Repository**

**Clone via Git&#x20;*****(recommended)***

```powershell
git clone https://github.com/remsky/Kokoro-FastAPI.git
cd Kokoro-FastAPI
```

**Download as ZIP**

If you do not have Git installed, you can download the repository manually:

1. Go to <https://github.com/remsky/Kokoro-FastAPI>
2. Click the **Code** button, then select **Download ZIP**
3. Extract the downloaded ZIP file to a folder of your choice
4. Open PowerShell, navigate to the extracted folder:

```powershell
cd path\to\Kokoro-FastAPI
```

**Step 2 - Install Dependencies**

Install the required Python packages using PIP:

```powershell
pip install -r requirements.txt
```

**Step 3 - Run Kokoro TTS**

Once the dependencies are installed, start the Kokoro TTS server:

```powershell
python -m uvicorn api.src.main:app --host 0.0.0.0 --port 8880
```

</details>

***

### Running the Kokoro TTS Server

Once the server is running, you can access the web interface at:

```
http://localhost:8880/web
```

The API documentation is also available at:

```
http://localhost:8880/docs
```

***

### Integrating with VNTranslator

After the Kokoro TTS server is running, follow these steps to connect it with VNTranslator:

* Go to **Settings -> Extensions -> Text to Speech**
* Scroll to the **Kokoro TTS** settings section
* Enter the **Host** and **Port** of your running Kokoro TTS server. By default, these are already set to:
  * **Host:** `http://localhost`
  * **Port:** `8880`

{% hint style="warning" %}
Make sure the Kokoro TTS server is running **before** launching a game in VNTranslator. If the server is not running, TTS playback will not work.
{% endhint %}

***

### References

* [Kokoro FastAPI GitHub Repository](https://github.com/remsky/Kokoro-FastAPI)
* [Kokoro-82M Model on Hugging Face](https://huggingface.co/hexgrad/Kokoro-82M)
* [UV Installation Guide](https://docs.astral.sh/uv/getting-started/installation/)
