Registry / ai-ml / voxcpm

voxcpm

JSON →
library2.0.2pypypi✓ verified 85d ago

VoxCPM is a tokenizer-free text-to-speech (TTS) model for context-aware speech generation and voice cloning. Version 2.0.2 requires Python >=3.10. It leverages a causal transformer trained on continuous speech representations, enabling expressive and cloned voice outputs without discrete tokens. The library is under active development by OpenBMB.

pip install voxcpm
INSTALL
IMPORT
SIG · VOXCPM
V
voxcpm
ai-mlpythonv2.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VoxCPM
from voxcpm import VoxCPM
import voxcpm
Importing the module directly does not expose the class; use the correct submodule import.

Load the VoxCPM model, generate speech with optional voice cloning from a reference audio file, and save the output.

from voxcpm import VoxCPM import soundfile as sf model = VoxCPM() waveform, sr = model.synthesize("Hello, this is a test of voice cloning.", voice_clone="path/to/ref_audio.wav") sf.write("output.wav", waveform, sr)
Debug
Known issues
gotchaThe `voice_clone` parameter expects a file path to a WAV file. Passing a numpy array or audio buffer will raise a TypeError.
fix
Ensure you provide a file path string to `voice_clone`.
affects: >=2.0.0
gotchaThe model requires significant GPU memory. On a 16GB GPU, batch inference may cause OOM errors.
fix
Reduce batch size or use smaller model variants if available.
affects: all
deprecatedThe `voxcpm.VoxCPM` initialization without explicit `model_path` argument downloads the default model, which is deprecated in favor of explicit model selection.
fix
Specify `model_path='default'` or a custom path to future-proof your code.
affects: >=2.0.0
Errors
Common errors & fixes
TypeError: 'NoneType' object is not callable
The underlying model download failed or was interrupted, leaving the model object as None.
fix
Reinstall the package and ensure a stable internet connection. Clear the cache: `rm -rf ~/.cache/voxcpm` and retry.
RuntimeError: CUDA out of memory. Tried to allocate ... MiB
Insufficient GPU memory for the model or batch.
fix
Reduce batch size, use a smaller model (if available), or run on CPU by setting `device='cpu'`.
FileNotFoundError: [Errno 2] No such file or directory: 'path/to/ref_audio.wav'
The voice cloning reference file path is incorrect or the file does not exist.
fix
Verify the file path and ensure it points to a valid WAV file.
Upgrade
Version history
2.0.2latest on PyPI · released Apr 8, 2026
Audit
Dependencies
torchrequiredRequired for model inference
soundfilerequiredAudio file I/O
librosarequiredAudio processing
transformersoptionalFor model architecture (optional if using custom pipeline)
Agent activity
62 hits · last 30 days
node
56
Perplexity
1
OpenAI (training)
1
Resources