Slim local CLI for VoxCPM2 text-to-speech with OpenVINO.
The first stable interface is a JSON command line tool plus an agent Skill:
python -m voxcpm_cli synth --text-file input.txt --jsonModel weights, upstream VoxCPM source scripts, and converted OpenVINO artifacts are
not stored in this slim tree. prepare downloads and converts them explicitly.
Implemented and locally verified:
- JSON CLI entrypoint.
status,prepare, andsynthcommand contracts.- OpenVINO device discovery.
- Structured JSON errors and meaningful process exit codes.
- Output path restriction to the project
output/directory. - Agent Skill instructions in
skills/voxcpm-tts/SKILL.md.
Not yet end-to-end verified:
- Real Hugging Face model download.
- Real OpenVINO conversion.
- Real WAV generation from VoxCPM2.
- Windows.
- Python 3.10, 3.11, or 3.12.
- Enough disk space for the upstream VoxCPM source, original VoxCPM2 weights, and converted OpenVINO files.
- Network access for the first
preparerun.
Runtime dependencies are declared in pyproject.toml:
huggingface-hublibrosanumpyopenvinosoundfiletokenizers
Conversion dependencies are optional and needed when running prepare from a slim checkout:
nncfsafetensorstorch>=2.5.0transformers>=4.36.2
From the project root:
python -m pip install -e .If you need to download and convert the model locally, install the conversion extras:
python -m pip install -e ".[convert]"python -m voxcpm_cli --version
python -m voxcpm_cli status --jsonstatus never downloads or converts model files. It reports whether the expected model directories are ready:
cache/source/VoxCPM/
models/original/VoxCPM2/
models/openvino/VoxCPM2/
Run this only after approving the network and disk use:
python -m voxcpm_cli prepare --jsonUseful options:
python -m voxcpm_cli prepare --json --device AUTO
python -m voxcpm_cli prepare --json --force-convert
python -m voxcpm_cli prepare --json --model-dir models/original/VoxCPM2 --ov-model-dir models/openvino/VoxCPM2prepare downloads the upstream VoxCPM source from https://github.com/OpenBMB/VoxCPM
into cache/source/VoxCPM/, downloads VoxCPM2 files from Hugging Face into
models/original/VoxCPM2/, and converts them into OpenVINO IR under
models/openvino/VoxCPM2/.
Short text:
python -m voxcpm_cli synth --text "你好" --jsonLong text:
python -m voxcpm_cli synth --text-file input.txt --jsonSpecific output path inside output/:
python -m voxcpm_cli synth --text-file input.txt --output output/demo.wav --jsonVoice instruction:
python -m voxcpm_cli synth --text-file input.txt --voice-instruction "温柔、自然、语速适中" --jsonGeneration options:
python -m voxcpm_cli synth --text-file input.txt --cfg-value 2.0 --inference-timesteps 10 --max-len 2000 --device AUTO --jsonSuccessful output is JSON on stdout:
{
"ok": true,
"path": "C:\\project\\voxcpm-cli\\output\\demo.wav",
"sample_rate": 48000,
"format": "wav",
"model": "VoxCPM2 OpenVINO",
"device": "GPU",
"duration_ms": 12345
}Logs and progress are written to stderr. Machine-readable results are written to stdout.
Failure output is also JSON:
{
"ok": false,
"error": {
"code": "MODEL_NOT_READY",
"message": "Run prepare before synth."
}
}Exit codes:
0 success
1 validation error
2 model prepare/load error
3 synthesis error
4 file write error
Common error codes:
NO_TEXT_INPUTINVALID_ARGUMENTINVALID_OUTPUT_PATHMODEL_NOT_READYVOXCPM_SOURCE_DOWNLOAD_FAILEDMODEL_DOWNLOAD_FAILEDMODEL_CONVERSION_FAILEDMODEL_LOAD_FAILEDOPENVINO_DEVICE_UNAVAILABLETTS_GENERATION_FAILEDAUDIO_WRITE_FAILED
Agents should use the local CLI, not a server.
- Run
python -m voxcpm_cli status --json. - If not ready, ask before running
python -m voxcpm_cli prepare --json. - Write long text to a temporary
.txtfile. - Run
python -m voxcpm_cli synth --text-file <file> --json. - Return the WAV path, sample rate, and format.
Do not expose full sensitive text in final replies. Do not download or convert models without explicit approval.