OpenAI-compatible TTS wrapper for VoxCPM2, built for Pandrator-style workflows.
This repository is a sibling service to the XTTS wrapper, with a similar API shape and voice upload behavior.
# Windows
run.bat
# Linux / macOS
bash run.sh
# Force CPU
run.bat --cpuThe launcher uses Pixi, installs pinned runtime dependencies, and starts the API at:
http://0.0.0.0:8020
GET /healthGET /v1/modelsPOST /v1/audio/speechGET /v1/audio/voices
Compatibility aliases and fallbacks:
GET /v1/voices(alias)POST /v1/audio/voices(voice upload)POST /v1/files(legacy upload fallback)GET /v1/files(legacy voice discovery fallback)DELETE /v1/voices/{voice_id}(optional cleanup)
GET /v1/models returns VoxCPM2 entries only:
openbmb/VoxCPM2voxcpm2(alias)
Speech requests can use either ID.
POST /v1/audio/speech accepts OpenAI-style fields:
modelinputvoiceresponse_formatspeedinstructions
And VoxCPM extension fields:
voxcpmobject (cfg_value,inference_timesteps,normalize,denoise,retry_badcase, etc.)mode(referenceorhifi)prompt_textcontrol(voice design prompt, prepended as(control)...)
V1 supports wav only. Any other response_format returns a 4xx error.
Upload fields accepted for compatibility:
files(multi-part list)audio_sample(single file)file(legacy single file)
Metadata fields:
voice_idnamepurposeprompt_textmode
Voice data is stored under voices/<voice_id>/ with a meta.json file.
VOXCPM_DEVICE=autoVOXCPM_OPTIMIZE=false(safer default on Windows)VOXCPM_LOAD_DENOISER=falseVOXCPM_DEFAULT_MODEL=openbmb/VoxCPM2- Pixi Python environment pinned to
3.12.* - GPU torch stack pinned to
torch==2.7.1andtorchaudio==2.7.1
FlashAttention wheel install is GPU-aware and community-wheel based:
- enabled by default for Windows CUDA runs (set
VOXCPM_INSTALL_FLASH_ATTN=falseor--skip-flash-attnto disable) - Ada (
sm_89, e.g. RTX 40xx) useslldacing/flash-attention-windows-wheel - Blackwell (
sm_120+, e.g. RTX 50xx) usesmjun0812/flash-attention-prebuild-wheels - unsupported GPU architectures continue with SDPA fallback
- Windows install is wheel-only; no local CUDA compilation step is required
- use
--install-flash-attnto force a reinstall attempt - use
--require-flash-attn(orVOXCPM_REQUIRE_FLASH_ATTN=true) to fail startup when FlashAttention is missing/broken - startup logs always print
FlashAttention status: ...so active state is explicit
Advanced overrides:
VOXCPM_FLASH_ATTN_WHEEL_URL(single override for all GPUs)VOXCPM_FLASH_ATTN_WHEEL_ADAVOXCPM_FLASH_ATTN_WHEEL_BLACKWELL
Community wheel credits:
- https://huggingface.co/lldacing/flash-attention-windows-wheel
- https://github.com/mjun0812/flash-attention-prebuild-wheels
bin\pixi run pytest