agentleFS
dimastatzdimastatz/whisper-flow/CLAUDE.md

whisper-flow

CLAUDE.md1k starsChanged 4 months agoMITView on GitHub

Guidance for Claude Code (and other AI assistants) working in this repository. See README.md for end-user/usage detail; this file is the agent-facing reference. Whisper Flow is a real-time, streaming speech-to-text service built on OpenAI Whisper and served via FastAPI. It splits incoming audio into temporal tumbling windows to emit partial transcripts at sub-500ms latency. Shipped as the Python package whisperflow (v1.4.0, Python 3.8+, developed/tested on 3.12). Everything runs through run.sh. The -local target rebuilds .venv from scratch; the other targets…

  • Installs packages

Trending

Steady talk.thin dataabout the whole repository

Dec 2025: 1 mentionJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 2 mentionsSep 2026: 0 mentionsOct 2026: 2 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the dimastatz/whisper-flow repository that our weekly crawl found: only 5 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

The file

We split this CLAUDE.md into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Add tests with every code change (the 95% coverage gate enforces this).

    line 72
  2. Very specific:

    Always run ./run.sh -test and ensure it is green before finishing.

    line 73

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

Guidance for Claude Code (and other AI assistants) working in this repository. See README.md for end-user/usage detail; this file is the agent-facing reference.

Project overview

Whisper Flow is a real-time, streaming speech-to-text service built on OpenAI Whisper and served via FastAPI. It splits incoming audio into temporal tumbling windows to emit partial transcripts at sub-500ms latency. Shipped as the Python package whisperflow (v1.4.0, Python 3.8+, developed/tested on 3.12).

Commands

Everything runs through run.sh. The -local target rebuilds .venv from scratch; the other targets assume the venv is already activated (source .venv/bin/activate).

CommandWhat it does
./run.sh -localFresh .venv + install deps + format + lint + tests (first-time setup)
./run.sh -testblack + pylint + pytest — the inner-loop check before committing
./run.sh -run-serveruvicorn FastAPI server on port 8181
./run.sh -benchmarkStart server, run tests/benchmark (LibriSpeech WER/latency), stop
./run.sh -dockerBuild and run the container on port 8888

Running a single test (venv activated): pytest tests/test_streaming.py -v

Quality gates — must pass

CI enforces these via Dockerfile.test. ./run.sh -test runs the same checks locally:

  • black whisperflow tests — formatting (no diffs allowed)
  • pylint --fail-under=9.9 whisperflow tests — near-perfect lint score required
  • pytest --ignore=tests/benchmark --cov-fail-under=95 --cov whisperflow — 95% coverage

Implication: every code change needs accompanying tests to keep coverage ≥95%, and all code must be black-formatted and pass pylint at 9.9+. Run ./run.sh -test before considering work done.

Architecture & key files

  • whisperflow/transcriber.py — Whisper model loading and inference: get_model() (returns a ModelPool), transcribe_pcm_chunks(), transcribe_pcm_chunks_async(). Never call one Whisper model from two threads at once: its decoder installs kv-cache hooks on the model, so concurrent calls corrupt each other. Borrow a replica with ModelPool.acquire() (transcribe_pcm_chunks does this for you).
  • whisperflow/streaming.py — tumbling-window streaming logic, TranscribeSession, and the committed-prefix scheme (Segment.commit)
  • whisperflow/fast_server.py — FastAPI app: WebSocket /ws, GET /health, GET /ready, POST /transcribe_pcm_chunk
  • docs/protocol.md — wire contract; bump PROTOCOL_VERSION in whisperflow/__init__.py on any breaking change to it
  • whisperflow/chat_room.py — multi-user chat
  • whisperflow/audio/microphone.py — audio input
  • whisperflow/models/ — bundled tiny.en.pt model
  • tests/ — pytest suite. tests/benchmark/ and tests/audio/ are excluded from the coverage gate.

Environment gotchas

  • Python 3.12 preferred — run.sh auto-selects python3.12 when available.
  • setuptools<70 pin is required for openai-whisper compatibility (see run.sh).
  • PortAudio system dependency is required for PyAudio: brew install portaudio (macOS) / apt-get install portaudio19-dev (Debian/Ubuntu).
  • Audio format: 16 kHz, mono, 16-bit signed integer (int16) PCM.
  • Ports: 8181 when run locally, 8888 in Docker.

Conventions

  • Match the existing style; keep modules small and focused.
  • Add tests with every code change (the 95% coverage gate enforces this).
  • Always run ./run.sh -test and ensure it is green before finishing.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.