Skip to content

Add Modulate (Velma-2) as alternative STT provider #5592

Closed as not planned
Closed as not planned

Description

@beastoin

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.

API docs: https://www.modulate-developer-apis.com/web/docs.html

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:

  1. Add modulate to STTService enum — backend/utils/stt/streaming.py:26
  2. Create streaming connection function — follow connect_to_deepgram_with_backoff() pattern in streaming.py:403. Use WebSocket endpoint /api/velma-2-stt-streaming with api_key query param auth.
  3. Add routing in transcribe.py — add elif stt_service == STTService.modulate: branches at lines ~853, ~926 (follow deepgram/soniox pattern)
  4. Add language support set — like soniox_languages at streaming.py:42, define supported languages for Modulate
  5. Register in get_stt_service_for_language() — route appropriate languages to Modulate
  6. Add pre-recorded/batch support — backend/utils/stt/pre_recorded.py, add batch endpoint integration
  7. Add env var — MODULATE_API_KEY
  8. 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)

Activity

  1. added
    enhancement
    backend
    intelligence
    p2
    on Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendenhancementintelligencep2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions