Repository navigation
Closed as not planned
Labels
backendBackend Task (python)enhancementNew feature or requestintelligenceLayer: Summaries, insights, action itemsp2Priority: Important (score 14-21)
Description
Context
Deepgram is ~1/3 of infrastructure cost. Modulate (Velma-2) offers competitive pricing with reportedly better quality. Goal: add Modulate as an alternative STT provider (not a replacement for Deepgram), following the existing multi-provider pattern.
Modulate Velma-2 Capabilities
| Feature | Support |
|---|---|
| Streaming (WebSocket) | Yes (/api/velma-2-stt-streaming) |
| Batch (REST) | Yes (/api/velma-2-stt-batch) |
| English-only fast batch | Yes (/api/velma-2-stt-batch-english-vfast) |
| Languages | 70+ |
| Speaker diarization | Yes |
| Audio formats | AAC, AIFF, FLAC, MP3, MP4, MOV, OGG, Opus, WAV, WebM |
| Auth | X-API-Key header (REST), api_key query param (WebSocket) |
| Extras | Emotion detection, accent identification, PII/PHI tagging |
| File size limit | 100MB |
| Pricing | Credit-based with free tier |
Opus support is key — Omi devices stream Opus 32kbps.
Implementation Guide
Follow the existing Deepgram pattern in the codebase:
- Add
modulatetoSTTServiceenum —backend/utils/stt/streaming.py:26 - Create streaming connection function — follow
connect_to_deepgram_with_backoff()pattern instreaming.py:403. Use WebSocket endpoint/api/velma-2-stt-streamingwithapi_keyquery param auth. - Add routing in
transcribe.py— addelif stt_service == STTService.modulate:branches at lines ~853, ~926 (follow deepgram/soniox pattern) - Add language support set — like
soniox_languagesatstreaming.py:42, define supported languages for Modulate - Register in
get_stt_service_for_language()— route appropriate languages to Modulate - Add pre-recorded/batch support —
backend/utils/stt/pre_recorded.py, add batch endpoint integration - Add env var —
MODULATE_API_KEY - Consult Codex for WebSocket message format mapping (Deepgram vs Modulate segment/word format differences)
Scope
- Add as alternative provider, not replacement
- Follow Deepgram code path exactly
- Feature-flag or env-var gated initially
- No changes to existing Deepgram/Soniox/Speechmatics paths
Non-goals
- Removing or changing Deepgram
- Changing default STT provider
- Cost analysis (separate task)
Metadata
Metadata
Assignees
Labels
backendBackend Task (python)enhancementNew feature or requestintelligenceLayer: Summaries, insights, action itemsp2Priority: Important (score 14-21)
Activity
Add Modulate (Velma-2) STT provider: enum, language set, routing, str…
Add Modulate batch transcription: modulate_prerecorded_from_bytes (#5592
Wire Modulate STT into WebSocket transcription router (#5592)
Add unit tests for Modulate STT provider (23 tests) (#5592)
Add test_modulate_stt.py to test runner (#5592)
Add MODULATE_API_KEY to .env.template (#5592)
Add MODULATE_API_KEY to dev ExternalSecret definition (#5592)
Add MODULATE_API_KEY env var to dev backend-listen Helm values (#5592)
Add MODULATE_API_KEY env var to dev pusher Helm values (#5592)
Harden Modulate speaker ID handling: guard against missing/null values (
Harden batch Modulate speaker ID: guard against missing/null/invalid …
Send EOS empty frame before closing Modulate socket to flush final ut…
Pass sample_rate to Modulate streaming URL for correct audio decoding (…
Raise RuntimeError on Modulate batch retry exhaustion instead of sile…
Add sample_rate URL assertion to Modulate connection test (#5592)
Add retry exhaustion, null speaker, and preseconds boundary tests (#5592
Add WAV header wrapper for Modulate streaming WebSocket (#5592)
Add EOS delay before closing Modulate WebSocket (#5592)
Add WAV header and socket wrapper tests (#5592)