Repository navigation
feat(backend): rampable windowed Parakeet TDT live leg + config-driven STT connect chain with a Soniox leg (dark in prod) - #15234
Merged
Conversation
… STT connect chain with a Soniox leg, per-leg breakers Everything is dark unless STT_CONNECT_ORDER_FROM_CONFIG=true and PARAKEET_WINDOW_ALLOCATION_PERCENT>0; prod values keep both off, dev turns them on. - Connect-time fallback order derives from STT_SERVICE_MODELS, adds a Soniox leg, passes every leg from every primary branch, never re-walks a failed provider. - New `parakeet-window` streaming token: bounded 6 s windows over /v1/transcribe (TDT 0.6b v3) behind a fail-closed VAD gate, eligible on the user's requested base language, with stable per-uid allocation, a process session cap, one in-flight POST per session and clean overflow to the next leg. - Leg-level circuit breakers, long account-state cooldown (Deepgram 401/402/403, Soniox budget exhaustion), bounded half-open probes, last-resort primary dial. - Live-STT metrics and Grafana rules; stt_live_session/connection_lost join the bounded fallback vocabulary. Implemented by Codex gpt-6-astra from a coordinator plan; verified by re-running the 21-file unit selection (exit 0) outside its sandbox. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
…T chain Independent review (Cursor Grok) plus coordinator findings, all behind the same dark flags: - 18 s window buffer; sustained overload sheds with capacity_full and opens the pod's Parakeet circuit instead of killing sessions that still get 200s. - Last-resort dialing never bypasses an account-state cooldown and never forces a shedding TDT leg. - Fail-closed/forced-active VAD only for the windowed leg; other legs on the configured chain keep today's fail-open gate and honour VAD_GATE_MODE / client override. - Excluded session shapes drop only the parakeet-window token. - Non-terminal leg skips/failures emit degraded + leg-attempt metric; exhausted is emitted once per terminal chain so the #15189 pages stay truthful with the flag on. - Remove the init-terminal critical rule (it would fire immediately in today's prod). - Drain releases admission at once; malformed 200/413/semaphore-queue timeouts are session-local; only 5xx/acquired-POST timeouts feed the serve-error circuit. - Pass window_uid only when the managed chain is on (legacy selector call shape while dark). - Incident-history docstrings moved into utils/stt/ARCHITECTURE.md. Co-Authored-By: Claude Fable 5.1 <[email protected]>
A bare dict spread into get_stt_service_for_language fails pyright; a TypedDict helper keeps the legacy call shape while the configured chain is dark. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Git-on-my-level
marked this pull request as ready for review
September 20, 2026 20:36
This was referenced Sep 21, 2026
Merged
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.
What changed and why
Makes the live
/v4/listenSTT chain trustworthy and adds a rampable, self-hosted primary candidate — all dark in prod (STT_CONNECT_ORDER_FROM_CONFIG=false,PARAKEET_WINDOW_ALLOCATION_PERCENT=0); dev values turn it on.Measured on prod 2026-09-20 (read-only): Modulate is primary by session start but ~94% of its sessions die mid-stream and fail over to Soniox, which carries ~88% of live speech-hours; Deepgram has rejected every handshake with 402 since 09-14; on 09-19 Soniox returned
organization_monthly_budget_exhaustedfor 27 h and live capture failed fleet-wide because the connect-time order is hardcoded[modulate, deepgram, parakeet], Soniox is not a connect-time leg, fallback legs' breakers are never consulted, and 79% of users requestenbut resolvemulti, which makes Parakeet ineligible. The Parakeet/v3/streamleg is dead in prod (served image predates thereadyframe), while/v1/transcribe(TDT 0.6b v3, 25 languages, punctuated) is healthy on GPUs that are ~90% idle.STT_CONNECT_ORDER_FROM_CONFIG): fallback order derives fromSTT_SERVICE_MODELS, adds a Soniox connect leg, passes every leg from every primary branch, never re-walks a failed provider, consults and feeds each leg's breaker, gives account-state failures (Deepgram 401/402/403, Soniox budget/typed rejections) a long cooldown with one probe, allows bounded half-open probes, and dials the primary as a last resort instead of stranding a start.parakeet-windowlive token: bounded 6 s windows over/v1/transcribebehind a fail-closed VAD gate (TDT invents text on noise), eligible on the user's requested base language when resolvedmulti, so English/European users reach TDT and ja/ko/zh/vi fall through to the next token (Soniox). Stable per-uid allocation percent, per-process session cap with overflow to the next leg, one in-flight POST per session, no retries, unconditional slot release.stt_live_session/connection_lostjoin the bounded fallback vocabulary so mid-session failovers stop landing inother.connection_lost/modulate_serve_error/last_resortjoin the bounded fallback reason vocabulary, so mid-session hops stop landing inother; (2) the failover hop'sto_modeandrecord_live_stt_failover_acceptednow name the provider actually adopted after_create_stt_socket, not the one selected. Telemetry only.PARAKEET_WINDOW_ALLOCATION_PERCENTalone controls TDT. With the flag on,stt_selection/exhaustedis emitted once per terminal chain (not per leg), so the feat(backend): alert on live-STT chain exhaustion and conversation fragmentation #15189 exhaustion pages measure real session failure.omi-stt-init-terminal) was removed because prod's initialization-failure ratio is already far above its threshold today.Implemented by Codex
gpt-6-astrafrom a coordinator plan, reviewed by Cursor Grok and the coordinator. Evidence:omi-knowledge-base/projects/parakeet-primary/evidence/2026-09-20-usable-secondary-qualification.md.Product invariants affected
How it was verified
backend/test.sh(1,185 files, 17.4k tests; the only local failures were three files needingfakeredis[lua], green once installed), plusscripts/pr-preflight(39 checks).Tests
New:
backend/tests/unit/test_live_stt_chain.py,backend/tests/unit/test_parakeet_window_live.py(incl.ListenReceiver.initialize_stt→ VAD/send → failed batch POST → serialized rebuild → Soniox transcript path with controlled providers). Updated: session failover, Helm defaults, runtime-env validator, alert-rule contract.Failure class (fixes)
Failure-Class: none
Rollout / rollback
No behaviour change in prod at merge. Dev: windowed TDT → Soniox at 100% allocation, cap 1 session per listen process. Ramp = raise
PARAKEET_WINDOW_ALLOCATION_PERCENT/PARAKEET_WINDOW_MAX_SESSIONSafter dev qualification; rollback = set allocation 0 or the order flag false (env + rollout).🤖 Generated with Claude Code