Skip to main content

Blue

Text-to-speech inference with ONNX Runtime; optional TensorRT acceleration on NVIDIA GPUs.

PyPI version   Try Live Demo on Hugging Face   lightbluetts.com

Hebrew, English, Spanish, Italian, and German — samples and a live demo on the site and Space above.

Install

Requires Python 3.12+ (see requires-python in pyproject.toml).

Users (PyPI)

pip install blue-onnx

Optional accelerators (PyPI): install the extra, then drop the stock CPU wheel so a single build owns onnxruntime:

  • Intel OpenVINO: pip install "blue-onnx[openvino]" then pip uninstall onnxruntime
  • NVIDIA CUDA: pip install "blue-onnx[gpu]" then pip uninstall onnxruntime

This repository

git clone https://github.com/maxmelichov/BlueTTS.git
cd BlueTTS
uv sync

Optional extras:

uv sync --extra openvino   # Intel OpenVINO EP (then: uv pip uninstall onnxruntime)
uv sync --extra gpu        # NVIDIA CUDA ORT (then: uv pip uninstall onnxruntime)

The default environment uses the stock onnxruntime CPU wheel. OpenVINO and CUDA (gpu) are optional; each adds a second ONNX Runtime distribution until you remove the stock CPU wheel so the accelerator build owns the onnxruntime import (uv pip uninstall onnxruntime, or the same with pip after a PyPI install with [openvino] or [gpu]). Do not combine the openvino and gpu extras. For TensorRT, use uv sync --extra tensorrt in TensorRT. For voice or ONNX export, add --extra export in Models (with the PyTorch checkpoint download).

Models

ONNX bundle (slim graph; notmax123/blue-onnx-v2):

uv run hf download notmax123/blue-onnx-v2 --repo-type model --local-dir ./onnx_models

The Hub bundle does not include per-voice style JSON; use the sample voices/*.json from this repository (or on GitHub), or export a new voice from a reference clip (see exports/README.md, PyTorch weights below). If you use pip without uv, the same CLI is available after install because blue-onnx depends on huggingface-hub — run hf download ... with the same arguments.

Optional

  • Hebrew G2P:
    wget -O model.onnx https://huggingface.co/thewh1teagle/renikud/resolve/main/model.onnx
    
  • PyTorch checkpoints (notmax123/blue-v2) for exporting new voice JSON and ONNX: uv sync --extra export then
    uv run hf download notmax123/blue-v2 --repo-type model --local-dir ./pt_models
    

Usage

Examples below use voices/female1.json from this repo, or a JSON you produced with exports/export_new_voice.py.

Quick start

import soundfile as sf
from blue_onnx import BlueTTS

tts = BlueTTS(
    onnx_dir="onnx_models",
    style_json="voices/female1.json",
    renikud_path="model.onnx",
)

samples, sr = tts.synthesize("שלום, זהו מודל דיבור בעברית.", lang="he")
sf.write("output.wav", samples, sr)

mixed = "שלום לכולם, <en>welcome to the presentation</en>, <es>espero que lo disfruten</es>."
samples, sr = tts.synthesize(mixed, lang="he")
sf.write("mixed_output.wav", samples, sr)

If you are editing this repo without installing the package, use from src.blue_onnx import BlueTTS (as in examples/) or put src on PYTHONPATH.

Examples

Outputs go to examples/out/ when run from the repo root.

uv run python examples/basic.py   # he / en / es / it / de + mixed in one run
uv run python examples/mixed.py
uv run python examples/app.py --lang en --text "Hello world."

Edit onnx_dir and voice JSON in each example if your paths differ. See examples/voices.md for app.py and voice selection.

TensorRT (NVIDIA only)

  1. Dependencies:
uv sync --extra tensorrt
uv pip install tensorrt-cu12   # separate install; see astral-sh/uv#14313
  1. Build engines (details in scripts/README.md):
uv run python scripts/create_tensorrt.py \
  --onnx_dir onnx_models --engine_dir trt_engines --precision fp32 --config config/tts.json

Citations

@ARTICLE{2025arXiv250323108K,
       author = {{Kim}, Hyeongju and {Yang}, Jinhyeok and {Yu}, Yechan and {Ji}, Seunghun and {Morton}, Jacob and {Bous}, Frederik and {Byun}, Joon and {Lee}, Juheon},
        title = "{SupertonicTTS: Towards Highly Efficient and Streamlined Text-to-Speech System}",
      journal = {arXiv e-prints},
     keywords = {Audio and Speech Processing, Machine Learning, Sound},
        pages = {arXiv:2503.23108},
}
@article{kim2025training,
  title={Training Flow Matching Models with Reliable Labels via Self-Purification},
  author={Kim, Hyeongju and Yu, Yechan and Yi, June Young and Lee, Juheon},
  journal={arXiv preprint arXiv:2509.19091},
  year={2025}
}
@misc{yi2025robustttstrainingselfpurifying,
      title={Robust TTS Training via Self-Purifying Flow Matching for the WildSpoof 2026 TTS Track},
      author={June Young Yi and Hyeongju Kim and Juheon Lee},
      year={2025},
      eprint={2512.17293},
      archivePrefix={arXiv},
      primaryClass={cs.SD},
      url={https://arxiv.org/abs/2512.17293},
}

Acknowledgments

Hebrew G2P uses renikud. Thanks to thewh1teagle.

License

MIT

Voice cloning and responsibility

This software can produce speech that mimics a reference voice. The maintainers and contributors are not responsible for what you do with it—compliance with law, consent from voice owners, and ethical use are entirely your responsibility. Do not use it to deceive, impersonate without permission, or infringe anyone’s rights.

Metadata

Release files for blue-onnx 0.2.4

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

Source distribution (sdist)

Source distribution for blue-onnx 0.2.4
File Size Uploaded
blue_onnx-0.2.4.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for blue-onnx 0.2.4
File Interpreter ABI Platform
blue_onnx-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 25.8 kB

Release files / blue_onnx-0.2.4.tar.gz

Download URL blue_onnx-0.2.4.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f136924c03bc559039a206b38f71ba33b87ed61e8afa0c8c3403294820ab6cb5
BLAKE2b-256 checksum
How to use checksums
d605ceb2764e1f7426fdea154cac4dd87dfa19a7f24d5f759103feb0f1a4877d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / blue_onnx-0.2.4-py3-none-any.whl

Download URL blue_onnx-0.2.4-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b829b19b4c6f2353b24908103c8b12c88bc25fab37f30976e109092dcbf89e5
BLAKE2b-256 checksum
How to use checksums
183ca976ec12185661a7c877a6c8e97442f4c3fbfed6999fbe628c5095d6bc01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files

0.2.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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