VoxCPM: Tokenizer-Free TTS

repository·main·Indexed 13 days ago

https://github.com/openbmb/voxcpm

A high-performance, tokenizer-free text-to-speech system for context-aware speech generation and high-fidelity voice cloning. VoxCPM2 supports 30 languages and several Chinese dialects with 48kHz output. It features three generation modes: Voice Design (via text descriptions), Controllable Voice Cloning (via reference audio and style instructions), and Ultimate Cloning (via reference audio and transcripts). The system supports SFT and LoRA fine-tuning and provides both a Python API and a CLI.

Tokens
17.3K
Snippets
37
Records
54
Agent score
96%

What's inside VoxCPM

  1. Overview of VoxCPM2

    main

    VoxCPM2 is a tokenizer-free speech synthesis system based on a diffusion autoregressive architecture. It generates continuous speech representations directly, bypassing discrete audio encoding steps to achieve highly natural and expressive speech.

    Built on the MiniCPM-4 base with 2 billion parameters, it was trained on over 2 million hours of multilingual audio.

    Key Capabilities:

    • Multilingual Synthesis: Supports 30 global languages and 9 Chinese dialects via raw text input.
    • Voice Design: Create entirely new voices using natural language descriptions (e.g., gender, age, emotion, speed) without needing reference audio.
    • Controllable Voice Cloning: Clone voices from reference audio clips while applying style instructions to control emotion, speed, and expressiveness.
    • Ultimate Cloning: Provide both reference audio and its transcript for seamless continuation and precise detail reproduction.
    • High-Quality Output: Native 48kHz audio output (using AudioVAE V2) even when input reference audio is 16kHz.
    • Real-time Streaming: Achieves low Real-Time Factor (RTF) on NVIDIA RTX 4090 hardware, especially when accelerated via Nano-vLLM or vLLM-Omni.
  2. Explore the VoxCPM Ecosystem

    main

    VoxCPM has a wide range of community and official integrations for various deployment targets:

    • High-throughput Inference: Nano-vLLM for fast GPU inference.
    • vLLM Integration: vLLM-Omni provides official vLLM multi-modal service with PagedAttention and OpenAI-compatible APIs.
    • C++/Edge Deployment:
      • llama.cpp-omni: Full-duplex multi-modal inference (GGUF support).
      • VoxCPM.cpp: GGML/GGUF for CPU, CUDA, and Vulkan.
      • audio.cpp: Unified C++ inference framework (CPU/CUDA/Vulkan/Metal).
      • VoxCPM-ONNX: ONNX export for CPU inference.
      • VoxCPMANE: Apple Neural Engine backend.
    • Workflow & UI Extensions:
      • ComfyUI nodes: Multiple implementations available (ComfyUI-VoxCPM, ComfyUI_RH_VoxCPM, ComfyUI-VoxCPMTTS).
      • TTS WebUI: Browser-based extension.
  3. VoxCPM2 Performance Benchmarks

    main

    VoxCPM2 is a tokenizer-free TTS model that achieves state-of-the-art or comparable results across several public benchmarks:

    • Seed-TTS-eval: High performance in zero-shot and controllable TTS, with competitive WER (Word Error Rate) and SIM (Similarity) scores in English and Chinese.
    • CV3-eval: Strong multilingual performance across various languages including Chinese, English, Japanese, Korean, German, Spanish, French, Italian, and Russian.
    • MiniMax-Multilingual-Test: Demonstrates high similarity (SIM) and low WER across a wide array of languages, including Arabic, Cantonese, Dutch, Finnish, Greek, Hindi, and more.
    • Internal 30-Language ASR Benchmark: Shows high intelligibility with an average CER/WER of 1.68% across 30 languages (evaluated via Gemini 3.1 Flash Lite API).
    • InstructTTSEval: High scores in instruction-guided voice design, particularly in English (APS, DSD, and RP metrics).
  4. Understand VoxCPM risks and limitations

    main

    When using VoxCPM, be aware of the following:

    • Misuse Warning: Voice cloning can generate highly realistic speech. Use is strictly forbidden for impersonation, fraud, or disinformation. Always mark AI-generated content clearly.
    • Generation Stability: Results for 'Voice Design' and 'Controllable Voice Cloning' can vary. You may need multiple attempts (1–3 runs) to achieve the desired style.
    • Language Support: VoxCPM2 officially supports 30 languages. For unsupported languages, you may need to attempt fine-tuning.
    • License: The model is released under the Apache-2.0 license.
  5. Supported Languages in VoxCPM2

    main

    VoxCPM2 supports 30 languages and several Chinese dialects. It automatically infers the appropriate prosody from the text content.

    Standard 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: 四川话 (Sichuanese), 粤语 (Cantonese), 吴语 (Wu), 东北话 (Northeastern), 河南话 (Henan), 陕西话 (Shaanxi), 山东话 (Shandong), 天津话 (Tianjin), 闽南话 (Hokkien).

  6. Voice Design, Cloning, and Ultimate Cloning via Python API

    main

    VoxCPM supports three main modes of voice generation:

    1. Voice Design: Create a voice from a natural-language description without reference audio. Format the text as "(description)The text to synthesize.".
    2. Controllable Voice Cloning: Provide a reference_wav_path. You can use control instructions in the text (e.g., "(slightly faster, cheerful tone)Text") to adjust style.
    3. Ultimate Cloning: For maximum similarity, provide both prompt_wav_path (the audio) and prompt_text (its transcript). For best results, pass the same file to both prompt_wav_path and reference_wav_path.
    # Ultimate Cloning Example
    wav = model.generate(
        text="This is an ultimate cloning demonstration using VoxCPM2.",
        prompt_wav_path="path/to/voice.wav",
        prompt_text="The transcript of the reference audio.",
        reference_wav_path="path/to/voice.wav",
    )
  7. Understand the VoxCPM2 architecture

    main

    VoxCPM2 utilizes a tokenizer-free, diffusion autoregressive paradigm. It operates within the latent space of AudioVAE V2 using a four-stage pipeline:

    1. LocEnc
    2. TSLM
    3. RALM
    4. LocDiT

    This architecture enables native 48kHz audio output and high expressiveness.

  8. Fine-tune VoxCPM using SFT or LoRA

    main

    VoxCPM supports two fine-tuning methods to adapt the model to specific speakers, languages, or domains using as little as 5–10 minutes of audio:

    1. LoRA fine-tuning: A parameter-efficient method recommended for most users.
    2. Full fine-tuning (SFT): Updates all model parameters.

    You can run training via CLI scripts or use the provided WebUI for a graphical interface.

    For detailed instructions on data preparation, configuration, and LoRA hot-swapping, refer to the Fine-tuning Guide.

    # LoRA fine-tuning (parameter-efficient, 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
    
    # WebUI for training & inference
    python lora_ft_webui.py   # then open http://localhost:7860
  9. Deploy VoxCPM for Production

    main

    Depending on your throughput and deployment needs, choose one of the following:

    1. High Throughput (Nano-vLLM)

    Use nano-vllm-voxcpm for optimized inference with support for concurrent requests and asynchronous APIs. It achieves significantly lower RTF (Real-Time Factor) on NVIDIA hardware.

    2. Multi-tenant/OpenAI Compatible (vLLM-Omni)

    Use vllm-omni for production-grade deployment. It supports PagedAttention, continuous batching, and provides an OpenAI-compatible /v1/audio/speech endpoint.

    3. Edge/Consumer Hardware (llama.cpp-omni)

    Use llama.cpp-omni for C++ based inference on CPU, Metal, CUDA, or Vulkan without a Python runtime. Requires GGUF weights (BaseLM + Acoustic).

    # Nano-vLLM deployment
    pip install nano-vllm-voxcpm
    
    # vLLM-Omni deployment (OpenAI compatible)
    # 1. Install vllm-omni from source
    uv pip install vllm==0.19.0 --torch-backend=auto
    git clone https://github.com/vllm-project/vllm-omni.git && cd vllm-omni
    uv pip install -e .
    # 2. Serve
    vllm serve openbmb/VoxCPM2 --omni --port 8000
    
    # llama.cpp-omni (Edge/C++)
    git clone https://github.com/tc-mb/llama.cpp-omni.git && cd llama.cpp-omni
    cmake -B build -DCMAKE_BUILD_TYPE=Release
    cmake --build build --target voxcpm2-cli -j
    ./build/bin/voxcpm2-cli -t "Hello" -o out.wav VoxCPM2-BaseLM-Q8_0.gguf VoxCPM2-Acoustic-F16.gguf
  10. Fine-tune VoxCPM using LoRA or Full Parameters

    main

    VoxCPM supports both Full Parameter Fine-Tuning (SFT) and LoRA fine-tuning. LoRA is recommended for efficiency, requiring only 5-10 minutes of audio data to adapt to a specific speaker, language, or domain.

    To perform LoRA fine-tuning, use the train_voxcpm_finetune.py script with a LoRA configuration file. For full parameter fine-tuning, use the same script with a full parameter configuration file.

    You can also use a WebUI for training and inference by running lora_ft_webui.py and accessing the interface at http://localhost:7860.

    # LoRA fine-tuning (parameter efficient, recommended)
    python scripts/train_voxcpm_finetune.py \
        --config_path conf/voxcpm_v2/voxcpm_finetune_lora.yaml
    
    # Full parameter fine-tuning
    python scripts/train_voxcpm_finetune.py \
        --config_path conf/voxcpm_v2/voxcpm_finetune_all.yaml
    
    # WebUI training and inference
    python lora_ft_webui.py   # then open http://localhost:7860
  11. Access VoxCPM Documentation

    main

    Comprehensive documentation for VoxCPM is available at voxcpm.readthedocs.io. Key topics include:

    • Quick Start & Installation: Getting started with the project.
    • Usage Guide & Cookbook: Practical recipes and usage patterns.
    • VoxCPM Model Series: Version history and model details.
    • Finetuning: Detailed guides for SFT and LoRA (data preparation, configuration, training, and LoRA hot-swapping).
    • FAQ: Common questions and troubleshooting.
  12. Install VoxCPM

    main

    Install the core package using pip.

    Environment Requirements:

    • Python $\ge$ 3.10 ($<3.13$)
    • PyTorch $\ge$ 2.5.0
    • CUDA $\ge$ 12.0

    If you are in China and need to download models from ModelScope instead of Hugging Face, install modelscope first.

    pip install voxcpm
    # For ModelScope users
    pip install modelscope