Skip to main content

Text-to-speech model

Kokoro TTS, self-hosted: one cheap card, 4GB of VRAM, dozens of times realtime

Kokoro-82M is the smallest front-line open TTS model there is: 82 million parameters, Apache 2.0 weights, 24kHz output, 54 voices across 9 language codes. It does not need an A100. It needs a cheap card you can switch off.

Kokoro comes from hexgrad (@rzvzn on Discord), built on StyleTTS 2 and ISTFTNet with a decoder-only release and no diffusion stage. The mainline v1.0 weights were frozen in January 2025 with SHA256 prefix 496dba11, and the pip package settled at 0.9.4 — this is not a project that changes its calling convention every two weeks. The whole v1.0 run burned roughly 500 A100 80GB GPU-hours on a few hundred hours of public-domain audio, Apache/MIT-licensed audio, and synthetic data from closed commercial TTS engines. That provenance is exactly why the weights can ship under Apache 2.0.

82 million parameters means 326MB of fp32 weights, and 86MB once quantized to ONNX q8f16. In practice, counting PyTorch and the CUDA context, a single instance sits between 2.37GB and 3.98GB of VRAM — that range is measured, not estimated: Kokoro-FastAPI reports it while narrating the full text of The Time Machine on a 4060Ti 16GB. So one 24GB card can hold Kokoro, a Whisper ASR worker and a 7B chat model at the same time, which is wishful thinking with XTTS or F5-TTS. On the same 4060Ti the realtime factor lands between 35x and 100x, streaming first-token latency around 300ms, throughput around 138 tokens/s.

Now the costs. Kokoro does not clone voices: a voice is one of 54 pretrained style vectors, each a 523KB .pt file that is exactly a 510×256 fp32 lookup table. You can blend them by weight, but with no encoder weights released you cannot mint a new speaker from thirty seconds of audio. Language is the other hard edge — American and British English, Spanish, French, Hindi, Italian, Japanese, Brazilian Portuguese and Mandarin, and that is the list. German, Russian, Turkish and Vietnamese requests have been open in the repo for over a year; the busiest German thread has 77 comments and still no weights. Accept those two limits and the rest is just picking a cheap enough GPU.

01 —

What you can actually download today

One mainline branch, four deployment shapes, and nearly a 4x spread in file size across quantizations

VersionParametersVRAMContextNotes
hexgrad/Kokoro-82M v1.082M326MB fp32 weights / 2.4–4.0GB resident per instance510 phoneme tokens per segmentThe mainline weights, unchanged since January 2025. 54 voices, 9 language codes (a/b/e/f/h/i/j/p/z), fixed 24kHz mono output. Start here; there is no reason to detour.
hexgrad/Kokoro-82M-v1.1-zh82MIdentical to v1.0 — no difference in footprint510 phoneme tokens per segmentThe Mandarin-focused branch. LongMaoData donated 100 hours of professional Chinese recordings and it took only 120 A100 GPU-hours to train. Around 103 voices, but it drops many of v1.0's English voices — the card itself says it is "not a strict upgrade". Worth it for pure Chinese narration.
onnx-community/Kokoro-82M-v1.0-ONNX82Mfp16 163MB / int8 92.4MB / q8f16 86MB510 phoneme tokens per segmentThe community ONNX export, shipping eight precisions side by side: fp32 326MB, q4f16 155MB, uint8 177MB, uint8f16 114MB. This is the path for CPU inference, browser WASM and edge boxes. Note the DirectML execution provider still has open errors.
kokoro-onnx (thewh1teagle)82Mkokoro-v1.0.onnx ~300MB + voices-v1.0.bin510 phoneme tokens per segmentAn MIT-licensed minimal Python wrapper: two files and you are running, near realtime on Apple Silicon. The easiest option when you do not want the whole torch stack inside a container.
Kokoro v0.19 / hexgrad/kLegacy82MSame architecture, no separate optimization510 phoneme tokens per segmentThe pre-misaki G2P generation, archived in the kLegacy repo. Voice names and the calling interface are both incompatible with v1.0 — only touch it to keep a legacy project alive.

02 —

Which card to rent

VRAM was never Kokoro's bottleneck — first-token latency and concurrency are

  • Keeping an OpenAI-compatible TTS endpoint online

    RTX 3090 24GB$0.193/GPU-hour

    One instance tops out around 4GB, so 24GB lets you run six or seven workers side by side, or bolt a Whisper ASR onto the same card.

  • Realtime conversational streaming where first-token latency rules

    RTX 4090 24GB$0.540/GPU-hour

    Single-stream latency on a small model tracks clock speed and memory bandwidth, not tensor throughput; first token stays in the 300ms range at 400-character chunks.

  • Batch offline synthesis for audiobooks, podcasts and courseware

    Tesla T4 16GB$0.298/GPU-hour

    Batch jobs do not care about latency, and 16GB is luxurious for an 82M model. Per-second billing means a whole book costs pennies and the meter stops when you do.

  • Reproducing the official training run or attempting a finetune

    A100 PCIE 80GB$0.824/GPU-hour

    v1.1-zh took 120 A100 80GB hours and v1.0 about 500 — one of the very few TTS training budgets you can price out before you start.

03 —

Four steps to running

The espeak-ng step is where nine out of ten people get stuck — install it first

  1. 01

    Boot an RTX 3090 and confirm CUDA is live

    Pick a PyTorch prebuilt image in the console and connect over SSH, Jupyter or the web terminal. Kokoro is not fussy about the torch version, but Python must be 3.10 to 3.12 — the kokoro package pins requires-python to >=3.10,<3.13, and a 3.13 environment simply will not resolve.

    python -c "import sys, torch; print(sys.version, torch.__version__, torch.cuda.is_available())"
  2. 02

    Install espeak-ng, then kokoro

    misaki handles grapheme-to-phoneme conversion and falls back to espeak-ng for out-of-vocabulary words, so this is a hard system dependency, not an optional extra — without it the pipeline errors on startup. Mandarin additionally needs misaki[zh] (pypinyin + jieba); Japanese needs misaki[ja]. On Windows you also have to install the .msi and set PHONEMIZER_ESPEAK_LIBRARY, which is a good argument for just renting a Linux box.

    apt-get update && apt-get install -y espeak-ng && pip install "kokoro>=0.9.4" "misaki[zh]" soundfile
  3. 03

    Synthesize your first clip

    KPipeline picks its G2P backend from lang_code, and the voice must match: language code z takes a zf_/zm_ voice, and mixing them yields audio that is intelligible but strangely accented. The call returns a generator that yields graphemes, phonemes and a 24kHz waveform per segment. To use the Mandarin branch instead, pass repo_id='hexgrad/Kokoro-82M-v1.1-zh' to the constructor.

    python -c "from kokoro import KPipeline; import soundfile as sf; p=KPipeline(lang_code='a'); [sf.write(f'out{i}.wav', a, 24000) for i,(g,ps,a) in enumerate(p('Self-hosting a speech model is cheaper than you think.', voice='af_heart'))]"
  4. 04

    Wrap it in HTTP and point your existing code at it

    Kokoro-FastAPI exposes it as OpenAI's /v1/audio/speech, so an existing SDK just needs a new base_url. It also adds /v1/audio/voices/combine for weighted voice blending with syntax like af_bella(2)+af_sky(1). The default image is CUDA 12.6; if you booted an RTX 5090, switch to the latest-cu128 tag. Text normalization occasionally swallows phrases — send normalization_options.normalize=false when it does.

    docker run --gpus all -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-gpu:latest

What an audiobook actually costs

Take the measured 35–100x realtime factor from Kokoro-FastAPI on a 4060Ti and be conservative at 30x: a 10-hour audiobook needs 10 ÷ 30 = 0.34 GPU-hours of synthesis. On an RTX 3090 24GB at $0.193/GPU-hour that is 0.34 × 0.193 ≈ $0.066. Add five minutes for pulling the image and downloading the 327MB weights (0.08 GPU-hours ≈ $0.016) and the whole job comes to under $0.09. For an always-on service: a 3090 running flat out for a month is 24 × 30 × 0.193 = $138.96, and since billing is metered per second, shutting down overnight zeroes the compute line immediately — only storage keeps ticking at $0.414/GB-month, and Kokoro's weights plus every voice file come to under 400MB, roughly $0.17 a month. Even reproducing the training is priceable: v1.1-zh's 120 A100 hours on an A100 PCIE 80GB at $0.824/GPU-hour is 120 × 0.824 = $98.88, and v1.0's ~500 hours is 500 × 0.824 = $412. No setup fee, no minimum, no quota request.

04 —

FAQ

How much VRAM does Kokoro TTS actually need to self-host?

On the PyTorch path a single instance holds 2.37GB to 3.98GB resident, hitting the top of that range during sustained long-form synthesis. The weights themselves are only 326MB in fp32 — the rest is CUDA context and activations. An 8GB card is more than enough; a 16GB card runs several workers in parallel. On NexGPU the sweet spot is an RTX 3090 24GB at $0.193/GPU-hour, metered per second, so you can test and stop.

Can Kokoro clone a voice from a short recording the way GPT-SoVITS does?

No. Only the decoder was released; the encoder weights were not. Voices are 54 pretrained style vectors, each a 523KB .pt file that is exactly a 510×256 fp32 tensor. You can blend two of them by weight to get a new timbre, but minting a genuinely new speaker requires retraining. If you want to go down that road, an A100 PCIE 80GB at $0.824/GPU-hour billed per second is far more realistic than buying hardware.

Does Kokoro support German or Russian, and how good is its Mandarin?

German, Russian, Turkish and Vietnamese have no official weights, and the German request thread has accumulated 77 comments without producing any. Mandarin has two routes: v1.0 ships 8 Chinese voices (zf_xiaobei, zf_xiaoxiao, zf_xiaoni, zm_yunxi and friends) and phonemizes through misaki[zh] with pypinyin; for better quality switch to Kokoro-82M-v1.1-zh, trained on 100 hours of professional Chinese recordings. Both have identical VRAM footprints, so spin up one NexGPU card and A/B them for the price of a coffee — several orders of magnitude less, actually.

Why does my long text get truncated or mispronounced?

Kokoro enforces a hard 510-token limit on the phoneme sequence per segment; go over it and you get "Phoneme string too long" followed by truncation. That number is not arbitrary — the voice vector itself is a 510-row lookup table, so there is nothing to index past it. KPipeline splits on newlines by default (split_pattern=r'\n+') and, for English, does a waterfall fallback across .!?…:;,— to break at punctuation; other languages chunk at roughly 400 characters. Segment your text yourself; do not expect it to swallow a whole book. Once segmented, the batch run is just a Tesla T4 16GB at $0.298/GPU-hour on NexGPU.

Is there any point renting an H100 for Kokoro?

None, and it is pure waste. An 82M-parameter model on an H100 SXM 80GB ($3.582/GPU-hour) will not be ten times faster than an RTX 4090 ($0.540/GPU-hour) — the bottleneck is G2P, Python scheduling and sequential per-segment generation, not tensor math, and Kokoro has no native batching anyway. The right move is cheap cards, scaled horizontally. NexGPU runs up to 14 GPUs per node across 2,498 GPUs on 1,175 verified rentable nodes in 51 countries and regions, which makes scaling out far cheaper than scaling up.

How long from booting a NexGPU instance to hearing the first clip?

Pick a PyTorch prebuilt image (there are 2,000+, including vLLM, ComfyUI and Whisper ASR), apt install espeak-ng, pip install kokoro, and the first call pulls 327MB of weights from Hugging Face — under five minutes in normal conditions. For an even shorter path, docker run the Kokoro-FastAPI GPU image and port 8880 comes up as an OpenAI-compatible endpoint. SSH, Jupyter, web terminal, REST API and CLI are all open, there is no quota request and no setup fee, and support answers in English or Chinese over Telegram with no ticket queue.

Start building on NexGPU

Enterprise R&D team or solo developer — either way, your first job can be running in minutes.

Sign up to browse live network pricing. No payment method required.