Text-to-Speech
ONNX
GGUF
Chinese
English
onnxruntime
tts
on-device
jetson
telephony
vits
mb-istft-vits
multi-speaker
mandarin
taiwanese-mandarin
imatrix
conversational
Instructions to use Luigi/PrimeTTS with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Luigi/PrimeTTS with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Luigi/PrimeTTS:F32 # Run inference directly in the terminal: llama cli -hf Luigi/PrimeTTS:F32
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Luigi/PrimeTTS:F32 # Run inference directly in the terminal: llama cli -hf Luigi/PrimeTTS:F32
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Luigi/PrimeTTS:F32 # Run inference directly in the terminal: ./llama-cli -hf Luigi/PrimeTTS:F32
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Luigi/PrimeTTS:F32 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Luigi/PrimeTTS:F32
Use Docker
docker model run hf.co/Luigi/PrimeTTS:F32
- LM Studio
- Jan
- Ollama
How to use Luigi/PrimeTTS with Ollama:
ollama run hf.co/Luigi/PrimeTTS:F32
- Unsloth Studio
How to use Luigi/PrimeTTS with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Luigi/PrimeTTS to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Luigi/PrimeTTS to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Luigi/PrimeTTS to start chatting
- Docker Model Runner
How to use Luigi/PrimeTTS with Docker Model Runner:
docker model run hf.co/Luigi/PrimeTTS:F32
- Lemonade
How to use Luigi/PrimeTTS with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Luigi/PrimeTTS:F32
Run and chat with the model
lemonade run user.PrimeTTS-F32
List all available models
lemonade list
- Atomic Chat
| # PrimeTTS v2-Stream β token-level streaming zh-TW/English TTS | |
| A **streaming** MB-iSTFT-VITS (Xinran voice, 16 kHz): band-attention encoder + | |
| causal FFN + **causal MB-iSTFT vocoder**, so audio can be emitted incrementally | |
| in fixed chunks. Bit-exact between whole-utterance and chunked inference. | |
| Streaming params: **chunk = 24 frames (~384 ms), left cache = 64, right lookahead = 4** | |
| (1 frame = 256 samples @ 16 kHz). First-audio β enc(once) + one chunk. | |
| > This is a **streaming-capable** variant of PrimeTTS v2 (a distinct checkpoint, | |
| > not v2 run in a streaming loop). The causal + limited-lookahead architecture | |
| > trades some quality for streamability vs the non-streaming v2. | |
| ## Files | |
| | file | purpose | | |
| |---|---| | |
| | `v2stream_enc.onnx` | text (x,tone,lang,x_lengths,noise_scale,length_scale) β z[1,192,T]. Run **once**. | | |
| | `v2stream_dec.onnx` | z[1,192,Tc] β wav[1,1,TcΒ·256]. Run **per chunk** (overlap-save). | | |
| | `primetts_v2stream_xinran_f32.gguf` | single-graph gguf for RapidSpeech.cpp ggml (`MBISTFT_STREAM=1`). | | |
| | `onnx_stream.py` | reference streaming runner (ORT). | | |
| | `meta.json` | params + frontend convention. | | |
| ## Run A β ONNX Runtime (Python, torch-free) | |
| ```python | |
| from onnx_stream import StreamingTTS # in this repo | |
| tts = StreamingTTS("v2stream_enc.onnx", "v2stream_dec.onnx") | |
| z = tts.encode(phone_ids, tone_ids, lang_ids) # once | |
| for pcm_chunk in tts.stream(z): # per 24-frame chunk | |
| play(pcm_chunk) # 16 kHz float32 | |
| ``` | |
| `phone_ids/tone_ids/lang_ids` come from the **frontend** (text β ids): g2pw | |
| (bopomofo, Taiwan readings) + g2p_en (arpabet), 88 syms / 6 tones / 2 langs, | |
| with `add_blank` (0 interleaved between tokens). See `frontend_bopomofo` in the | |
| [demo Space](https://huggingface.co/spaces/Luigi/PrimeTTS-Streaming). | |
| ## Run B β sherpa-onnx fork (C++/ORT) | |
| `OfflineTtsMbistftStreamModel(enc=..., dec=..., num_threads=2).generate(x,tone,lang, | |
| callback=...)` emits audio per chunk via the callback. Branch: | |
| [vieenrose/sherpa-onnx @ mbistft-streaming-tts](https://github.com/vieenrose/sherpa-onnx/tree/mbistft-streaming-tts). | |
| ## Run C β RapidSpeech.cpp (ggml, GPU/Jetson) | |
| `MBISTFT_STREAM=1 MBISTFT_STREAM_LOOKAHEAD=5 mbistft-parity primetts_v2stream_xinran_f32.gguf | |
| inputs.json out --stream-chunks`. Branch: | |
| [vieenrose/RapidSpeech.cpp @ jetson-nano-gen1](https://github.com/vieenrose/RapidSpeech.cpp). | |
| Validated on Jetson Nano (Tegra X1): parity cosine > 0.99, first-audio ~285 ms. | |
| License: Apache-2.0. Part of the [Luigi/PrimeTTS](https://huggingface.co/Luigi/PrimeTTS) family. | |