dimastatz/whisper-flow
Windowed Whisper SDK and WebSocket API for self-hosted live transcription
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
Whisper-Flow is a Python SDK and self-hosted FastAPI service that adds streaming session semantics around OpenAI Whisper. The Uvicorn-served API accepts binary PCM on /ws; whisperflow.streaming.TranscribeSession groups chunks into temporal windows and coordinates transcription callbacks and result delivery. whisperflow.transcriber provides synchronous and asynchronous PCM chunk helpers over the openai-whisper, PyTorch, and NumPy stack. PyAudio and PortAudio serve audio I/O; the WebSocket contract starts with PCM already prepared by the client.
The callback boundary lets an application embed session handling without adopting the supplied server. The primary abstraction is windowed transcription with partial and final events, not a native streaming Whisper decoder or a provider-switching layer. Since v1.3.0, get_model() returns a replica pool: each replica runs one transcription at a time, so concurrent sessions no longer have to invoke the same model instance simultaneously. Async integration helps coordinate I/O, but inference capacity is still limited by the available replicas and hardware.
Key Capabilities & Differentiators
Clients send 16 kHz mono signed 16-bit PCM in binary WebSocket frames and receive JSON events with is_partial, data.text, and time in milliseconds. Optional JSON control frames include start to select a model, language, and vocabulary prompt, plus flush and stop. A pause, stable text, or the window cap can also finalize a segment. Partial output can revise previously emitted words, so a caption UI should replace its current preview rather than append every event.
The default checkpoint is tiny.en.pt; list_models() lists model files in whisperflow/models/, and GET /ready reports the available models and protocol_version. The transcription helpers accept a language and an optional prompt mapped to Whisper's initial_prompt, a hint rather than a vocabulary constraint. The service also exposes POST /transcribe_pcm_chunk for batch PCM input. The LibriSpeech benchmark measures Word Error Rate and intervals between consecutive partial results; that latency metric is not capture-to-final delay or a throughput guarantee under load.
Trade-offs & Limitations
Compared with invoking OpenAI Whisper directly on complete recordings, Whisper-Flow supplies the windowing, endpointing, event protocol, and concurrency controls needed for live captions. The trade-off is that partial text is provisional and shorter windows can reduce context and accuracy. A dedicated streaming ASR backend is worth comparing when stable interim text or stringent tail latency matters; a managed speech API is an alternative when avoiding model operations matters more than keeping audio on infrastructure you control.
Replica isolation improves concurrency safety at the cost of additional model memory. v1.4.0 bounds the per-session input backlog, addressing a queue that could grow while transcription was busy; WF_MAX_WINDOW_CHUNKS only applied after chunks left that queue. Neither bound establishes service-wide capacity or a latency SLA. Size CPU or GPU deployments against the selected checkpoint and target concurrency, and test slow inference and bursty clients. The supplied material does not establish production authentication or admission controls, so verify those before exposing the API publicly.
Hardware & Deployment Guide
The local workflow is ./run.sh -local to create a virtual environment, install dependencies, and run checks, followed by ./run.sh -run-server on port 8181. GET /health checks whether the server is running, while /ready exposes model and protocol information. Python 3.12 is the tested version and the base of the supplied python:3.12-slim-bookworm image. Allow for PyAudio's PortAudio dependency, PyTorch, and provisioning the selected model files. Inference runs locally once dependencies and weights are available; this does not make installation network-free.
Check the Docker path before adopting it as a release workflow. ./run.sh -docker uses port 8888, while the manual example builds Dockerfile.test and maps port 8181. The root Dockerfile copies the checkout but runs pip install whisperflow, not pip install .; its import and callable checks do not establish that the image is testing the checkout. Validate the intended package and port mapping before rollout. When upgrading, exercise concurrent sessions for the v1.3.0 replica change and test faster-than-real-time input for the v1.4.0 backlog change.
/ws accepts binary 16 kHz mono signed int16 PCM and returns JSON with is_partial, data.text, and time in milliseconds.flush or stop can finalize a segment.TranscribeSession takes separate transcription and delivery callbacks; whisperflow.transcriber exposes sync and async PCM helpers.GET /ready exposes protocol version and available models; ./run.sh -benchmark measures WER and inter-partial latency with LibriSpeech.Teams building self-hosted live captions or speech-to-text features that can supply 16 kHz PCM and render revisable partial results.
You only transcribe completed files, or you require stable interim text and proven tail latency at scale without benchmarking and operating the inference stack yourself.
Quick Start & Installation
brew install portaudio
Comparison vs. Top Voice, Vision & Video Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| whisper-flow ★ | 1k | +5 | Python | MIT | Windowed Whisper SDK and WebSocket API for self-hosted live transcription |
| whisperX | 26.5k | +472 | Python | BSD-2-Clause | Batched Whisper with forced alignment for word timings and optional speaker labe |
| RealtimeSTT | 10.3k | +11 | Python | Apache-2.0 | Local streaming speech-to-text: a Python SDK and FastAPI service for low-latency |
| Speech | 18.8k | +20 | Python | Apache-2.0 | PyTorch speech SDK for training, adapting, and running ASR, TTS, and SpeechLM mo |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/dimastatz/whisper-flow.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about whisper-flow
Should I use the WebSocket server or embed the Python SDK?
/ws endpoint if you can send 16 kHz mono signed int16 PCM and consume JSON results. For an existing Python service, embed TranscribeSession with an async transcription callback and a result callback. Treat is_partial: true as a replacement for the current preview, not as text to append; commit the segment when is_partial turns false.Do I need a GPU, and how should I size the service?
tiny.en.pt and a single replica, then measure memory, inference time, and gaps between partial results at the intended session load. Increasing the replica count can improve concurrent inference, but each loaded replica adds model memory. An async API does not reduce the underlying PyTorch compute cost.Can I use Whisper-Flow commercially and self-host sensitive audio?
When is direct Whisper or a dedicated streaming ASR service a better choice?
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