# Repository Briefing: KoljaB/RealtimeSTT
> Source: https://repoforai.com/repo/KoljaB/RealtimeSTT (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/KoljaB/RealtimeSTT
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: A+ (91/100 · Maintenance 31/35 · Adoption 20/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v1.2.0 (2026-11-11) — https://github.com/KoljaB/RealtimeSTT/releases
- **Review Snapshot**: 2026-12-01
- **Deployment / Stack Signals**: Docker, Self-Hosted, Local AI, API
- **Momentum**: 10,267 ★ total (+1 24h / +11 7d) · 864 forks
- **Topics**: `python`, `realtime`, `speech-to-text`
- **When to Use**: Best for: 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. Skip if: 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.

## Overview
```text
### Architecture & 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.
```

## Key Capabilities
```text
- Audio ingress: `AudioToTextRecorder` accepts PyAudio microphone input or application-fed 16-bit mono PCM, with resampling when the source rate is supplied.
- Speech gating: WebRTC and Silero VAD support recorder segmentation, with optional Porcupine or OpenWakeWord activation.
- Two-stage CPU ASR: Streaming Nemotron consumes new frames for replaceable text; Parakeet decodes the completed turn for the authoritative final.
- Pause Preview: `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.
- API boundaries: The packaged FastAPI server exposes versioned HTTP and ordered WebSocket contracts, with session isolation and bounded shared inference resources.
- Deployment separation: `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.
```

## Quick Start / Clone
```bash
pip install "RealtimeSTT[kroko-builder,silero-onnx-cpu]"
stt-install-kroko --build
```
