feat: add VoxCPM TTS engine and update router#13
Merged
minhsaco99 merged 5 commits intomainfrom Jan 24, 2026
Merged
Conversation
- Add VoxCPM engine implementation (app/engines/tts/voxcpm/) - Update TTS router to support synthesis and streaming (app/api/routers/tts.py) - Register VoxCPM in engines.yaml - Add new dev dependencies in pyproject.toml - Add unit tests for VoxCPM engine (100% coverage) - Update TTS router unit tests
minhsaco99
requested changes
Jan 24, 2026
Removed redundant TTSResponseModel and used direct TTSResponse return. Added @field_serializer to TTSResponse for explicit bytes-to-base64 conversion.
minhsaco99
requested changes
Jan 24, 2026
minhsaco99
requested changes
Jan 24, 2026
minhsaco99
approved these changes
Jan 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
This PR implements the VoxCPM TTS (Text-to-Speech) engine specifically aimed at providing high-quality, tokenizer-free speech synthesis with voice cloning capabilities.
Key changes include:
app/engines/tts/voxcpm/implementing theBaseTTSEngineinterface. Supports both batch synthesis and streaming (with low latency).app/api/routers/tts.pyfrom a placeholder stub to a fully functional router that supports:POST /synthesize: Returns base64 encoded WAV audio.POST /synthesize/stream: Server-Sent Events (SSE) streaming of audio chunks.voxcpminengines.yamland added necessary dependencies (voxcpm,torchcodecfor cloning) topyproject.toml.VoxCPMEnginecovering lifecycle, synthesis, streaming, and error edges (Achieved 100% coverage inapp/engines/tts/voxcpm/engine.py).test_tts_router.pyto test the actual router logic instead of expecting 501 errors, aligningtest_tts_router.pycoverage to 100%.Type of Change
Checklist
make format)make lint)make test)Related Issues
Closes #
Testing & Verification
Automated Tests
Manual Verification (if applicable)
Verified that unit tests cover all critical paths including:
API Endpoints Tested (if applicable)
POST /api/v1/stt/transcribeor/tts/synthesize)POST .../stream)WS .../ws)Engine-Specific Tests (if applicable)
Security Impact