Speech to Text (STT)
Stream audio to a speech recognition model and receive transcripts over the /v1/realtime WebSocket
Dynamo serves speech to text, also called automatic speech recognition (ASR),
through the OpenAI Realtime API. A client opens a WebSocket to /v1/realtime,
starts a transcription session, streams audio, and receives transcript events
while it is still sending. Dynamo does not expose a REST
/v1/audio/transcriptions endpoint.
Realtime transcription is experimental. The vLLM path was validated with English audio.
Choose a Backend
SGLang, TensorRT-LLM, and vLLM-Omni do not serve transcription sessions.
vLLM-Omni serves audio-in, audio-out models through session.type="realtime";
see Speech-to-Speech.
vLLM
Nemotron Speech NIM
Set up vLLM as described in
Voice Pipelines › Set up the backend.
The worker resamples the 24 kHz input stream with scipy, which is one of vLLM’s
audio dependencies.
Launch
The launcher starts python -m dynamo.frontend and a vLLM worker with
--realtime. The frontend listens on DYN_HTTP_PORT (default 8000). The default
model is Qwen/Qwen3-ASR-0.6B, and for that model the launcher selects the
Qwen3ASRRealtimeGeneration architecture for you. Other arguments pass through to
the vLLM worker.
To serve another model, name its realtime architecture explicitly. The launcher
exits with an error if --hf-overrides is missing for a non-default model:
The worker refuses to start if the model does not implement vLLM’s
SupportsRealtime interface. --realtime (DYN_VLLM_REALTIME) requires an
aggregated worker and cannot be combined with --embedding-worker,
--classify-worker, multimodal worker flags, --enable-lora, --headless, or
--enable-rl.
Stream Audio
In another terminal, stream a speech file with the bundled client. Use a file longer than five seconds to see incremental results:
--model must match the name the worker serves. The client converts the file to
24 kHz mono PCM16, sends it in 100 ms chunks (--chunk-ms) at real-time pace, and
prints events as they arrive. A successful run prints delta before commit: True.
Without --input-audio, the client downloads a short sample clip. The client
needs aiohttp and numpy; install soundfile to read formats other than
16-bit PCM WAV.
Limits
The vLLM worker rejects a session.update that asks for anything it does not
support, and replies with an error event:
Each input_audio_buffer.append chunk must decode to 4 MiB or less of 16-bit
PCM, and one utterance can hold at most 60 seconds of audio. The worker
runs one transcription at a time per connection and queues at most one more.
The worker feeds audio to vLLM in 100 ms blocks. How often partial text arrives depends on the model.
Protocol
A transcription session follows the OpenAI Realtime API event names:
- The frontend sends
session.createdas soon as the WebSocket opens. - The client sends
session.updatewith"type": "transcription". The frontend readssession.audio.input.transcription.modelto pick a worker and forwards the event to it. An unknown or unavailable model produces anerrorevent with codemodel_not_foundormodel_unavailable, and the connection stays open so the client can send a correctedsession.update. The worker replies withsession.updated. - The client sends audio as base64 PCM16 in
input_audio_buffer.appendevents. Frames must be JSON text; binary WebSocket frames are not supported. - The client sends
input_audio_buffer.committo end the utterance. The worker replies withinput_audio_buffer.committed. - The worker sends
conversation.item.input_audio_transcription.deltaevents as text is recognized, thenconversation.item.input_audio_transcription.completedwith the fulltranscriptand tokenusage. If transcription fails, it sendsconversation.item.input_audio_transcription.failedinstead.
input_audio_buffer.clear discards the audio buffered for the current utterance
and returns input_audio_buffer.cleared.
A minimal session.update:
Use realtime_audio_client.py
as the reference client implementation.
Related Guides
- Voice Pipelines: connect ASR to an LLM and TTS.
- Speech-to-Speech: one model that takes and returns audio.
- vLLM multimodal guide:
ask questions about audio with an audio-capable chat model through
audio_urlin/v1/chat/completions.