SAVRN
Search Contact SAVRN

Open-weight model · Text to speech

Kokoro-82M-ONNX

by ONNX Community onnx-community/Kokoro-82M-ONNX

Kokoro is a frontier TTS model for its size of 82 million parameters (text in/audio out).

Parameters
Context
Weights1.4 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads54k

Model Card

By ONNX Community, published under apache-2.0, revision f46687f7e415.

Kokoro is a frontier TTS model for its size of 82 million parameters (text in/audio out). First, install the kokoro-js library from NPM using: You can then generate speech as follows: Optionally, save the audio to a file: The model is resilient to quantization, enabling efficient high-quality speech synthesis at a fraction of the original model size.

Read ONNX Community's full model card

Kokoro TTS

Kokoro is a frontier TTS model for its size of 82 million parameters (text in/audio out).

Table of contents

  • Samples
  • Usage
  • JavaScript
  • Python
  • Quantizations

Samples

Life is like a box of chocolates. You never know what you're gonna get.

Voice Nationality Gender Sample
Default (af) American Female
Bella (af_bella) American Female
Nicole (af_nicole) American Female
Sarah (af_sarah) American Female
Sky (af_sky) American Female
Adam (am_adam) American Male
Michael (am_michael) American Male
Emma (bf_emma) British Female
Isabella (bf_isabella) British Female
George (bm_george) British Male
Lewis (bm_lewis) British Male

Usage

JavaScript

First, install the kokoro-js library from NPM using:

npm i kokoro-js

You can then generate speech as follows:

import { KokoroTTS } from "kokoro-js";

const model_id = "onnx-community/Kokoro-82M-ONNX";
const tts = await KokoroTTS.from_pretrained(model_id, {
  dtype: "q8", // Options: "fp32", "fp16", "q8", "q4", "q4f16"
});

const text = "Life is like a box of chocolates. You never know what you're gonna get.";
const audio = await tts.generate(text, {
  // Use `tts.list_voices()` to list all available voices
  voice: "af_bella",
});
audio.save("audio.wav");

Python

import os
import numpy as np
from onnxruntime import InferenceSession

# Tokens produced by phonemize() and tokenize() in kokoro.py
tokens = [50, 157, 43, 135, 16, 53, 135, 46, 16, 43, 102, 16, 56, 156, 57, 135, 6, 16, 102, 62, 61, 16, 70, 56, 16, 138, 56, 156, 72, 56, 61, 85, 123, 83, 44, 83, 54, 16, 53, 65, 156, 86, 61, 62, 131, 83, 56, 4, 16, 54, 156, 43, 102, 53, 16, 156, 72, 61, 53, 102, 112, 16, 70, 56, 16, 138, 56, 44, 156, 76, 158, 123, 56, 16, 62, 131, 156, 43, 102, 54, 46, 16, 102, 48, 16, 81, 47, 102, 54, 16, 54, 156, 51, 158, 46, 16, 70, 16, 92, 156, 135, 46, 16, 54, 156, 43, 102, 48, 4, 16, 81, 47, 102, 16, 50, 156, 72, 64, 83, 56, 62, 16, 156, 51, 158, 64, 83, 56, 16, 44, 157, 102, 56, 16, 44, 156, 76, 158, 123, 56, 4]

# Context length is 512, but leave room for the pad token 0 at the start & end
assert len(tokens) <= 510, len(tokens)

# Style vector based on len(tokens), ref_s has shape (1, 256)
voices = np.fromfile('./voices/af.bin', dtype=np.float32).reshape(-1, 1, 256)
ref_s = voices[len(tokens)]

# Add the pad ids, and reshape tokens, should now have shape (1, <=512)
tokens = [[0, *tokens, 0]]

model_name = 'model.onnx' # Options: model.onnx, model_fp16.onnx, model_quantized.onnx, model_q8f16.onnx, model_uint8.onnx, model_uint8f16.onnx, model_q4.onnx, model_q4f16.onnx
sess = InferenceSession(os.path.join('onnx', model_name))

audio = sess.run(None, dict(
    input_ids=tokens,
    style=ref_s,
    speed=np.ones(1, dtype=np.float32),
))[0]

Optionally, save the audio to a file:

import scipy.io.wavfile as wavfile
wavfile.write('audio.wav', 24000, audio[0])

Quantizations

The model is resilient to quantization, enabling efficient high-quality speech synthesis at a fraction of the original model size.

How could I know? It's an unanswerable question. Like asking an unborn child if they'll lead a good life. They haven't even been born.

Model Size (MB) Sample
model.onnx (fp32) 326
model_fp16.onnx (fp16) 163
model_quantized.onnx (8-bit) 92.4
model_q8f16.onnx (Mixed precision) 86
model_uint8.onnx (8-bit & mixed precision) 177
model_uint8f16.onnx (Mixed precision) 114
model_q4.onnx (4-bit matmul) 305
model_q4f16.onnx (4-bit matmul & fp16 weights) 154

Configuration

Model type
style_text_to_speech_2

Identity and Version

Repository
onnx-community/Kokoro-82M-ONNX
Publisher
ONNX Community
Task
Text to speech
Modality
Audio
Library
transformers.js
Parameters
Not stated by the source
Languages
en
Revision
f46687f7e41512228ae953af24a11b2640ea0f22
First published
2025-01-12
Last updated
2025-02-07

Files and Weights

24 files, 1.4 GB in total. The weights are 19 files totalling 1.4 GB in bin, onnx.

Weights19 files · 1.4 GB
Configuration1 file · 44 B
Tokenizer2 files · 4.7 KB
Documentation1 file · 7.6 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
onnx/model.onnxWeights325.5 MB 53a71ac22a70
onnx/model_fp16.onnxWeights163.2 MB fe5c21346054
onnx/model_q4.onnxWeights304.7 MB d498233bf2d1
onnx/model_q4f16.onnxWeights154.3 MB 9985bdd0e9c3
onnx/model_q8f16.onnxWeights86.0 MB 6e4e74139c6f
onnx/model_quantized.onnxWeights92.4 MB 0d55b15d4b73
onnx/model_uint8.onnxWeights177.5 MB 9748ecc9462b
onnx/model_uint8f16.onnxWeights114.2 MB 071acda679aa
voices/af.binWeights524.3 KB a4f11d9d055a
voices/af_bella.binWeights524.3 KB 38e12d4b9b31
voices/af_nicole.binWeights524.3 KB f27666996f2d
voices/af_sarah.binWeights524.3 KB fe4f8b49c272
voices/af_sky.binWeights524.3 KB f8017c8507ec
voices/am_adam.binWeights524.3 KB 6d5255a4b480
voices/am_michael.binWeights524.3 KB 9c3be118019d
voices/bf_emma.binWeights524.3 KB fd71ce57d2d6
voices/bf_isabella.binWeights524.3 KB d3c6f2737d58
voices/bm_george.binWeights524.3 KB 68736d5397fc
voices/bm_lewis.binWeights524.3 KB 45b693a17544
config.jsonConfiguration44 B
README.mdDocumentation7.6 KB
.gitattributesRepository1.5 KB
tokenizer.jsonTokenizer4.6 KB
tokenizer_config.jsonTokenizer113 B

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
1.4 GB
Download from ONNX Community

Released by ONNX Community through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published1.4 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About Kokoro-82M-ONNX

Can I use Kokoro-82M-ONNX commercially?

Yes. Kokoro-82M-ONNX is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

Model · Text to speech

Kokoro-82M

Hexgrad

Kokoro is an open-weight TTS model with 82 million parameters. Despite its lightweight architecture, it delivers comparable quality to larger models while being significantly faster and more cost-efficient. With Apache-licensed weights, Kokoro can be deployed anywhere from production environments to personal projects. You can run this basic cell on Google Colab. Listen to samples. For more languages and details, see Advanced Usage. Under the hood, kokoro uses misaki, a G2P library at https://github.com/hexgrad/misaki Model SHA256 Hash: 496dba118d1a58f5f3db2efc88dbdc216e0483fc89fe6e47ee1f2c53f18ad1e4 Data: Kokoro was trained exclusively on permissive/non-copyrighted audio data and IPA…

Open weights apache-2.0

Model · Text to speech

XTTS-v2

Coqui.ai

ⓍTTS is a Voice generation model that lets you clone voices into different languages by using just a quick 6-second audio clip. There is no need for an excessive amount of training data that spans countless hours. This is the same or similar model to what powers Coqui Studio and Coqui API. - Supports 17 languages. - Voice cloning with just a 6-second audio clip. - Emotion and style transfer by cloning. - Cross-language voice cloning. - Multi-lingual speech generation. - 24khz sampling rate. - 2 new languages; Hungarian and Korean - Architectural improvements for speaker conditioning. - Enables the use of multiple speaker references and interpolation between speakers. - Stability…

Open weights other coqui

Model · Text to speech

audio.cpp-gguf

Audio.cpp

This directory contains audio.cpp-native GGUF conversions of multiple speech models. These files are intended for use with audio.cpp. If you enjoy the project, please star audio.cpp on GitHub and this Hugging Face repository. For conversion details, supported layouts, direct-file loading, sidecar embedding, and the latest compatibility notes, see the audio.cpp GGUF guide: - https://github.com/0xShug0/audio.cpp/blob/main/docs/gguf.md!!! Converted and quantized packages are checked with automated metrics, but perceived quality can still differ for human listeners. Please validate the exact package, backend, and route to confirm the output is acceptable for your use case. The table lists the…

Open weights other audio.cpp

Model · Text to speech

chatterbox

Resemble AI

Chatterbox Multilingual V3 is the latest general-purpose multilingual TTS model in the Chatterbox family. It keeps the same 0.5B model size while improving speaker similarity, reducing hallucinations, and producing more natural, conversational speech across languages. V3 is designed for broad language coverage like V2, but with stronger stability and more expressive generation. It is the recommended multilingual model for users who want one voice cloning model that works across many languages. Try it in the Chatterbox Multilingual TTS V3 Space. Alongside V3, we are releasing the Single Language Pack: dedicated finetunes for priority languages where tighter quality control, stronger…

Open weights mit chatterbox

Model · Text to speech

F5-TTS

Yushen CHEN

Download F5-TTS or E2 TTS and place under ckpts/ Paper: F5-TTS: A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching

Open weights cc-by-nc-4.0 f5-tts

Model · Text to speech

Kokoro-82M-v1.0-ONNX

ONNX Community

Kokoro is a frontier TTS model for its size of 82 million parameters (text in/audio out). First, install the kokoro-js library from NPM using: You can then generate speech as follows: Optionally, save the audio to a file: The model is resilient to quantization, enabling efficient high-quality speech synthesis at a fraction of the original model size.

Open weights apache-2.0 transformers.js