feat(mistralai): add streaming STT support for Voxtral Realtime #4773
+411
−22
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.
Summary
Adds realtime streaming transcription to
livekit-plugins-mistralaiusing Mistral'svoxtral-mini-transcribe-realtime-2602model via the first-party SDK'sRealtimeTranscriptionAPI. The existing batch transcription path is preserved unchanged.Why This Matters
The realtime model streams partial transcription deltas mid-utterance instead of waiting for the full audio, reducing perceived latency. It also addresses the batch model's tendency to hallucinate on silence significantly from our private evals. See #4754 for context.
Changes
stt.py(+470/-12)SpeechStream(stt.RecognizeStream)— fully async streaming viaRealtimeTranscription.transcribe_stream()with 50ms PCM audio chunksFlushSentinel(finalize_delay_ms, default 100ms), plus idle-based finalization (650ms) for the STTNode path whereFlushSentinelis not usedTextDelta→INTERIM_TRANSCRIPT,SegmentDelta/Done→FINAL_TRANSCRIPT, withSTART/END_OF_SPEECHrecognize(), realtime models usestream(). Callingrecognize()with a realtime model raises a clear error_build_capabilities()with graceful fallback foroffline_recognizeacross livekit-agents versionsmodels.pyvoxtral-mini-transcribe-realtime-2602toSTTModelspyproject.tomlmistralai>=1.9.11→mistralai[realtime]>=1.12.0(adds WebSocket support)livekit-agents>=1.4.1→>=1.3.5(no 1.4-specific APIs used; avoids OpenTelemetry version conflict withmistralai==1.12.0)__init__.pySpeechStreamUsage
Testing & Validation
livekit-agents>=1.3.5Closes #4754