Skip to main content

kleintts

Klein-TTS text-to-speech models in plain PyTorch: Pro (13M; English, Spanish, French, Italian), Flash (1.7M) and Flash Lite (0.4M) (English, French, Italian). One small package: the model, the text front-end (the full misaki + spaCy one used for training, installed for you), the voices (17 in Pro) and the synthesis loop.

pip install kleintts
from kleintts import KleinTTS

tts = KleinTTS.from_pretrained("pro")      # "pro", "flash", "flash-lite", a Hugging Face repo id or a local folder
out = tts.tts("Hello from Klein TTS.", voice="Sarah", speed=1.0, seed=0)
tts.save_wav("hello.wav", out.waveform, out.sample_rate)
kleintts "Ciao, questa è una prova." --voice Giulia -o ciao.wav
kleintts "Hello there." --model flash -o hello.wav
kleintts --list-voices

tts(text, voice, voice2, mix, speed, seed, pause, phonemes, use_m): voice2/mix blend two voices of one language, phonemes skips the text front-end, use_m switches on the optional evaluation stream (off by default).

No library? Use Transformers

The model repo also carries Transformers remote code, so this works without installing kleintts. It uses a compact copy of the English front-end (bundled dictionaries, no spaCy), which agrees with the full one on about 97% of English sentences:

from transformers import AutoModel
model = AutoModel.from_pretrained("klein-ml/Klein-TTS-X1.5-Pro", trust_remote_code=True)
out = model.tts("Hello from Klein TTS.", voice="Sarah")
model.save_wav("hello.wav", out.waveform, out.sample_rate)

Layout

  • src/kleintts/core.py: everything (generator, phonemizer, voices, synthesis). It is the first half of modeling_klein_tts.py in the model repo, with one block swapped: the package front-end uses misaki + spaCy, the remote code uses vendor/frontend_vendored.py.
  • hf/: the Transformers wrapper and config class, and an example script.
  • build_release.py: turns a training checkpoint into the upload folder (safetensors, config.json, remote code).
  • vendor/: make_g2p.py builds the compact English front-end and lexicons from misaki; test_g2p.py compares it with the real one.
  • test_package.py: the package against the original training code, and every language.
  • test_remote_code.py: the Transformers path with misaki, spaCy and num2words blocked.

License

Apache-2.0 (see LICENSE).

Metadata

Release files for kleintts 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kleintts 0.1.0
File Size Uploaded Provenance Actions
kleintts-0.1.0.tar.gz 22.5 kB Without provenance Details for kleintts-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kleintts 0.1.0
File Interpreter ABI Platform Actions
kleintts-0.1.0-py3-none-any.whl Python 3 none any Details for kleintts-0.1.0-py3-none-any.whl

Total release size: 44.5 kB

Release files / kleintts-0.1.0.tar.gz

Download URL kleintts-0.1.0.tar.gz
Size 22.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f0f4f3bf351dce4debd8e6f508383b13d651821cfe8c80c6c0e232aee2677492
BLAKE2b-256 checksum
How to use checksums
5d78c60f71768cdeb432881ce83b17f903925ef6b3c9cafbe3da984d9aa0816b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / kleintts-0.1.0-py3-none-any.whl

Download URL kleintts-0.1.0-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02cf45bc6569822092d43618ab3ad7ecc78ce76c5435cb15d684f225c1e28925
BLAKE2b-256 checksum
How to use checksums
171f3ca4e5ddd96e238fbfa3977ba4f6361d77c3ae775dbe21df4f355e735364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for kleintts 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page