VoxCPM2 TensorRT

TensorRT engines of VoxCPM2, made by Moonbox for NVIDIA RTX GPUs. Each precision is one folder holding the engine, trt_runner.py (a small numpy runner: TensorRT plus Polygraphy, no PyTorch) and a script that does the rest of the pipeline. What the engine takes and returns is under How to run.

Compatibility. The engines are built hardware compatible (Ampere and newer: RTX 30, 40 and 50 series) and version compatible (any TensorRT 10.x from 10.13 on, through its lean runtime). That costs a little speed against an engine built for one GPU, but no rebuild is needed. Install the runtime with pip install "tensorrt-cu12>=10.13,<11" "tensorrt-lean-cu12>=10.13,<11" polygraphy numpy.

Files

The last column is the benchmark (details under How to run).

Precision File Size sha256 Benchmark
fp16 fp16/base_lm_0.engine 687.4 MB 59de7ae18264 WER 0.3 % / CER 0.0 % (ONNX fp16 0.3 / 0.0), similarity 0.971 / 0.968 (0.971 / 0.967), DNSMOS 3.05 / 2.07 (3.04 / 2.07); RTF 0.58 (ONNX fp16 0.85 with default settings)
fp16 fp16/base_lm_1.engine 687.6 MB 3f131a0fae4b (the same build: numbers in its first row)
fp16 fp16/base_lm_2.engine 687.5 MB e610208d9246 (the same build: numbers in its first row)
fp16 fp16/base_lm_3.engine 687.5 MB 4d351dc91b3a (the same build: numbers in its first row)
fp16 fp16/base_lm_4.engine 480.1 MB 3f157d2978b7 (the same build: numbers in its first row)
fp16 fp16/base_lm_split.json 3.6 kB 15aebbf4ff69 (the same build: numbers in its first row)
fp16 fp16/device_chain.py 8.3 kB e675d2e7e2d1 (the same build: numbers in its first row)
fp16 fp16/estimator.engine 482.6 MB eb84c01f1d3f (the same build: numbers in its first row)
fp16 fp16/feat_encoder.engine 491.1 MB ea622b6ca270 (the same build: numbers in its first row)
fp16 fp16/fsq.engine 48.9 MB a2a10d2f6862 (the same build: numbers in its first row)
fp16 fp16/fusion.engine 61.3 MB 7e51e8e8005d (the same build: numbers in its first row)
fp16 fp16/heads.engine 78.2 MB 937e2093f260 (the same build: numbers in its first row)
fp16 fp16/multichar_tokens.json 0.2 MB 43263698b2c5 (the same build: numbers in its first row)
fp16 fp16/pipeline.py 9.5 kB 6bee96bae464 (the same build: numbers in its first row)
fp16 fp16/pipeline_trt.py 6.3 kB ad4503dd1934 (the same build: numbers in its first row)
fp16 fp16/residual_lm_0.engine 672.3 MB 3816a1524e06 (the same build: numbers in its first row)
fp16 fp16/residual_lm_1.engine 255.3 MB fc59189ab781 (the same build: numbers in its first row)
fp16 fp16/residual_lm_split.json 1.0 kB a126ce7fd2be (the same build: numbers in its first row)
fp16 fp16/text_embed.engine 345.2 MB 4676bdf1fefa (the same build: numbers in its first row)
fp16 fp16/tokenizer.json 3.7 MB f8984687e4a9 (the same build: numbers in its first row)
fp16 fp16/trt_runner.py 4.4 kB cbc9abb1f59c (the same build: numbers in its first row)
fp16 fp16/vae_decoder.engine 164.4 MB 8ca2b84546df (the same build: numbers in its first row)
fp16 fp16/vae_encoder.engine 161.8 MB 85f6e05b5aae (the same build: numbers in its first row)

How to run

VoxCPM2 (OpenBMB's tokenizer-free speech generator: voice cloning from a reference recording and its transcript, English and Chinese, 48 kHz output) as TensorRT engines built from this model's fp16 ONNX graphs, plus pipeline_trt.py. The pipeline is the ONNX build's pipeline.py (voxcpm 2.0.3's VoxCPM.generate with its defaults: 10 Euler steps of the local diffusion transformer, classifier-free guidance 2.0 with CFG-zero*, at most 6 x the text's tokens + 10 patches, no retry) with every graph run as engines.

python fp16/pipeline_trt.py "The quick brown fox jumps over the lazy dog." out.wav --ref voice.wav \
    --ref-text "Exactly what is said in voice.wav." --seed 0
import sys, soundfile as sf
sys.path.insert(0, "fp16")
from pipeline_trt import VoxCPM2Trt
tts = VoxCPM2Trt("fp16")
ref, sr = sf.read("voice.wav", dtype="float32")
wav, out_sr = tts("Text to say.", ref, sr, "Transcript of voice.wav.", seed=0)      # 48 kHz

It needs numpy, tokenizers, soundfile, soxr, TensorRT 10.13 (tensorrt-cu12 or tensorrt-lean-cu12) and Polygraphy. No PyTorch and no ONNX Runtime. The engines are version-compatible and built for Ampere or newer GPUs (RTX 30-series and up). They hold 6.0 GB, and the benchmark's process peaked at 8.8 GB of memory, GPU memory included. The diffusion noise comes from numpy's generator, as in the ONNX build: a seed gives the same speech every run here, not the same speech as PyTorch with that seed. Pass normalised text: the original's text normalisation isn't included.

The engines. Together they compute the ONNX fp16/ graphs, with the changes under Precisions.

  • base_lm_0..4.engine: the MiniCPM4 base language model (28 layers): inputs_embeds [1, S, 2048] (fp16), past_key / past_value [28, 1, 2, P, 128] (fp16) -> hidden [1, S, 2048] and present_key / present_value [28, 1, 2, P + S, 128]. residual_lm_0..1.engine: the 8-layer residual LM, the same way. base_lm_split.json / residual_lm_split.json give the order of the pieces and the tensors passed between them. Each model is cut into pieces of at most 0.7 GB of weights, so that each engine builds within the build machine's memory.
  • estimator.engine (the local diffusion transformer), feat_encoder.engine, text_embed.engine, fsq.engine, fusion.engine, heads.engine: as the ONNX graphs of those names.
  • vae_encoder.engine / vae_decoder.engine: the audio VAE, run in windows of 64 latent frames: 48 new frames after 16 frames of left context, whose output is dropped. Both halves of the VAE are causal, so the windows give what one pass over the whole input would: 85.7 dB (encoder) and 63.7 dB (decoder) from one pass, measured on the ONNX graphs. The windows keep the engines' working memory small and put no limit on the length of the reference or the output.

Limits. One language-model call takes up to 512 positions (the prompt: reference audio, transcript, text and the continuation patches) and the cache holds up to 2,048 (the prompt plus the generated patches; 4 latent frames, 160 ms of speech, a patch). Longer prompts or outputs raise an error instead of being cut.

On the GPU. The pipeline (device_chain.py) keeps both language models' KV caches on the GPU: each call reads one set of buffers and writes the longer cache into the other, so a step allocates nothing. The activations between the pieces of a model never leave the GPU either, and the pieces share one working-memory buffer.

Precisions. fp16/ is strongly typed: every tensor keeps the precision the ONNX graph gives it, with one change. Five graphs (feat_encoder, estimator, text_embed, fsq, fusion) store fp16 weights and cast them to fp32 where they are used. TensorRT would fold those casts into fp32 copies, twice the memory. Here the embedding lookup reads the fp16 table and casts what it reads (exact), and the matrix products run in fp16 from the fp16 weights (TensorRT's fp16 products accumulate in fp32). Those five graphs stay within 53-74 dB of the published ONNX graphs. The language models need no change: their RMSNorms and softmax are already fp32 in the graphs. No int8: TensorRT's int8 needs calibrated activations, and the ONNX int8 / int4 builds are weight-only MatMulNBits, which TensorRT doesn't take.

Benchmark.

  • Setup: the ONNX build's benchmark. The lab's TTS set: 6 English sentences cloned from a LibriSpeech test-clean prompt and 4 Chinese sentences from an AISHELL-1 prompt, each with seeds 0-3 (40 clips per build), the original's settings. RTX 3080 Laptop GPU, whole pipeline.
  • Score: sampled speech can't be compared sample by sample, so each build is judged as the original is. Whisper large-v3-turbo's WER (English) or CER (Chinese) against the text, WavLM-base-plus-sv speaker similarity to the prompt, and DNSMOS (P.835 overall). Real-time factor is processing time / audio time.
  • Pass mark (set before the first run): against the ONNX fp16 build, per language, error rate at most 2 points higher, similarity at most 0.03 lower, DNSMOS at most 0.2 lower.
English WER similarity DNSMOS Chinese CER similarity DNSMOS Real-time factor
ONNX fp16/ (ONNX Runtime CUDA) 0.3 % 0.971 3.04 0.0 % 0.967 2.07 1.44
TensorRT fp16/ 0.3 % 0.971 3.05 0.0 % 0.968 2.07 0.58

The ONNX row is this test's own run of the published fp16/ folder. To fit next to other jobs on the test machine, it opened the five graphs above without ONNX Runtime's graph optimizations, whose constant folding expands their weights to fp32. Their outputs stay within 60-78 dB of the optimized sessions', but that run is slower: the ONNX build's own benchmark (default settings) measured a real-time factor of 0.85. The original (PyTorch bf16) scores 0.0 % / 0.976 / 3.07 and 0.0 % / 0.965 / 2.29 on the same set. The engines load on first use, so the first clip's time includes the loading.

How these were made

From VoxCPM2 at revision 7936080b41: each engine was built with TensorRT's builder from Moonbox's published ONNX graph of the same model and precision. The network is strongly typed: every tensor keeps the precision the ONNX graph gives it, so an fp16 engine computes what the fp16 ONNX build computes. Built on an RTX 3080 Laptop GPU, it was benchmarked against the original before upload, and the sha256 column above is what the files must hash to.

License

Apache-2.0. These files are a derivative of the original model and carry its license: it is copied in this repository, and it governs your use of these files. The original model card follows unchanged.


Original model card

VoxCPM2

VoxCPM2 is a tokenizer-free, diffusion autoregressive Text-to-Speech model β€” 2B parameters, 30 languages, 48kHz audio output, trained on over 2 million hours of multilingual speech data.

GitHub Docs Demo Audio Samples Discord Lark MiniCPM Wiki

Highlights

  • 🌍 30-Language Multilingual β€” No language tag needed; input text in any supported language directly
  • 🎨 Voice Design β€” Generate a novel voice from a natural-language description alone (gender, age, tone, emotion, pace…); no reference audio required
  • πŸŽ›οΈ Controllable Cloning β€” Clone any voice from a short clip, with optional style guidance to steer emotion, pace, and expression while preserving timbre
  • πŸŽ™οΈ Ultimate Cloning β€” Provide reference audio + its transcript for audio-continuation cloning; every vocal nuance faithfully reproduced
  • πŸ”Š 48kHz Studio-Quality Output β€” Accepts 16kHz reference; outputs 48kHz via AudioVAE V2's built-in super-resolution, no external upsampler needed
  • 🧠 Context-Aware Synthesis β€” Automatically infers appropriate prosody and expressiveness from text content
  • ⚑ Real-Time Streaming β€” RTF as low as ~0.3 on NVIDIA RTX 4090, and ~0.13 accelerated by Nano-VLLM
  • πŸ“œ Fully Open-Source & Commercial-Ready β€” Apache-2.0 license, free for commercial use
Supported Languages (30)

Arabic, Burmese, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Indonesian, Italian, Japanese, Khmer, Korean, Lao, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, Tagalog, Thai, Turkish, Vietnamese

Chinese Dialects: 四川话, η²€θ―­, 吴语, δΈœεŒ—θ―, 河南话, ι™•θ₯Ώθ―, 山东话, 倩ζ΄₯话, 闽南话

Quick Start

Installation

pip install voxcpm

Requirements: Python β‰₯ 3.10, PyTorch β‰₯ 2.5.0, CUDA β‰₯ 12.0 Β· Full Quick Start β†’

Text-to-Speech

from voxcpm import VoxCPM
import soundfile as sf

model = VoxCPM.from_pretrained("openbmb/VoxCPM2", load_denoiser=False)

wav = model.generate(
    text="VoxCPM2 brings multilingual support, creative voice design, and controllable voice cloning.",
    cfg_value=2.0,
    inference_timesteps=10,
)
sf.write("output.wav", wav, model.tts_model.sample_rate)

Voice Design

Put the voice description in parentheses at the start of text, followed by the content to synthesize:

wav = model.generate(
    text="(A young woman, gentle and sweet voice)Hello, welcome to VoxCPM2!",
    cfg_value=2.0,
    inference_timesteps=10,
)
sf.write("voice_design.wav", wav, model.tts_model.sample_rate)

Controllable Voice Cloning

# Basic cloning
wav = model.generate(
    text="This is a cloned voice generated by VoxCPM2.",
    reference_wav_path="speaker.wav",
)
sf.write("clone.wav", wav, model.tts_model.sample_rate)

# Cloning with style control
wav = model.generate(
    text="(slightly faster, cheerful tone)This is a cloned voice with style control.",
    reference_wav_path="speaker.wav",
    cfg_value=2.0,
    inference_timesteps=10,
)
sf.write("controllable_clone.wav", wav, model.tts_model.sample_rate)

Ultimate Cloning

Provide both the reference audio and its exact transcript for maximum fidelity. Pass the same clip to both reference_wav_path and prompt_wav_path for highest similarity:

wav = model.generate(
    text="This is an ultimate cloning demonstration using VoxCPM2.",
    prompt_wav_path="speaker_reference.wav",
    prompt_text="The transcript of the reference audio.",
    reference_wav_path="speaker_reference.wav",
)
sf.write("hifi_clone.wav", wav, model.tts_model.sample_rate)

Streaming

import numpy as np

chunks = []
for chunk in model.generate_streaming(text="Streaming is easy with VoxCPM!"):
    chunks.append(chunk)
wav = np.concatenate(chunks)
sf.write("streaming.wav", wav, model.tts_model.sample_rate)

Model Details

Property Value
Architecture Tokenizer-free Diffusion Autoregressive (LocEnc β†’ TSLM β†’ RALM β†’ LocDiT)
Backbone Based on MiniCPM-4, totally 2B parameters
Audio VAE AudioVAE V2 (asymmetric encode/decode, 16kHz in β†’ 48kHz out)
Training Data 2M+ hours multilingual speech
LM Token Rate 6.25 Hz
Max Sequence Length 8192 tokens
dtype bfloat16
VRAM ~8 GB
RTF (RTX 4090) ~0.30 (standard) / ~0.13 (Nano-vLLM)

Performance

VoxCPM2 achieves state-of-the-art or competitive results on major zero-shot and controllable TTS benchmarks.

See the GitHub repo for full benchmark tables (Seed-TTS-eval, CV3-eval, InstructTTSEval, MiniMax Multilingual Test).

Fine-tuning

VoxCPM2 supports both full SFT and LoRA fine-tuning with as little as 5–10 minutes of audio:

# LoRA fine-tuning (recommended)
python scripts/train_voxcpm_finetune.py \
    --config_path conf/voxcpm_v2/voxcpm_finetune_lora.yaml

# Full fine-tuning
python scripts/train_voxcpm_finetune.py \
    --config_path conf/voxcpm_v2/voxcpm_finetune_all.yaml

See the Fine-tuning Guide for full instructions.

Limitations

  • Voice Design and Style Control results may vary between runs; generating 1–3 times is recommended to obtain the desired output.
  • Performance varies across languages depending on training data availability.
  • Occasional instability may occur with very long or highly expressive inputs.
  • Strictly forbidden to use for impersonation, fraud, or disinformation. AI-generated content should be clearly labeled.

Citation

@article{voxcpm2_2026,
  title   = {VoxCPM2: Tokenizer-Free TTS for Multilingual Speech Generation, Creative Voice Design, and True-to-Life Cloning},
  author  = {VoxCPM Team},
  journal = {GitHub},
  year    = {2026},
}

@article{voxcpm2025,
  title   = {VoxCPM: Tokenizer-Free TTS for Context-Aware Speech Generation and True-to-Life Voice Cloning},
  author  = {Zhou, Yixuan and Zeng, Guoyang and Liu, Xin and Li, Xiang and
             Yu, Renjie and Wang, Ziyang and Ye, Runchuan and Sun, Weiyue and
             Gui, Jiancheng and Li, Kehan and Wu, Zhiyong and Liu, Zhiyuan},
  journal = {arXiv preprint arXiv:2509.24650},
  year    = {2025},
}

License

Released under the Apache-2.0 license, free for commercial use. For production deployments, we recommend thorough testing and safety evaluation tailored to your use case.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for moonbox-dev/VoxCPM2-TensorRT

Base model

openbmb/VoxCPM2
Quantized
(35)
this model

Paper for moonbox-dev/VoxCPM2-TensorRT