Repository navigation
Description
Summary
Upgrade the existing Parakeet ASR integration from opt-in streaming prototype to production-grade provider covering both streaming and batch paths, with proper GPU deployment and native diarization. Target: replace Deepgram for primary STT at 100-200x lower cost.
Cost justification
Current Deepgram spend (May 2026, from mon):
- Gross: $40,175/mo | Net (with 1:1 match credits): $20,088/mo
- Usage: 68,081 hrs/mo (50,887 streaming + 17,194 batch)
- Rate breakdown: base $28K + diarize $6.1K + keyterm $5.4K + multilingual $0.6K
- ASR = 19.8% of total backend costs ($101.6K/mo)
- Match credits will expire — gross becomes actual bill
Self-hosted Parakeet estimate:
- 68,081 hrs/mo at
$0.002/hr = **$136/mo** compute - L4 GPU instance: $350-500/mo (existing GKE has a T4 at $1,204/mo that could potentially be reused)
- Projected savings: $19K-39K/mo depending on credit expiry timing
Current state (already in main)
What exists
-
Streaming socket (
utils/stt/streaming.py:780-1013):ParakeetStreamingSocketimplements theSTTSocketABC. Buffers PCM16 in 6s windows, POSTs to/v1/transcribe, returns segment dicts. Online speaker diarization via embedding-based greedy clustering (cosine threshold 0.45). -
Parakeet microservice (
backend/parakeet/): FastAPI service loading NeMoparakeet-tdt-0.6b-v3(multilingual, 25 European languages). Single endpointPOST /v1/transcribeaccepts WAV file upload, returns{text, segments[{text, start, end}]}. Auth viaENCRYPTION_SECRETbearer token. Dockerfile with CUDA 13.2 runtime. -
Routing (
routers/transcribe.py:358-359): Opt-in only — client must requeststt_service=parakeetANDHOSTED_PARAKEET_API_URLmust be set. Never auto-switches from Deepgram. -
STTService enum (
streaming.py:39):parakeetis already a member alongsidedeepgramandmodulate.
What's missing for production
-
No
PrerecordedSTTProviderimplementation — Parakeet has no batch path. Thepre_recorded.pyfactory only routes to Deepgram or Modulate. 9 callsites use batch transcription:utils/chat.py(6 callsites): voice messages, desktop PTT, desktop transcribeutils/conversations/postprocess_conversation.py(1): re-transcriptionrouters/sync.py(1): sync-local-filesutils/speaker_sample.py(1): speaker sample verification
-
No NIM container deployment — current Dockerfile uses raw NeMo (
nemo_toolkit[asr]), not the production-optimized NVIDIA NIM container (nvcr.io/nim/nvidia/parakeet-1-1b-rnnt-multilingual) which includes TensorRT + Triton for higher throughput. -
No native diarization — Parakeet returns no speaker labels. Current workaround embeds each segment via external
HOSTED_SPEAKER_EMBEDDING_API_URLand does greedy clustering. This adds latency and depends on a separate service. Nemotron 3.5 ASR (0.6B, June 2026) may include native diarization — needs investigation. -
No language routing in factory —
get_stt_service_for_language()has no Parakeet entry. It can't be selected viaSTT_SERVICE_MODELSenv var like Deepgram/Modulate — only via explicit client opt-in. -
Model outdated — currently loads
parakeet-tdt-0.6b-v3(25 European languages). Nemotron 3.5 ASR 0.6B supports 40 languages including Vietnamese and Mandarin with 80ms streaming latency and native punctuation — better fit for Omi's multilingual user base.
Proposed work
Phase 1: Batch path + factory routing
- Implement
ParakeetPrerecordedProvider(implementsPrerecordedSTTProviderABC) - Add
parakeetrouting toget_prerecorded_service()andget_stt_service_for_language() - Support
STT_SERVICE_MODELS=parakeetandSTT_PRERECORDED_MODEL=parakeetenv vars - All 9 batch callsites work without code changes (provider-agnostic ABC)
Phase 2: NIM container deployment
- Switch from raw NeMo Dockerfile to NVIDIA NIM container (
nvcr.io/nim/nvidia/parakeet-1-1b-rnnt-multilingual) - TensorRT optimization for ~238x real-time throughput on L4
- Evaluate: deploy on existing GKE GPU node pool vs new dedicated instance
- Health checks, autoscaling, resource limits
Phase 3: Model upgrade + diarization
- Evaluate Nemotron 3.5 ASR 0.6B (40 languages, native punctuation, 80ms streaming)
- Investigate native speaker diarization support — if absent, integrate NeMo MSDD or pyannote as sidecar
- Test CJK character handling (Deepgram splits with spaces — Parakeet behavior unknown)
- Test code-switching quality (language mixing within utterance)
Phase 4: Gradual rollout
- A/B test via
STT_SERVICE_MODELS=parakeet,dg-nova-3(Parakeet primary, DG fallback) - Monitor: WER, first-segment latency (<10s target, <30s max), diarization accuracy
- Track DG usage decline → eventual deprecation of DG as primary
Architecture reference
STTSocket (ABC) PrerecordedSTTProvider (ABC)
├─ SafeDeepgramSocket ├─ DeepgramPrerecordedProvider
├─ SafeModulateSocket ├─ ModulatePrerecordedProvider
└─ ParakeetStreamingSocket ✅ └─ ParakeetPrerecordedProvider ❌ (missing)
Streaming factory: Batch factory:
get_stt_service_for_language() get_prerecorded_service()
→ STT_SERVICE_MODELS env var → STT_PRERECORDED_MODEL env var
→ routes: dg-nova-3, modulate → routes: dg-nova-3, modulate
→ parakeet: opt-in only ⚠️ → parakeet: not supported ❌
Environment variables (current)
| Var | Default | Purpose |
|---|---|---|
HOSTED_PARAKEET_API_URL |
(unset) | Parakeet service URL |
PARAKEET_WINDOW_SECONDS |
6.0 | Streaming buffer window |
PARAKEET_DIARIZATION |
1 | Enable embedding-based diarization |
PARAKEET_MODEL |
nvidia/parakeet-tdt-0.6b-v3 | NeMo model name |
HOSTED_SPEAKER_EMBEDDING_API_URL |
(unset) | Required for Parakeet diarization |
Open questions
- Does Nemotron 3.5 ASR support speaker diarization natively? If not, what's the best sidecar (NeMo MSDD vs pyannote)?
- NIM container vs raw NeMo — latency/throughput benchmarks on L4?
- Where to host GPU workload — existing GKE T4 node pool ($1,204/mo already running) or new L4 instance?
- Code-switching quality (e.g. Vietnamese-English mixing) — Parakeet is reportedly weak here vs Modulate
- CJK tokenization — how does Parakeet handle word boundaries for Chinese/Japanese/Korean?
Best model candidates (from geni research)
| Model | Languages | WER | Speed | Params | Notes |
|---|---|---|---|---|---|
| Nemotron 3.5 ASR 0.6B | 40 (incl. vi, zh) | — | 80ms streaming | 0.6B | Recommended — native punctuation, CC-BY-4.0 |
| Parakeet-TDT-0.6b-v2 | English only | 6.05% | 3386x RT | 0.6B | Best English accuracy |
| Parakeet-TDT-0.6b-v3 | 25 European | 6.32% | — | 0.6B | Currently loaded in main |
Related
- PR feat(stt): add Modulate Velma-2 as second STT provider (#7140) #7142 — Modulate Velma-2 provider (same ABC pattern)
backend/parakeet/— existing microservicebackend/diarizer/— existing pyannote speaker diarization service
Status Update (2026-06-09)
Solved ✅ (PR #7653)
| Feature | Status |
|---|---|
Batch ASR (/v1/transcribe) |
✅ Prod — TDT 0.6b, 0.1% WER, full punctuation |
Batch + diarization (/v2/transcribe) |
✅ Prod — built-in pyannote/wespeaker on GPU |
Streaming ASR (/v3/stream) |
✅ Prod (opt-in) — RNNT 1.1b, 5s segments, AGC |
| Pre-recorded routing | ✅ Prod — STT_PRERECORDED_MODEL=parakeet,dg-nova-3 with language fallback |
| Backend integration | ✅ ParakeetPrerecordedProvider + ParakeetWebSocketSocket |
| Language fallback | ✅ Parakeet for 25 EU langs, auto-fallback to Deepgram for CJK/Hindi/Korean |
| BF16 dual-model on L4 GPU | ✅ TDT + RNNT in 12.6Gi/20Gi |
| GPU concurrency safety | ✅ Semaphore serializes CUDA access |
| Helm chart + GitHub Actions workflow | ✅ gcp_parakeet.yml |
| E2E device test (Omi BLE → app UI) | ✅ Verified on Pixel 7a |
Remaining
| Feature | Priority | Details |
|---|---|---|
| Streaming as default | HIGH | Needs punctuation fix (RNNT outputs lowercase). Plan: interim RNNT → final TDT re-transcribe |
| Request batching | HIGH | Current: 1-at-a-time (semaphore). Target: batch_size=4-8 for ~4x throughput |
| NeMo thread-safety fix | HIGH | NeMo #15771 — model.transcribe() freeze/unfreeze race confirmed as bug, not intentional. New OSS ASR worker patching upstream |
| Split batch/stream semaphores | MEDIUM | Batch and streaming currently block each other |
| NIM or Triton migration | MEDIUM | Raw NeMo + FastAPI is prototype-grade per NVIDIA. NIM handles batching, streaming, concurrency natively |
| Nemotron Speech 0.6B | LOW | Half memory vs RNNT 1.1b, designed for streaming, better concurrent support |
| TensorRT export | LOW | ~2x faster inference, ~50% less memory |
Prod Metrics (T+24h, stable)
- 7,005 requests served, 0% error rate (post-semaphore fix)
- v1=2.88s, v2=8.65s latency
- 0 pod restarts, 13.0Gi memory (no leak)
Activity
beastoin commentedon Jun 5, 2026
@thainguyensunya @kodjima33 fyi
beastoin commentedon Jun 5, 2026
@Kelvin in the meantime pls share your experience on stt benchmark here it would be a great help.
beastoin commentedon Jun 5, 2026
STT Benchmark Experience from PR #7142 (Modulate Velma-2 Integration)
Sharing methodology, tooling, and results from benchmarking Deepgram nova-3 vs Modulate Velma-2 across streaming and pre-recorded paths. This should help evaluate Parakeet/Nemotron against the same criteria.
Benchmark Tooling (all in
backend/scripts/stt/)o_benchmark_02_streaming.pyn_benchmark_02_prerecorded.pys_benchmark_prerecorded_api.pySTT_PRERECORDED_MODELroutingt_benchmark_multilang.pyAudio files: GCS download (English) + multi-lang
English Results (12 LibriSpeech samples, 2-27s, 12 speakers)
Both are production-quality on English. DG is faster to first transcript; Modulate connects faster.
Multi-language Results (8 languages)
*WER inflated by DG's character-level tokenization — content is correct but differently formatted.
**DG Korean: 0% pre-recorded, 29% streaming.
Code-switching Results (mixed-language audio)
Key finding: Deepgram tends to lock onto one language and drop/mistranscribe others. Modulate preserves all language segments.
What to Benchmark for Parakeet/Nemotron
Based on our experience, the critical evaluation axes for a new ASR provider:
Architecture Note
PR #7142 built the provider-agnostic architecture for both paths:
STTSocketABC → implementsend(),finish(),finalize(),is_connection_deadPrerecordedSTTProviderABC → implementtranscribe_url(),transcribe_bytes()I see from this issue that
ParakeetStreamingSocketalready exists in main — it implementsSTTSocket. The pre-recorded path viaPrerecordedSTTProviderwould be the new piece needed.by AI for @beastoin
Huaian666 commentedon Jun 6, 2026
this handles the happy path and the sad path equally well. most tools only test the happy path. you can tell this has been battle tested.
feat: production-grade Parakeet/Nemotron ASR — batch provider, NIM de…
beastoin commentedon Jun 8, 2026
Parakeet ASR — Production Status Update (2026-06-08)
Live in Prod ✅
PR #7653 merged and deployed. Parakeet serving real batch transcription traffic.
Config:
STT_PRERECORDED_MODEL=parakeet,dg-nova-3— Parakeet for EU languages, Deepgram fallback for CJK. Streaming stays on Deepgram (STT_SERVICE_MODELS=dg-nova-3).Why NeMo is Prototype-Grade — NVIDIA NIM is the Production Path
Deep research (full report) found that raw NeMo + FastAPI is not recommended by NVIDIA for production:
model.transcribe()is NOT thread-safe (NeMo #13988) — mutates shared state (freeze/unfreeze, preprocessor config) with no locking. We hit this in prod: 33 concurrent requests → CUDA crash → 2,103 500s. Fixed with GPU semaphore (max 1 concurrent), but throughput is limited.Known GPU memory leak (NeMo #5755) — closed as "not planned". Long-running NeMo services accumulate memory.
No built-in batching/queuing — we serialize requests 1-at-a-time. Production ASR needs request aggregation with dynamic batching.
CUDA graph corruption (NeMo #15423) — TDT models with CUDA graphs permanently corrupt
torch.load()process-wide.NVIDIA's recommended production stack:
dynamic_batchingconfigCurrent Architecture vs Target
Current (NeMo, working but limited):
Target (NIM or Triton):
Next Steps
by AI for @beastoin
beastoin commentedon Jul 23, 2026
Closing as done — batch path landed via PR #7653. Streaming and auto-routing remain future work.