Skip to main content

holos-tts-litert

HolosTTS with LiteRT in Python, for the model in the litert/ folder on Hugging Face, the same one the Kotlin library runs on Android GPUs.

I use it to check that model on a computer, and as the reference for the ports: the code between the graphs (embedding lookups, buckets, rounding the durations, frame alignment, harmonic excitation, decoder windows, trimming the leading silence) is easier to follow and to compare here. To synthesize on a computer, my other packages are faster: MLX on Apple silicon, ONNX Runtime or TensorRT elsewhere.

Install

python -m pip install holos-tts-litert

From a checkout of the repository, install ./holos_litert/python instead. The import name is holos_litert. It needs Python 3.10+ and ai-edge-litert, which has packages for Linux, macOS and Windows.

Quick start

from holos_litert import HolosTTS

model = HolosTTS()  # patriotyk/HolosTTS/litert, on the CPU
audio = model.generate(phonemes, voice=model.list_voices()[0], speed=1.0)
# float32 samples at model.sample_rate (24 kHz)

HolosTTS(model) loads a local model directory when that path exists. Otherwise model names a Hugging Face model: owner/repo, optionally followed by the model's folder in the repository. Only the model files are downloaded, into the Hugging Face cache; revision, cache_dir and token control the download.

The input is a phoneme string in the model's vocabulary, as for the other packages. voice is a preset name or a 256-value voice vector. One utterance can have up to 510 phonemes and 1000 frames (25 s of speech).

By default the graphs run on 4 CPU threads in FP32. HolosTTS(gpu=True) runs them on the GPU in FP16, as on Android (fp16=False for FP32). On an Apple M2, with Metal, the 10 s sentence from the benchmarks takes:

RTF First chunk of stream()
CPU, FP32 0.26 0.79 s
GPU, FP16 0.029 0.09 s

Streaming

for chunk in model.stream(phonemes, voice="my_voice"):
    play(chunk)

The first chunk of 1 s comes from an 80-frame decoder window, the later ones of 4 s from 200-frame windows, and every window has 20 frames of context on both sides, so the chunks concatenate to the generate() audio. Unlike the Kotlin library, which stays with the small windows on a GPU too slow for the large ones, the windows here do not depend on timing, so the output is reproducible. chunk_frames (1-40, 40 = 1 s) decodes every chunk in a small window instead. stream() drops the boundary-token silence at the start except 10 ms and fades in over 5 ms; pass trim_silence=False to keep it.

noise=False in generate() and stream() turns off the source noise, so the same text gives the same audio.

Tests

python holos_litert/python/tests/test_inference.py

The tests download the model, or load it from HOLOS_LITERT_MODEL, and check on the CPU that the streamed chunks join into the generate() audio sample for sample.

Metadata

Release files for holos-tts-litert 0.1

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

Source distribution (sdist)

Source distribution for holos-tts-litert 0.1
File Size Uploaded Provenance Actions
holos_tts_litert-0.1.tar.gz 11.7 kB With provenance Details for holos_tts_litert-0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for holos-tts-litert 0.1
File Interpreter ABI Platform Actions
holos_tts_litert-0.1-py3-none-any.whl Python 3 none any Details for holos_tts_litert-0.1-py3-none-any.whl

Total release size: 21.5 kB

Release files / holos_tts_litert-0.1.tar.gz

Download URL holos_tts_litert-0.1.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f8b37df3d77b97fcc8843ffc803049d31014d981a2211252bfcd23b6d610212f
BLAKE2b-256 checksum
How to use checksums
d8340ac6412e615c814c80df4617f43b2e9aabc5a64cea8f167999c9c09fa36f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / holos_tts_litert-0.1-py3-none-any.whl

Download URL holos_tts_litert-0.1-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5482ac49517cb1055f2be60016b8a99be637d113980676e6e3e5318cffddb9f6
BLAKE2b-256 checksum
How to use checksums
b76744249a8e11697523795f5060eddc34101db23448b6cd15ce9bf3a7c7805a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for holos-tts-litert 0.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for holos_tts_litert-0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

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 This release

2 release files Full 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