KittenTTS README

The project's README from github.com/KittenML/KittenTTS. As one markdown file: README.md.

Kitten TTS

Kitten TTS

Hugging Face Demo Discord Website License

New: Free Kitten TTS API available at https://platform.kittenml.com

Kitten TTS is an open-source, lightweight text-to-speech library built on ONNX. With models ranging from 15M to 80M parameters (25-80 MB on disk), it delivers high-quality voice synthesis on CPU without requiring a GPU.

Status: Developer preview -- APIs may change between releases.

Commercial support is available. For integration assistance, custom voices, or enterprise licensing, contact us.

Table of Contents

Features

Available Models

Model Parameters Size Download
kitten-tts-mini 80M 80 MB KittenML/kitten-tts-mini-0.8
kitten-tts-micro 40M 41 MB KittenML/kitten-tts-micro-0.8
kitten-tts-nano 15M 56 MB KittenML/kitten-tts-nano-0.8
kitten-tts-nano (int8) 15M 25 MB KittenML/kitten-tts-nano-0.8-int8

Note: Some users have reported issues with the kitten-tts-nano-0.8-int8 model. If you encounter problems, please open an issue.

Demo

https://github.com/user-attachments/assets/d80120f2-c751-407e-a166-068dd1dd9e8d

Try it online

Try Kitten TTS directly in your browser on Hugging Face Spaces.

Quick Start

Prerequisites

Installation

pip install https://github.com/KittenML/KittenTTS/releases/download/0.8.1/kittentts-0.8.1-py3-none-any.whl

Basic Usage

from kittentts import KittenTTS

model = KittenTTS("KittenML/kitten-tts-mini-0.8")
audio = model.generate("This high-quality TTS model runs without a GPU.", voice="Jasper")

import soundfile as sf
sf.write("output.wav", audio, 24000)

Advanced Usage

# Adjust speech speed (default: 1.0)
audio = model.generate("Hello, world.", voice="Luna", speed=1.2)

# Save directly to a file
model.generate_to_file("Hello, world.", "output.wav", voice="Bruno", speed=0.9)

# List available voices
print(model.available_voices)
# ['Bella', 'Jasper', 'Luna', 'Bruno', 'Rosie', 'Hugo', 'Kiki', 'Leo']

Using with GPU

pip install -r requirements_gpu.txt
m = KittenTTS("KittenML/kitten-tts-mini-0.8", backend="cuda")

Check out example_cuda.py

API Reference

KittenTTS(model_name, cache_dir=None)

Load a model from Hugging Face Hub.

Parameter Type Default Description
model_name str "KittenML/kitten-tts-nano-0.8" Hugging Face repository ID
cache_dir str None Local directory for caching downloaded model files

model.generate(text, voice, speed, clean_text)

Synthesize speech from text, returning a NumPy array of audio samples at 24 kHz.

Parameter Type Default Description
text str -- Input text to synthesize
voice str "expr-voice-5-m" Voice name (see available voices)
speed float 1.0 Speech speed multiplier
clean_text bool False Preprocess text (expand numbers, currencies, etc.)

model.generate_to_file(text, output_path, voice, speed, sample_rate, clean_text)

Synthesize speech and write directly to an audio file.

Parameter Type Default Description
text str -- Input text to synthesize
output_path str -- Path to save the audio file
voice str "expr-voice-5-m" Voice name
speed float 1.0 Speech speed multiplier
sample_rate int 24000 Audio sample rate in Hz
clean_text bool True Preprocess text (expand numbers, currencies, etc.)

normalize_text(text, locale="en-US", return_spans=False)

Normalize text for TTS without generating audio.

from kittentts import normalize_text

normalized = normalize_text("Dr. Rivera paid $12.50 at 3:05 p.m.")
# "Doctor Rivera paid twelve dollars and fifty cents at three oh five p m."

result = normalize_text("Fig. 2", return_spans=True)
print(result.text)
print(result.spans)

When return_spans=True, the result includes original-to-normalized character spans for changed segments such as abbreviations, dates, times, numbers, currency, URLs, and punctuation.

model.available_voices

Returns a list of available voice names: ['Bella', 'Jasper', 'Luna', 'Bruno', 'Rosie', 'Hugo', 'Kiki', 'Leo']

System Requirements

A virtual environment (conda, venv, or similar) is recommended to avoid dependency conflicts.

Roadmap

Commercial Support

We offer commercial support for teams integrating Kitten TTS into their products. This includes integration assistance, custom voice development, and enterprise licensing.

Contact us or email [email protected] to discuss your requirements.

Community and Support

License

This project is licensed under the Apache License 2.0.

KittenTTS (KittenML/KittenTTS)

Searching Database…

16.2K ·GitHub
这是什么?Kitten TTS 是一个开源、轻量的文本转语音库,基于 ONNX 构建,使用 15M 到 80M 参数的超小模型,将文字转换为自然的语音,并且完全在 CPU 上运行。
这是独立的应用程序,还是我可以导入的 Python 库?它是一个 Python 库——你可以用 pip 安装,然后在自己的代码中通过 KittenTTS 类调用,而不是独立的应用程序。
怎样才能让它运行起来?按照 Installation 部分的说明用 pip 安装,然后用 KittenTTS(modelname) 加载模型,再调用 model.generate(text, voice, speed) 或 generatetofile() 生成音频。
运行它除了 Python 之外还需要别的东西吗?只需要 Python 3.8 或更高版本以及 pip;建议使用虚拟环境以避免依赖冲突,但不需要任何额外的硬件。
能直接用于生产环境吗?还不完全可以——该项目被标注为开发者预览版,意味着其 API 可能会在版本之间发生变化;而且 int8 nano 模型已有部分用户报告过问题。
支持哪些操作系统?Linux、macOS 和 Windows 均受支持,因为它只是一个基于 CPU 的 Python/ONNX 库。
内置了哪些语音?库中内置了八种语音:Bella、Jasper、Luna、Bruno、Rosie、Hugo、Kiki 和 Leo。
安装之前能先试用吗?可以,Hugging Face Spaces 上提供了在线演示,你可以直接在浏览器中测试。
支持英语以外的语言吗?暂时不支持——多语言 TTS 和专门的 ASR 模型都已列入路线图,但尚未发布。
模型文件有多大?模型大小从约 25 MB(int8 nano,15M 参数)到 80 MB(mini,80M 参数)不等,体积足够小,适合在边缘设备上部署。
Creator
KittenML
Size
2 MB
Stars
16.2K
Age
1y
Commits · 90 Days