Instructions to use batteryphil/VAULT-PRIMAL-VITS-29M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use batteryphil/VAULT-PRIMAL-VITS-29M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="batteryphil/VAULT-PRIMAL-VITS-29M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTextToWaveform tokenizer = AutoTokenizer.from_pretrained("batteryphil/VAULT-PRIMAL-VITS-29M") model = AutoModelForTextToWaveform.from_pretrained("batteryphil/VAULT-PRIMAL-VITS-29M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- VAULT-PRIMAL-VITS-29M (
16.52 MB4-Bit Prime-Harmonic &8.75 MB2-Bit 1D-CNN Speech Model)- Listen First (Side-by-Side Audio Samples)
- Which Checkpoint Should I Pick?
- 60-Second Quickstart (Copy & Paste)
- Objective Benchmark Results (Pure 1D-CNN / Flow / HiFi-GAN Test)
- Why
V3_P4_0Beats UniformQ4_0on 1D CNNs & Flows - Cache-Resident CPU Inference (
device="cpu") - Companion VAULT + PRIMAL Releases
- License
- Listen First (Side-by-Side Audio Samples)
VAULT-PRIMAL-VITS-29M (16.52 MB 4-Bit Prime-Harmonic & 8.75 MB 2-Bit 1D-CNN Speech Model)
End-to-end VITS (29.04M active inference parameters β 87.5% 1D Dilated Conv1d WaveNet Normalizing Flow + 9.2% ConvTranspose1d HiFi-GAN Vocoder) compressed 7.03x to 16.52 MB (V3_P4_0) and 13.27x to 8.75 MB (V3_Q2_0 + PRIMAL)!
- Requires ZERO exotic libraries: Uses only standard Hugging Face
transformers(VitsModel,VitsTokenizer),torch,safetensors, andsoundfileβ packages almost every AI developer already has installed! - True cold-start compression: Builds the
VitsModelskeleton fromconfig.jsonand loads ONLY the16.52 MBor8.75 MB.safetensorsfile β never downloads Meta's145 MBFP32checkpoint. - Works everywhere: Runs natively on NVIDIA CUDA, AMD ROCm, Apple Silicon (
mps), and CPU.
Listen First (Side-by-Side Audio Samples)
Prompt: "Hello! This is a full text to speech quantization benchmark running locally on consumer hardware." (16 kHz)
| Checkpoint | True File Size | Compression | Play Sample |
|---|---|---|---|
Upstream FP32 (facebook/mms-tts-eng) |
116.14 MB |
1.00x |
Download .wav |
Standard Uniform Q4_0 Baseline |
16.52 MB |
7.03x |
Download .wav |
vits_v3_p4_0.safetensors (Recommended) |
16.52 MB |
7.03x |
Download .wav |
vits_v3_q2_0_primal.safetensors (Extreme 2-Bit) |
8.75 MB |
13.27x |
Download .wav |
Which Checkpoint Should I Pick?
| Variant Flag | File in Repo | Size | Best For |
|---|---|---|---|
--variant p4_0 (Default) |
vits_v3_p4_0.safetensors |
16.52 MB |
Daily / Clean Speech Use: Matches FP32 Character Error Rate (7.20% CER) and beats standard uniform Q4_0 at the exact same byte size (-10.4% lower Log-Mel spectral distortion: 4.097 dB vs 4.573 dB)! |
--variant q2_0 |
vits_v3_q2_0_primal.safetensors |
8.75 MB |
2-Bit Edge Research Showcase: Raw 2-bit VITS collapses into 145.2% WER unintelligible gibberish; 120 steps of Multi-Resolution STFT PRIMAL rescued -121.5 percentage points of WER (23.73% WER, -9.40 dB spectral recovery) inside 8.75 MB (audible vocoder grain, intelligible words). |
60-Second Quickstart (Copy & Paste)
Option A β 1-Command CLI (Only Standard transformers + torch Needed!)
pip install torch transformers safetensors soundfile huggingface_hub numpy
git clone https://huggingface.co/batteryphil/VAULT-PRIMAL-VITS-29M
cd VAULT-PRIMAL-VITS-29M
# 1. Speak with the clean 16.52 MB 4-bit Prime-Harmonic CNN model:
python infer.py "Prime harmonic quantization places finer resolution near zero while capturing heavy filter outliers." -o vits_p4.wav
# 2. Test the extreme 8.75 MB 2-bit PRIMAL-healed model:
python infer.py "Discrete integer optimization rescued two-bit VITS from total gibberish!" --variant q2_0 -o vits_q2.wav
Option B β 4-Line Python API (Auto-Downloads 16.52 MB Directly From Hugging Face)
import importlib.util
from huggingface_hub import hf_hub_download
spec = importlib.util.spec_from_file_location(
"vault_tts", hf_hub_download("batteryphil/VAULT-PRIMAL-VITS-29M", "vault_tts.py")
)
vault_tts = importlib.util.module_from_spec(spec); spec.loader.exec_module(vault_tts)
tts = vault_tts.load_vits(variant="p4_0") # 16.52 MB (or "q2_0" for 8.75 MB!)
tts.speak("Hello! Running quantized VITS with standard Hugging Face transformers.", out_path="hello_vits.wav")
Objective Benchmark Results (Pure 1D-CNN / Flow / HiFi-GAN Test)
Evaluated across 12 held-out spoken prompts (177 words total, 0 overlap with the 24 calibration sentences) using openai/whisper-small.en round-trip ASR:
| Variant | Active Size | Eff. bpw |
Whisper WER % $\downarrow$ |
Whisper CER % $\downarrow$ |
Log-Mel Dist (dB) $\downarrow$ |
STFT Spectral Conv. $\downarrow$ |
|---|---|---|---|---|---|---|
Upstream FP32 (facebook/mms-tts-eng, weight_norm folded) |
116.14 MB |
32.00 |
14.69% |
7.20% |
0.000 |
0.0000 |
Standard Uniform Q4_0 PTQ |
16.52 MB |
4.55 |
12.99% |
7.56% |
4.573 |
1.0830 |
V3_P4_0 Prime-Harmonic LUT (4-bit) |
16.52 MB |
4.55 |
12.99% |
7.20% |
4.097 (-10.4% err) |
1.0435 |
V3_Q2_0 2-Bit Raw PTQ (Before PRIMAL) |
8.75 MB |
2.41 |
145.20% (Gibberish) |
107.56% |
15.594 |
1.0014 |
V3_Q2_0 + Multi-Res STFT PRIMAL (2-bit) |
8.75 MB |
2.41 |
23.73% (-121.5%!) |
12.60% |
6.199 (-9.40 dB!) |
1.0004 |
Why V3_P4_0 Beats Uniform Q4_0 on 1D CNNs & Flows
- Offline
weight_normFolding + Training-Onlyposterior_encoderPruning: StockVITSwraps nearly everyConv1din WaveNet Normalizing Flows and everyConvTranspose1din the HiFi-GAN decoder inside dynamicweight_norm(g, v)parametrizations, plus ships aposterior_encoderused only during training. Foldingw = g * v / ||v||offline and droppingposterior_encoderisolates the29.04Mactive inference parameters (99.55%quantized). - Leptokurtic Dilated
Conv1dKernels: WaveNet dilated residual convolutions (dilation = 1, 2, 4, ...) concentrate dense tap weights near zero alongside sharp center-tap outliers. At identical18 bytes / 32 weights(4.50 bpw),V3_P4_0's Prime-Harmonic non-linear grid reduces Log-Mel spectral distortion by10.4%compared to uniformQ4_0. - 2-Bit Multi-Resolution STFT
PRIMALHealing: Keeping the tiny stochasticduration_predictorinV3_P4_0and training the remainingConv1d/ConvTranspose1d/Linearblocks directly in 2-bitV3_Q2_0under Multi-Resolution STFT (FFT = {256, 512, 1024, 2048}) + latent flow L1 supervision (0shadow weights) rescues speech intelligibility from complete collapse (145.2% -> 23.7%WER).
Cache-Resident CPU Inference (device="cpu")
On CPU (python infer.py "..." --device cpu), vault_tts.py builds a torch.device("meta") skeleton (0.23s cold start) and runs vault_cpu_engine.py + vault_tts_cpu.c (AVX2 bit-packed WaveNet/Transformer + shared-activation in-place VitsHifiGan), keeping the entire model inside CPU L3 cache (0.0 waveform numerical drift vs. unpacked FP32):
| Checkpoint | Disk Size | Live CPU RAM (vs 116.1 MB FP32) |
Cold Load | CPU Synth Speed (Intel Xeon 6136) |
Speedup vs Unpacked CPU |
|---|---|---|---|---|---|
vits_v3_p4_0.safetensors |
16.63 MB |
19.07 MB (6.09x less β 100% in L3!) |
0.23s (3.4x faster) |
14.25x Real-Time (0.447s / 6.4s audio) |
+29% faster |
vits_v3_q2_0_primal.safetensors |
8.86 MB |
11.49 MB (10.11x less β 100% in L3!) |
0.24s (3.8x faster) |
14.50x Real-Time (0.454s / 6.6s audio) |
+42% faster |
Companion VAULT + PRIMAL Releases
batteryphil/VAULT-PRIMAL-Tiny-Voca-4.5Mβ2.64 MB(4-bit) &1.38 MB(2-bit) Micro-Transformer TTS (0.00%WER loss vsFP32!).batteryphil/VAULT-PRIMAL-F5-TTS-337Mβ Zero-Shot Voice CloningConvNeXt V2+22L DiTDiffusion TTS (192.0 MB4-bit&138.9 MB2-bitrescued from100%static to6.78%WER).batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL-VLT3β Standalone C99.vlt3Reasoning LLM (680.9 MBV3_Q2_0&1.18 GiBV3_P4_0).- GitHub Source & Reproducible Pipeline:
https://github.com/batteryphil/VAULT-v3-PRIMAL
License
- Upstream Base Weights (
facebook/mms-tts-eng):CC-BY-NC-4.0(Meta AI β Non-Commercial research/personal use). VAULT + PRIMALCode, Loader & Codec: Free (0%) for individuals & non-commercial use;5%profit share for commercial entities when applied to commercially-licensed base checkpoints (seeLICENSEandNOTICE).
- Downloads last month
- 36
Model tree for batteryphil/VAULT-PRIMAL-VITS-29M
Base model
facebook/mms-tts-eng