self-hosted/ai
§01·recipe · tts

Kokoro TTS on RTX 4060 Ti 16GB: 82M-Parameter Text-to-Speech, 54 Voices, Under 3 GB VRAM

ttsbeginner2GB+ VRAMMay 21, 2026
models
tools
prerequisites
  • NVIDIA GPU with ≥ 2 GB VRAM (RTX 4060 Ti 16GB has 13+ GB of spare headroom)
  • Python 3.10+
  • espeak-ng installed at the OS level

What You'll Build

A local text-to-speech pipeline using hexgrad/Kokoro-82M — an 82-million-parameter Apache-2.0 TTS model that emits 24 kHz audio across 9 languages and 54 voices (counted from the canonical VOICES.md). Kokoro is wildly over-provisioned for a 16 GB RTX 4060 Ti — it needs only 2–3 GB total during inference, leaving 13+ GB free for a second model on the same card.

Hardware data: RTX 4060 Ti 16GB (16 GB VRAM) · weights fit under 1 GB at FP16; total inference footprint typically 2–3 GB · See benchmark data

Sizing note: Kokoro is borderline hardware-agnostic — it runs comfortably on a single RTX 3060 or even on CPU. The 16 GB 4060 Ti is wildly over-provisioned for this model on its own; the legitimate angle for this GPU is to colocate Kokoro with a heavier image-gen, video, or LLM workload on the same card. The steps below apply unchanged to any modern NVIDIA GPU with ≥ 2 GB VRAM.

Requirements

ComponentMinimumTested
GPU2 GB VRAM (per Clore.ai guide)RTX 4060 Ti 16GB (16 GB)
RAM8 GB
Storage~1 GB (weights ~200 MB; rest is the Python wheel + misaki G2P data)
SoftwarePython 3.9+ (per Clore.ai), PyTorch with CUDA, espeak-ng

Installation

1. Install espeak-ng at the OS level

The misaki G2P (grapheme-to-phoneme) library underneath Kokoro shells out to espeak-ng. Install it the system way for your OS — the Linux apt-get line is taken from the official GitHub README; the macOS Homebrew and Windows installer lines are the canonical equivalents that the README's PYTORCH_ENABLE_MPS_FALLBACK note assumes you've already run:

# Linux (Debian / Ubuntu)
sudo apt-get install -y espeak-ng

# macOS (Apple Silicon also needs the MPS fallback env var)
brew install espeak-ng
export PYTORCH_ENABLE_MPS_FALLBACK=1

# Windows — download and run the .msi from
# https://github.com/espeak-ng/espeak-ng/releases

2. Install the Python package

The kokoro PyPI package pulls in misaki, the model loader, and the inference loop. From the Hugging Face model card:

pip install "kokoro>=0.9.4" soundfile

Optional non-English language packs (only install what you need):

pip install "misaki[ja]"   # Japanese
pip install "misaki[zh]"   # Mandarin Chinese

3. (Optional) Pre-download the weights

The first call to KPipeline downloads ~200 MB of weights to your Hugging Face cache. Pre-fetch them if you want to control where they land:

from huggingface_hub import snapshot_download
snapshot_download("hexgrad/Kokoro-82M")

Running

The minimal Python example, verbatim from the Hugging Face model card:

from kokoro import KPipeline
import soundfile as sf

pipeline = KPipeline(lang_code='a')  # 'a' = American English

text = "Kokoro is an open-weight 82-million-parameter text-to-speech model."
generator = pipeline(text, voice='af_heart')

for i, (gs, ps, audio) in enumerate(generator):
    sf.write(f'{i}.wav', audio, 24000)

Note the 24000 sample rate — Kokoro emits 24 kHz audio. gs and ps are the graphemes and phonemes for the chunk, useful for debugging pronunciation.

Language codes

From the official GitHub README, lang_code is a single letter:

CodeLanguage
aAmerican English
bBritish English
eSpanish
fFrench
hHindi
iItalian
jJapanese (requires misaki[ja])
pBrazilian Portuguese
zMandarin Chinese (requires misaki[zh])

The voice ID (af_heart above) selects one of the 54 voices — see the VOICES.md catalogue for the full list. The prefix encodes language + gender (e.g. af_ = American female).

Server-style deployment (optional)

If you'd rather expose an OpenAI-compatible HTTP API instead of writing Python, the community-maintained Kokoro-FastAPI wrapper is the most-cited path, per ThinkSmart.Life's local-rig writeup:

git clone https://github.com/remsky/Kokoro-FastAPI.git
cd Kokoro-FastAPI/docker/gpu
docker compose up --build

The repo also ships a top-level start-gpu.sh helper that wraps the same compose invocation.

Colocating with a second model (the real use case)

A 4060 Ti 16GB running Kokoro alone has 13+ GB of unused VRAM. The practical setup is to keep Kokoro resident on one CUDA context and load a second model alongside it — e.g. a 7B-class LLM at Q4_K_M (~4–5 GB) for the chat side, or an image-gen model (FLUX/SDXL/Qwen-Image GGUF) that fits in ≤ 12 GB. Kokoro's own footprint stays at the 2–3 GB the Spheron guide reports — it's the other model that defines whether the pair fits 16 GB.

Results

  • Speed: No first-party speed numbers exist for the RTX 4060 Ti 16GB yet. For reference, an independent PyTorch/ONNX benchmark gist reports 96× real-time on an AWS g5.xlarge instance (NVIDIA A10G, 24 GB Ampere) with PyTorch CUDA, using the benchmark script's default voice configuration on a ~3,000-word English input. The Spheron deployment guide summarises community RTX 4090 measurements at "RTF ~0.04–0.06" (i.e. 1 s of audio in 40–60 ms). The 4060 Ti is in the same consumer-GPU class — expect comfortably faster-than-realtime performance, but track /check/kokoro-tts/rtx-4060-ti-16gb for empirical 4060 Ti 16GB numbers as they land.
  • VRAM usage: Weights are under 1 GB at FP16; total GPU memory during inference (including CUDA kernels and buffers) is 2–3 GB, per the Spheron deployment guide. The Clore.ai guide lists 2 GB as the minimum and 4 GB as the recommended VRAM, with an RTX 3060 as their recommended card — leaves the 4060 Ti 16GB with 13+ GB of spare headroom for a second resident model.
  • Quality notes: 24 kHz output, 54 voices, 9 languages, Apache-2.0 license. Input is hard-capped at 510 tokens per generation call (per the gist benchmark) — long text gets chunked automatically by the pipeline iterator.

For the full benchmark data, see /check/kokoro-tts/rtx-4060-ti-16gb.

Troubleshooting

RuntimeError: espeak-ng not found on first synthesis call

The Python kokoro package wraps misaki, which in turn calls espeak-ng for phonemisation. The PyPI install does not bundle the binary — you must install it through your OS package manager (apt-get install espeak-ng / brew install espeak-ng / Windows .msi) as covered in step 1. Per the official GitHub README.

Non-English voice errors

Japanese (lang_code='j') and Mandarin (lang_code='z') require the optional misaki language packs — pip install "misaki[ja]" or pip install "misaki[zh]". Without them you'll see a missing-dependency traceback at pipeline init. Source: Hugging Face model card.

Silent / empty audio output on Windows

Some non-English voices have been reported to return silence on Windows in the upstream GitHub issue tracker (e.g. Spanish em_alex on Windows 11). If you hit this, verify your espeak-ng install can phonemise the language on its own (espeak-ng -v es "hola" should produce phonemes), then file a fresh issue on the repo if the wrapper still fails.

Pip install fails with misaki[en]>=X.Y.Z has no matching distribution

Reported in the upstream issue tracker — pin kokoro to a version whose declared misaki dependency is actually published on PyPI (the latest tagged release on the GitHub repo is the safe bet). Avoid installing from main if the bumped misaki requirement hasn't shipped yet.