The Problem

Transcribing long audio (hours) with OpenAI’s Whisper is CPU‑bound and slow on typical hardware. Users need a lightweight, GPU‑accelerated CLI that can run Whisper‑large models on‑device without writing custom inference scripts.

What This Does

insanely-fast-whisper ships a single entry point (src/insanelyfastwhisper/cli.py) that wraps Hugging Face Transformers, Optimum, and Flash‑Attention 2. The CLI parses arguments, loads the requested model (e.g., openai/whisper-large-v3), and runs batched inference on the GPU. Utility code lives under src/insanelyfastwhisper/utils/ – diarizationpipeline.py and diarize.py handle optional speaker diarisation, while result.py formats the transcription output. The repository also includes two Jupyter notebooks (notebooks/*.ipynb) that demonstrate the same workflow in a notebook environment.

How To Use It

Setup

Recommended – isolates the tool and its heavy dependencies pipx install insanely-fast-whisper==0.0.15 # or latest version If Python 3.11 mis‑detects the version: pipx install insanely-fast-whisper --force --pip-args="--ignore-requires-python"

The pyproject.toml declares dependencies (Transformers, Optimum, flash‑attn, etc.) and the lock file pdm.lock pins versions for reproducible builds.

Configuration

No separate config file is required. The CLI accepts flags for model selection, device, batching, and Flash‑Attention. Example defaults are defined in cli.py (e.g., --model-name openai/whisper-large-v3, --device-id cuda, --batch-size 24). For macOS you must add --device-id mps.

Running

Basic transcription insanely-fast-whisper --file-name path/to/audio.wav

Enable Flash‑Attention 2

insanely-fast-whisper --file-name path/to/audio.wav --flash True

Use a different model (distil‑whisper)

insanely-fast-whisper --model-name distil-whisper/large-v2 --file-name path/to/audio.wav

The command invokes src/insanelyfast_whisper/cli.py, which calls the utility functions in utils/ to perform inference and emit JSON/plain‑text results.

Real‑World Use

A media monitoring service can drop raw broadcast recordings into a shared folder and trigger the CLI via a cron job:

#!/usr/bin/env bash FILE="/data/incoming/${1}" insanely-fast-whisper --file-name "$FILE" --model-name openai/whisper-large-v3 \ --flash True --batch-size 24 > "/data/processed/${1%.wav}.json"

The resulting JSON can be streamed into an indexing pipeline (e.g., Elasticsearch) for searchable subtitles.

Code Health & Issues

Medium – Missing CI/CD – No .github/workflows or other pipeline; automated testing is not enforced. Low – Lockfile format – pdm.lock exists, but the project uses pyproject.toml without a requirements.txt; users unfamiliar with PDM may need extra steps. Low – Sparse test coverage – Only one test module (tests/init.py) is present; no functional tests for CLI or utils. Low – Documentation gaps – README covers install/CLI flags, but there is no API reference for the utility functions (e.g., diarize). Low – Platform limitation – CLI is explicitly “opinionated” for NVIDIA GPUs or macOS MPS; no fallback to CPU is documented, which could cause runtime errors on unsupported hardware.

No obvious security secrets are committed, and the license file is present.

The Bottom Line

insanely-fast-whisper delivers a practical, GPU‑accelerated Whisper CLI with clear install instructions and benchmarked performance. It is suitable for teams that need fast, on‑premise transcription and can manage the minimal testing and CI gaps. Organizations lacking dedicated NVIDIA hardware or requiring broader platform support will need to augment the repo.