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
- Atomic Chat new
- 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
Model card: document PrimeTTS v2 (MB-iSTFT-VITS 34.7M, Xinran, 16 kHz) as flagship; v1 kept as legacy CPU family
Browse files
README.md
CHANGED
|
@@ -7,9 +7,12 @@ tags:
|
|
| 7 |
- text-to-speech
|
| 8 |
- tts
|
| 9 |
- onnx
|
|
|
|
| 10 |
- on-device
|
| 11 |
- jetson
|
| 12 |
- telephony
|
|
|
|
|
|
|
| 13 |
- mandarin
|
| 14 |
- taiwanese-mandarin
|
| 15 |
base_model: owensong/Inflect-Nano-v1
|
|
@@ -18,17 +21,60 @@ library_name: onnxruntime
|
|
| 18 |
pipeline_tag: text-to-speech
|
| 19 |
---
|
| 20 |
|
| 21 |
-
# PrimeTTS —
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
temperatures, %, serials. Two checkpoints share the same acoustic engine:
|
| 27 |
|
| 28 |
-
|
| 29 |
-
- **`v1b_8k/` — leanest on-device (4.09M, 8 kHz)** — telephone-band but **RTF 0.35 on a Jetson Nano** (1 thread).
|
| 30 |
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
| | flagship `v1b_16k/` | on-device `v1b_8k/` |
|
| 34 |
|---|---|---|
|
|
@@ -101,11 +147,13 @@ and a small brand lexicon. Text past `max_frames` is auto-chunked at punctuation
|
|
| 101 |
## Model files
|
| 102 |
|
| 103 |
```
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
| 106 |
{acoustic_encoder,…}.onnx + meta.json · v3_4.6M/ ← legacy 24 kHz variants (6.85M / 4.63M), for record
|
| 107 |
scripts/ frontend, aligner, corpus-gen, train / export, eval
|
| 108 |
-
inflect_nano/ the trainer (acoustic.py + vocoder.py), forked from Inflect-Nano-v1 (LICENSE included)
|
| 109 |
```
|
| 110 |
|
| 111 |
## Quickstart (CPU)
|
|
@@ -172,8 +220,12 @@ own ~10 s reference clip) are in the repo.
|
|
| 172 |
|
| 173 |
## Credits & licenses
|
| 174 |
|
| 175 |
-
- **
|
| 176 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
[Mozilla Common Voice zh-TW](https://commonvoice.mozilla.org/datasets) (**CC0 / public domain**)
|
| 178 |
- **Gate ASR:** Breeze-ASR-25 (MediaTek Research) · Whisper-medium · **Aligner:**
|
| 179 |
`facebook/wav2vec2-lv-60-espeak-cv-ft` + `torchaudio.forced_align` · **Eval:** sherpa-onnx X-ASR
|
|
|
|
| 7 |
- text-to-speech
|
| 8 |
- tts
|
| 9 |
- onnx
|
| 10 |
+
- gguf
|
| 11 |
- on-device
|
| 12 |
- jetson
|
| 13 |
- telephony
|
| 14 |
+
- vits
|
| 15 |
+
- mb-istft-vits
|
| 16 |
- mandarin
|
| 17 |
- taiwanese-mandarin
|
| 18 |
base_model: owensong/Inflect-Nano-v1
|
|
|
|
| 21 |
pipeline_tag: text-to-speech
|
| 22 |
---
|
| 23 |
|
| 24 |
+
# PrimeTTS — on-device zh-TW + English TTS
|
| 25 |
|
| 26 |
+
Taiwan-Mandarin + English text-to-speech built for on-device use (contact-centre, GPS, transit): one
|
| 27 |
+
voice across Chinese, English, and code-mix through a single frontend (no language routing), with
|
| 28 |
+
**entity correctness** — phone numbers, emails, addresses, prices, dates, temperatures, %, serials.
|
|
|
|
| 29 |
|
| 30 |
+
Two model generations:
|
|
|
|
| 31 |
|
| 32 |
+
- **`v2_mbistft_16k/` — PrimeTTS v2 (34.7M, 16 kHz) — current flagship.** End-to-end
|
| 33 |
+
**MB-iSTFT-VITS** targeting the Jetson Nano **GPU** (and any CPU via ONNX). Best quality and
|
| 34 |
+
intelligibility of the family; female Mandarin voice ("Xinran").
|
| 35 |
+
- **`v1b_16k/` / `v1b_8k/` — PrimeTTS v1 (~5.0M / 4.09M).** FastSpeech + Snake-HiFiGAN, pure-**CPU**,
|
| 36 |
+
young-female zh-TW voice; `v1b_8k` reaches **RTF 0.35 on a Jetson Nano CPU** (1 thread). Use v1
|
| 37 |
+
when the deployment budget is CPU-only and tight.
|
| 38 |
+
|
| 39 |
+
> 🔊 **Live demo (serves v2 + v1):** https://huggingface.co/spaces/Luigi/PrimeTTS-vs-Inflect-Nano-v1
|
| 40 |
+
|
| 41 |
+
## PrimeTTS v2 (`v2_mbistft_16k/`)
|
| 42 |
+
|
| 43 |
+
| | PrimeTTS v2 |
|
| 44 |
+
|---|---|
|
| 45 |
+
| **Architecture** | MB-iSTFT-VITS (end-to-end VAE + flow + adversarial; multi-band iSTFT head; conv-only, no LSTM) |
|
| 46 |
+
| **Parameters** | 34.7M (generator) |
|
| 47 |
+
| **Sample rate** | 16 kHz |
|
| 48 |
+
| **Voice** | female Mandarin, "Xinran" |
|
| 49 |
+
| **Eval (36 held-out zh/mix/en sentences)** | X-ASR CER **0.027** overall — zh 0.033 · code-mix 0.039 · en 0.008 (below its 7B teacher's 0.043 on the same eval) |
|
| 50 |
+
| **Runtime** | single ONNX (`primetts_v2_xinran.onnx`, ORT-CPU, RTF ~0.01 on a desktop core) · `primetts_v2_xinran.gguf` for the ggml/CUDA Jetson-Nano runtime (port in progress) |
|
| 51 |
+
|
| 52 |
+
**Training:** distilled from a **VibeVoice-Large** (MIT) teacher speaking the `zh-Xinran_woman` preset —
|
| 53 |
+
29k utterances over the same entity-rich zh-TW corpus as v1, per-utterance speaker-consistency QC
|
| 54 |
+
(retry-regenerated until >99% of clips match the target voice), trained from scratch at 16 kHz with a
|
| 55 |
+
3-embedding frontend (phone + tone + language, 88 symbols) and deterministic duration predictor.
|
| 56 |
+
|
| 57 |
+
```python
|
| 58 |
+
# v2 quickstart — one session, one call
|
| 59 |
+
import numpy as np, onnxruntime as ort, soundfile as sf
|
| 60 |
+
import sys; sys.path.insert(0, "PrimeTTS/scripts")
|
| 61 |
+
import frontend_bopomofo as F
|
| 62 |
+
|
| 63 |
+
sess = ort.InferenceSession("PrimeTTS/v2_mbistft_16k/primetts_v2_xinran.onnx",
|
| 64 |
+
providers=["CPUExecutionProvider"])
|
| 65 |
+
o = F.text_to_ids("您好,歡迎使用 PrimeTTS。Thank you for calling.")
|
| 66 |
+
blank = lambda s: np.array([[0] + [v for x in s for v in (x, 0)]], np.int64) # add_blank=true
|
| 67 |
+
wav = sess.run(None, {"x": blank(o["phone_ids"]), "tone": blank(o["tone_ids"]),
|
| 68 |
+
"lang": blank(o["lang_ids"]),
|
| 69 |
+
"x_lengths": np.array([2*len(o["phone_ids"])+1], np.int64),
|
| 70 |
+
"noise_scale": np.array([0.667], np.float32),
|
| 71 |
+
"length_scale": np.array([1.0], np.float32)})[0].reshape(-1)
|
| 72 |
+
sf.write("out.wav", wav, 16000)
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
---
|
| 76 |
+
|
| 77 |
+
# PrimeTTS v1 (legacy CPU family)
|
| 78 |
|
| 79 |
| | flagship `v1b_16k/` | on-device `v1b_8k/` |
|
| 80 |
|---|---|---|
|
|
|
|
| 147 |
## Model files
|
| 148 |
|
| 149 |
```
|
| 150 |
+
v2_mbistft_16k/primetts_v2_xinran.onnx ← PrimeTTS v2 FLAGSHIP (34.7M, 16 kHz, single ONNX) — the demo serves this
|
| 151 |
+
v2_mbistft_16k/primetts_v2_xinran.gguf ← same weights for the ggml/CUDA Jetson-Nano runtime
|
| 152 |
+
v1b_16k/{acoustic_encoder,acoustic_decoder,vocoder}.onnx + meta.json ← v1 16 kHz (~5.0M, CPU)
|
| 153 |
+
v1b_8k/ {acoustic_encoder,acoustic_decoder,vocoder}.onnx + meta.json ← v1 leanest on-device (4.09M, 8 kHz, Nano CPU)
|
| 154 |
{acoustic_encoder,…}.onnx + meta.json · v3_4.6M/ ← legacy 24 kHz variants (6.85M / 4.63M), for record
|
| 155 |
scripts/ frontend, aligner, corpus-gen, train / export, eval
|
| 156 |
+
inflect_nano/ the v1 trainer (acoustic.py + vocoder.py), forked from Inflect-Nano-v1 (LICENSE included)
|
| 157 |
```
|
| 158 |
|
| 159 |
## Quickstart (CPU)
|
|
|
|
| 220 |
|
| 221 |
## Credits & licenses
|
| 222 |
|
| 223 |
+
- **v2 architecture:** [MB-iSTFT-VITS](https://github.com/MasayaKawamura/MB-iSTFT-VITS) (Kawamura et al., Apache-2.0)
|
| 224 |
+
· **v2 teacher:** VibeVoice-Large (Microsoft, **MIT**) speaking its `zh-Xinran_woman` preset
|
| 225 |
+
(via the MIT [community repo](https://github.com/vibevoice-community/VibeVoice)); synthesized speech,
|
| 226 |
+
AI-generated voice — mark it as such in products
|
| 227 |
+
- **v1 base / trainer:** [`owensong/Inflect-Nano-v1`](https://huggingface.co/owensong/Inflect-Nano-v1) (Apache-2.0)
|
| 228 |
+
- **v1 teacher:** [`openbmb/VoxCPM2`](https://huggingface.co/openbmb/VoxCPM2) · **v1 reference voice:**
|
| 229 |
[Mozilla Common Voice zh-TW](https://commonvoice.mozilla.org/datasets) (**CC0 / public domain**)
|
| 230 |
- **Gate ASR:** Breeze-ASR-25 (MediaTek Research) · Whisper-medium · **Aligner:**
|
| 231 |
`facebook/wav2vec2-lv-60-espeak-cv-ft` + `torchaudio.forced_align` · **Eval:** sherpa-onnx X-ASR
|