KoljaB/RealtimeSTT
Local streaming speech-to-text: a Python SDK and FastAPI service for low-latency voice turns
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
RealtimeSTT has two integration layers. The Python SDK centers on AudioToTextRecorder, which accepts microphone input through PyAudio or application-fed PCM through feed_audio(). Recorder-level speech detection uses WebRTC and Silero VAD; Porcupine and OpenWakeWord are optional activation backends. The recorder exposes callbacks for recording, speech activity, wake-word state, and transcripts. It uses multiprocessing for model work, so executable scripts should use an if __name__ == '__main__': guard. The default decoder is faster_whisper; optional extras, a public engine base class, executor integration, and streaming sessions provide extension points.
RealtimeSTT_server/ packages a separate FastAPI service. It exposes versioned HTTP for health, readiness, capabilities, and raw-PCM final transcription, plus an ordered WebSocket protocol for streaming. The production WebSocket path owns its turn state instead of relying on recorder VAD for finalization. Sessions are isolated but use bounded shared inference resources, making concurrency an explicit deployment concern rather than a per-client model decision.
Key Capabilities & Differentiators
The primary distinction is between replaceable live hypotheses and an authoritative final transcript. The recommended Linux x86-64 INT8 CPU profile uses streaming Nemotron for incremental recognition and Parakeet TDT v3 for a full-turn decode at finalization, avoiding repeated decoding of an ever-growing buffer for live updates. Other available engine paths include whisper.cpp, kroko_onnx, and Moonshine, subject to their dependencies and model bundles. Orukeet is an optional hash-verified final model for 25 European languages.
In v1.2.0, the production server's CPU live-flush Preview decodes unfinished audio on a copy of nemotron_ort streaming state without disturbing the live session. The more accurate full-model text follows as previewRecord; an optional longer flush emits previewRefined. With --preview-input-mode tail, the final model decodes recent audio and merges it with recognized text, falling back to a full-turn decode when the join cannot be validated. On a single 12-second English utterance on one Linux x86-64 production host, request-to-event timings were 48 ms for live-flush, 149 ms for tail Preview, and about 710 ms for full-turn Preview. Those figures do not establish throughput or concurrency limits.
Trade-offs & Limitations
Compared with integrating faster-whisper directly, the SDK saves work on capture, speech gating, wake words, transcript callbacks, and remote sessions. If the application already provides utterance boundaries and only needs final text, a decoder-only integration is simpler. A hosted Whisper API avoids operating inference infrastructure; self-hosting lets you keep inference within your environment and control the streaming policy, but leaves you responsible for model staging, capacity, authentication, and transport security.
The recommended CPU pipeline trades a second decoder and model bundle for incremental live text and a separate full-turn final. Consumers must handle revisions and distinguish pause-time Preview events from the final transcript. Live-flush is CPU-only; the recommended general-purpose CUDA path is faster_whisper, which does not offer live-flush. Choose hardware after measuring peak memory, queueing, and tail latency under concurrent streams and finalizations. The project's Apache-2.0 license does not cover all bundled or optional runtimes, models, VADs, and wake-word backends; clear each selected component before commercial use or redistribution.
Hardware & Deployment Guide
CI covers Python 3.11 and 3.12; 3.13 and newer are not release targets. Install PortAudio development headers on Linux or portaudio on macOS before installing the SDK. For a remote service, install RealtimeSTT[server,faster-whisper] and start stt-server-production --host 127.0.0.1 --port 8010. For the recommended CPU profile, use the server,sherpa-onnx extras and stage pinned bundles in persistent storage with stt-install-sherpa-models --root ./models/sherpa-onnx --model all. The live-flush route additionally needs the nemotron-ort extra and its model setup. The production WebSocket path does not require an interactive Torch Hub download at startup.
The checked-in Compose file selects the gpu build target by default, reserves a GPU, maps port 9001, and persists /root/.cache. It also serves the browser example through Nginx on port 8081. Treat that configuration separately from the packaged production recipe: direct non-loopback binds of the production server require a bearer token and Uvicorn TLS certificate and key; with a reverse proxy, keep the service on loopback and terminate TLS at the proxy. The Preview release progression matters operationally: v1.1.1 added cancellation of superseded work, v1.1.2 formalized advisory early_rms behavior, and v1.2.0 added the CPU fast paths and relicensed the project's code under Apache-2.0.
AudioToTextRecorder accepts PyAudio microphone input or application-fed 16-bit mono PCM, with resampling when the source rate is supplied.nemotron_ort live-flush decodes pending audio on copied state; tail mode falls back to full-turn decoding if the text join cannot be validated.stt-server-production is the packaged service entrypoint; the checked-in Compose stack builds a CPU or GPU image and serves a browser example through Nginx.Voice assistants, dictation tools, and browser speech clients that need local inference, revisable live text, and a distinct final transcript; teams with Linux x86-64 CPU deployments can also evaluate pause-time Preview.
You only need final transcripts from pre-segmented audio, want a fully managed API, or require the v1.2.0 live-flush feature on CUDA.
Quick Start & Installation
pip install "RealtimeSTT[kroko-builder,silero-onnx-cpu]" stt-install-kroko --build
Comparison vs. Top Voice, Vision & Video Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| RealtimeSTT ★ | 10.3k | +11 | Python | Apache-2.0 | Local streaming speech-to-text: a Python SDK and FastAPI service for low-latency |
| whisperX | 26.5k | +677 | Python | BSD-2-Clause | Batched Whisper with forced alignment for word timings and optional speaker labe |
| mlx-audio | 8.4k | +32 | Python | MIT | MLX inference SDK for local speech and audio pipelines on Apple Silicon |
| sherpa-onnx | 16.4k | +136 | C++ | Apache-2.0 | C++ and ONNX Runtime SDK for offline speech and real-time transcription |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/KoljaB/RealtimeSTT.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about RealtimeSTT
How do I integrate audio that does not come from a local microphone?
use_microphone=False and pass 16-bit mono PCM to feed_audio(). Use 16 kHz audio or supply original_sample_rate so the recorder can resample it. For remote clients, use the production HTTP endpoint for final transcription or the ordered WebSocket contract for streaming; the production WebSocket manages its own turn state.Should I provision CPU or GPU, and how much memory will I need?
faster_whisper as the general-purpose CUDA baseline. There is no universal VRAM or session-capacity figure: size the host with your selected models, simultaneous streams, and finalization bursts. Measure peak memory and request-to-event tail latency under load, not just single-utterance decode time.Does Apache-2.0 cover a commercial self-hosted deployment end to end?
When is RealtimeSTT preferable to direct faster-whisper or a hosted Whisper API?
faster-whisper directly when your application already owns audio capture and turn segmentation and only needs a decoder. A hosted Whisper API is a better fit if avoiding model and server operations matters more than keeping inference and streaming behavior under your control.Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy