Skip to main content

holos-tts-onnx

PyTorch-free inference for HolosTTS on ONNX Runtime: CPU, CUDA and TensorRT, with optional low-latency streaming.

Install

python -m pip install holos-tts-onnx              # CPU and CUDA
python -m pip install "holos-tts-onnx[tensorrt]"  # plus TensorRT

From a checkout of the repository, install ./holos_onnx instead. The import name is holos_onnx.

On Linux and Windows this installs onnxruntime-gpu with its CUDA and cuDNN libraries; on macOS it installs the CPU onnxruntime. The libraries come from NVIDIA's pip packages, so no system CUDA or LD_LIBRARY_PATH setup is needed. Python 3.9+ and ONNX Runtime 1.28+ are required.

Quick start

from holos_onnx import HolosTTS

model = HolosTTS()  # the default bundle, patriotyk/HolosTTS/onnx
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 bundle directory when that path exists. Otherwise model names a Hugging Face model: owner/repo, optionally followed by the bundle's folder in the repository, such as patriotyk/HolosTTS/onnx. Only the bundle files are downloaded, into the Hugging Face cache, so later runs work offline; revision, cache_dir and token control the download.

The input is a phoneme string in the model's vocabulary; the Ukrainian text frontend (stress marks and IPA conversion) is not part of this package. speed above one speaks faster, below one slower.

GPU

model = HolosTTS("patriotyk/HolosTTS/...", providers=["CUDAExecutionProvider"])

TensorRT needs a bundle exported for it (standard opset-20 operators instead of opset-23 Attention and RotaryEmbedding). FP16 with a persistent engine cache is the fastest option:

model = HolosTTS(
    "patriotyk/HolosTTS/...",
    providers=[(
        "TensorrtExecutionProvider",
        {
            "trt_fp16_enable": True,
            "trt_engine_cache_enable": True,
            "trt_engine_cache_path": "trt_cache",
            "trt_timing_cache_enable": True,
            "trt_timing_cache_path": "trt_cache",
        },
    )],
)

The first load builds the engines, which takes a few minutes; later loads reuse the cache. CUDA and CPU are added as fallbacks automatically. Each stage gets its own TensorRT optimization profile from the bundle's manifest (2–512 tokens and up to max_frames frames by default), and longer inputs are rejected before inference.

Measured on an RTX 3090 for 6.6 s of audio: CPU 430 ms, CUDA 27 ms, TensorRT FP16 9 ms.

Streaming

Load the model with streaming=True to get audio chunk by chunk:

model = HolosTTS("patriotyk/HolosTTS/...", streaming=True, providers=[...])
for chunk in model.stream(phonemes, voice="my_voice"):
    play(chunk)

Streaming uses a window decoder: each chunk of chunk_frames frames (40 by default, 1 s of audio) is decoded with 20 frames of context on both sides, so the chunks concatenate to the same audio as decoding the whole utterance. The first chunk is ready after about 6 ms with TensorRT FP16 on an RTX 3090. stream drops the boundary-token silence at the start (about 50 ms) except 10 ms and fades in over 5 ms; pass trim_silence=False to keep it.

stream raises an error on a model loaded without streaming=True. generate works in both modes and always returns the full utterance.

Bundle format

A bundle is a directory with holos_onnx.json (vocabulary, sample rate and stage files), voices.npz (preset voice embeddings) and the stage graphs:

  • encoder.onnx: tokens → token features and integer durations;
  • prosody.onnx: token features gathered per frame → F0 and energy;
  • decoder.onnx: acoustic features, F0 and energy → audio of the whole utterance (default mode);
  • source.onnx and decoder_window.onnx (streaming mode): the harmonic excitation for the whole utterance, and the decoder for one window of it.

Only the files of the selected mode are downloaded and loaded. The runtime builds the frame-to-token index between stages, and every stage runs on the exact predicted length. Bundles from exporters older than the three-stage format are rejected.

Without session_options, the runtime disables ONNX Runtime's intra-op thread spinning: the stages run one after another, and spinning threads of a finished stage would slow the next one down on CPU.

Tests

python holos_onnx/tests/test_inference.py

Metadata

Release files for holos-tts-onnx 0.2

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-onnx 0.2
File Size Uploaded Provenance Actions
holos_tts_onnx-0.2.tar.gz 17.0 kB With provenance Details for holos_tts_onnx-0.2.tar.gz

Built distribution (wheel)

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

Total release size: 28.8 kB

Release files / holos_tts_onnx-0.2.tar.gz

Download URL holos_tts_onnx-0.2.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0ee312ca3a67fd426e2807573a092d280c828306d2764ac07eca134191fed450
BLAKE2b-256 checksum
How to use checksums
0f0b4419d2274c98b9cfe8787a8834a2b69a40c63210b7d7544d20514e3207ca
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 Oct 28, 2026.

Transparency log

Release files / holos_tts_onnx-0.2-py3-none-any.whl

Download URL holos_tts_onnx-0.2-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca1f266295404992e0278a37ecfed71d47e7b25d5861a59e3e30940774fc5d6e
BLAKE2b-256 checksum
How to use checksums
c3ac9b3cbfbc05710c013e4a2154fdbea77b178f71d41e1c3fbab56d20bd07c7
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 Oct 28, 2026.

Transparency log

Security for holos-tts-onnx 0.2

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for holos_tts_onnx-0.2.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 Oct 28, 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.

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