Saltar a contenido

openbmbVoxCPM2

VoxCPM

Conditions VoxCPM2 on a reference timbre and exposes its diffusion guidance and step count.

Text to speechVoiceHub-nativevoxcpm2Parameters: 2.3BLanguages: zh, en +28Training: nativeLicense: Checkpoint-specific

Parameter metadata: Exact learned-parameter total for VoiceHub's audited native primary graph at the registered default selection; separately loaded auxiliary models are excluded.

Usage

Complete the VoiceHub installation once, then run this repository-authored example. Model pages intentionally contain no package-install command.

This example is maintained against VoiceHub's public API; it is not copied from an upstream demo or package README.

Model-specific path: Conditions VoxCPM2 on a reference timbre and exposes its diffusion guidance and step count.

Inputs and controls: A prompt transcript is required only with prompt_audio_path; the timbre-only field used here is separate.

from pathlib import Path

from voicehub import AutoModelForTextToSpeech, TTSGenerationConfig

REFERENCE_AUDIO = Path("reference.wav")
REFERENCE_TEXT = "The reference transcript must exactly match the authorized audio."
if not REFERENCE_AUDIO.is_file():
    raise FileNotFoundError(REFERENCE_AUDIO)

model = AutoModelForTextToSpeech.from_pretrained(
    'openbmb/VoxCPM2',
    model_type='voxcpm',
    device="cuda",
    lazy_load=True,
)
output = model.generate(
    'VoiceHub keeps model integrations explicit and reproducible.',
    generation_config=TTSGenerationConfig(
        seed=42,
        output_file=Path("output.wav"),
    ),
    speaker_audio_path=str(REFERENCE_AUDIO),
    cfg_value=2.0,
    inference_timesteps=10,
)
print(output.file_path, output.sample_rate, output.metadata)

Use authorized recordings. Verify hardware needs and pin a revision in production.

Overview

voxcpm is a VoiceHub text to speech integration. This page is generated from its registry contract. Open the voxcpm Colab notebook.

Property Value
Task Text to speech
Architecture voxcpm2
Runtime VoiceHub-native
Languages zh, en, ar, my, … complete audited list below
Capabilities text-to-speech, voice-cloning, voice-design, audio-continuation, multilingual, fine-tuning, safetensors, voicehub-native, native-runtime
Reusable components —
Normalized output TTSOutput

Language support

Supported language abbreviations

zh, en, ar, my, da, nl, fi, fr, de, el, he, hi, id, it, ja, km, ko, lo, ms, no, pl, pt, ru, es, sw, sv, tl, th, tr, vi

Paper and GitHub

Configuration

Load configuration without constructing the model:

from voicehub import AutoConfig

config = AutoConfig.for_model('voxcpm')
print(config.model_type)
Property Value
Canonical model type voxcpm
Configuration class VoxCPMConfig
Architecture class VoxCPMForTextToSpeech

Processing

Create the registered processor without allocating model weights:

from voicehub import AutoProcessor

processor = AutoProcessor.from_pretrained(
    'openbmb/VoxCPM2',
    model_type='voxcpm',
)
print(type(processor).__name__)

Inference

The Usage example returns TTSOutput through AutoModelForTextToSpeech.

Input and output contract

Property Value
Readiness integrated-raw
Data architecture diffusion
Sample rate 16,000 Hz
Contract getter get_tts_dataset_spec('voxcpm')
Variant Required fields One of Boundary Other rules
raw-waveform text audio / waveform Source at most one: audio / waveform; forbidden: audio_features
audio-features text, audio_features — Prepared forbidden: audio, waveform

Conditional flow-matching, rectified-flow, or diffusion data. See the data workflow.

Training and optimization

Use available_optimization_passes() to discover reversible public passes. Unsupported runtime or hardware fails closed before mutation.

Training contract

Property Value
Support native
Family flow-matching
Recipe single-phase
Default phase source_flow_and_stop
Training checkpoint openbmb/VoxCPM2
Native training graph yes
Phase Kind Components Required inputs Loss keys
source_flow_and_stop objective model text_tokens, text_mask, audio_feats, audio_mask, loss_mask, position_ids, labels diffusion_loss, stop_loss

The integration accepts its declared source or prepared contract directly. Call model.validate_training_support() first, then follow the training workflow.

Checkpoints, provenance, license, and limitations

Property Value
Default checkpoint openbmb/VoxCPM2
Hugging Face ID openbmb/VoxCPM2
Repository availability verified through the Hugging Face model API on 2026-08-11; pin a revision before production use.
Checkpoint status Registry default; pin an immutable revision for production and reproducible evidence
Optional dependency extra Core package
Hardware and runtime Usage selects cuda; verify checkpoint-specific requirements
Real-checkpoint evidence Release evidence; a registry default alone is not execution evidence
Implementation voicehub.models.voxcpm.modeling_voxcpm.VoxCPMForTextToSpeech
Configuration voicehub.models.voxcpm.configuration_voxcpm.VoxCPMConfig
Source provenance voicehub/models/voxcpm/source/SOURCE.json
License Checkpoint-specific

No VoiceHub-specific license override is registered. Verify the checkpoint and upstream source terms before use.

Confirm the checkpoint revision, access terms, provenance, and license.

Limitations

  • No integration-specific checkpoint limitation is registered. Verify the selected checkpoint revision and its documented runtime requirements.
  • Validate memory, precision, and optional dependencies on the target system.
  • Public optimizations fail closed when the runtime or hardware cannot satisfy their validation contract; an unavailable pass is not reported as applied.
  • Contract tests do not replace the linked released-checkpoint evidence.

Public API

Use the stable configuration, processor, and task-model facades below.

Configuration

VoxCPMConfig

View source

VoxCPMConfig(**config_kwargs)

Parameters

  • **config_kwargs — Configuration fields validated by VoxCPMConfig.

Model

VoxCPMForTextToSpeech

View source

AutoModelForTextToSpeech.from_pretrained(
    pretrained_model_name_or_path,
    *,
    model_type='voxcpm',
    config=None,
    **model_kwargs,
)

Parameters

  • pretrained_model_name_or_path — Hub ID or compatible local directory.
  • model_type — Canonical model type; use 'voxcpm'.
  • config — Optional preloaded VoxCPMConfig instance.
  • **model_kwargs — Model-specific loading arguments.
from voicehub import get_model_spec

spec = get_model_spec('voxcpm')
print(spec.display_name, spec.task.value)
Purpose Public object
Discover get_model_spec('voxcpm')
Load and run AutoModelForTextToSpeech
Configure VoxCPMConfig
Process AutoProcessor
Model implementation VoxCPMForTextToSpeech
Normalized output TTSOutput
Training contract get_training_spec('voxcpm')
Optimization lifecycle available_optimization_passes, apply_optimization_plan, optimization_manifest, restore_optimization_plan

See all model guides, inference, and the training matrix.