DeepInfra raises $107M Series B to scale the inference cloud — read the announcement

nvidia logo

nvidia/

Nemo3-ASR-Streaming

$0.00100

/ minute

Nemotron Speech Streaming EN 0.6B is NVIDIA's 600M-parameter cache-aware FastConformer-RNNT model for low-latency English speech recognition. It transcribes audio as it arrives, with native punctuation and capitalization, by reusing cached encoder context instead of recomputing overlapping windows. DeepInfra serves it at 560 ms lookahead over a realtime WebSocket API compatible with OpenAI Realtime transcription, batching many concurrent streams on each GPU, for live captioning, voice agents and real-time speech-to-text.

nvidia/Nemo3-ASR-Streaming cover image
demo

Realtime transcription with Python (websockets)

nvidia/Nemo3-ASR-Streaming is served over realtime WebSocket sessions, compatible with OpenAI's Realtime transcription API: you stream audio in and receive the transcript as the words are recognized. It is not available over HTTP inference.

Connect

wss://api.deepinfra.com/v1/realtime?model=nvidia/Nemo3-ASR-Streaming

Authenticate with Authorization: Bearer $DEEPINFRA_API_KEY. Browsers, which cannot set headers on a WebSocket, can pass the key as the subprotocol openai-insecure-api-key.<key> instead.

Client events

  • session.update: sets the input audio format. Send it first. Audio is 16-bit little-endian mono PCM at any sample rate (it is resampled on our side); the default is 24000 Hz.
  • input_audio_buffer.append: a base64-encoded chunk of PCM audio. Send audio in real time, for example 100 ms per message; sending audio much faster than real time ends the session.
  • session.close: transcribes any open utterance and ends the session.

Server events

  • session.created, session.updated: the session is ready, and the format you set.
  • conversation.item.input_audio_transcription.delta: partial text as it is recognized. delta is the new text; transcript is the whole open utterance so far, which may revise earlier words.
  • conversation.item.input_audio_transcription.completed: the final transcript of an utterance.
  • error: error.code says what went wrong. The session then closes with a standard WebSocket close code: 1013 means try again later (for example server_is_overloaded or websocket_connection_limit_reached), 1012 and 1014 mean reconnect, and 1008, 3000 and 3003 will fail again until the request or the account changes.

Usage is billed per second of audio sent.

Example

import asyncio
import base64
import json
import os
import wave

from websockets.asyncio.client import connect

URL = "wss://api.deepinfra.com/v1/realtime?model=nvidia/Nemo3-ASR-Streaming"
PACKET_SEC = 0.1


async def main() -> None:
    with wave.open("speech.wav") as w:  # 16-bit mono PCM
        rate, pcm = w.getframerate(), w.readframes(w.getnframes())
    packet = int(rate * PACKET_SEC) * 2
    headers = {"Authorization": "Bearer " + os.environ["DEEPINFRA_API_KEY"]}

    async with connect(URL, additional_headers=headers) as ws:
        await ws.send(json.dumps({"type": "session.update", "session": {
            "type": "transcription",
            "audio": {"input": {"format": {"type": "audio/pcm", "rate": rate}}}}}))

        async def send_audio() -> None:
            for off in range(0, len(pcm), packet):
                await ws.send(json.dumps({"type": "input_audio_buffer.append",
                                          "audio": base64.b64encode(pcm[off:off + packet]).decode()}))
                await asyncio.sleep(PACKET_SEC)
            await ws.send(json.dumps({"type": "session.close"}))

        sender = asyncio.create_task(send_audio())
        async for raw in ws:
            event = json.loads(raw)
            if event["type"] == "conversation.item.input_audio_transcription.delta":
                print("partial:", event.get("transcript") or event["delta"])
            elif event["type"] == "conversation.item.input_audio_transcription.completed":
                print("final:", event["transcript"])
            elif event["type"] == "error":
                print("error:", event["error"]["code"], event["error"]["message"])
        await sender


asyncio.run(main())
copy
partial: Welcome to our AI
partial: Welcome to our AI testing session.
final: Welcome to our AI testing session.