Vaibhavs10/insanely-fast-whisperPublic

AI summary: An optimized implementation of OpenAI's Whisper model that runs transcription incredibly fast.

Stars
13K
+1 today
Forks
962
Watchers
85
Open issues
100
Open PRs
16
Contributors
~21
Commits
180
Branches
4

Jupyter NotebookApache-2.0Created Oct 10, 2023Last push 9mo ago+43 stars this week+44 this month

Star history

since Oct 15, 2023
05K10KOct 2023Sep 2024Aug 2025Aug 2026
13K stars as of Aug 7, 2026, tracked back to Oct 15, 2023. Historical curve reconstructed from public GitHub event archives, calibrated to the current total.

Contribution activity

commits per day, last 52 weeks

Signals and awards

derived from tracked data
  • Widely adopted

    13,041 stars

  • Permissive license

    Apache-2.0

What insanely-fast-whisper does

Insanely-fast-whisper is a highly optimized pipeline for OpenAI's Whisper model that leverages Flash Attention and other acceleration techniques to dramatically speed up audio transcription. It achieves this by aggressively utilizing GPU hardware to batch and process audio segments in parallel. The tool is designed to provide near real-time or faster-than-real-time transcription for long audio files, making it feasible to transcribe massive datasets or long podcasts on consumer-grade GPUs without the typical bottleneck of the standard Whisper implementation.

Data scientists, researchers, and content creators who need to transcribe large amounts of audio quickly and have access to a modern GPU.

  • Flash Attention integration: Uses memory-efficient attention to speed up model inference.
  • Batched processing: Processes multiple audio segments simultaneously for maximum GPU utilization.
  • Faster-than-real-time performance: Capable of transcribing hours of audio in minutes.
  • Hugging Face transformers support: Built on top of standard libraries for easy integration.
  • Command-line interface: Provides a simple CLI tool for immediate transcription tasks.

Where teams use it

Bulk podcast transcription

Processing an entire back catalog of podcasts to generate searchable text.

Rapid video subtitling

Generating subtitles for long-form video content quickly before publication.

Dataset generation

Transcribing large volumes of speech audio to create datasets for training other models.

Getting started: pipx install insanely-fast-whisper

README

main branch

Insanely Fast Whisper

An opinionated CLI to transcribe Audio files w/ Whisper on-device! Powered by ๐Ÿค— Transformers, Optimum & flash-attn

TL;DR - Transcribe 150 minutes (2.5 hours) of audio in less than 98 seconds - with OpenAI's Whisper Large v3. Blazingly fast transcription is now a reality!โšก๏ธ

pipx install insanely-fast-whisper==0.0.15 --force

Not convinced? Here are some benchmarks we ran on a Nvidia A100 - 80GB ๐Ÿ‘‡

Optimisation type Time to Transcribe (150 mins of Audio)
large-v3 (Transformers) (fp32) ~31 (31 min 1 sec)
large-v3 (Transformers) (fp16 + batching [24] + bettertransformer) ~5 (5 min 2 sec)
large-v3 (Transformers) (fp16 + batching [24] + Flash Attention 2) ~2 (1 min 38 sec)
distil-large-v2 (Transformers) (fp16 + batching [24] + bettertransformer) ~3 (3 min 16 sec)
distil-large-v2 (Transformers) (fp16 + batching [24] + Flash Attention 2) ~1 (1 min 18 sec)
large-v2 (Faster Whisper) (fp16 + beam_size [1]) ~9.23 (9 min 23 sec)
large-v2 (Faster Whisper) (8-bit + beam_size [1]) ~8 (8 min 15 sec)

P.S. We also ran the benchmarks on a Google Colab T4 GPU instance too!

P.P.S. This project originally started as a way to showcase benchmarks for Transformers, but has since evolved into a lightweight CLI for people to use. This is purely community driven. We add whatever community seems to have a strong demand for!

๐Ÿ†• Blazingly fast transcriptions via your terminal! โšก๏ธ

We've added a CLI to enable fast transcriptions. Here's how you can use it:

Install insanely-fast-whisper with pipx (pip install pipx or brew install pipx):

pipx install insanely-fast-whisper

โš ๏ธ If you have python 3.11.XX installed, pipx may parse the version incorrectly and install a very old version of insanely-fast-whisper without telling you (version 0.0.8, which won't work anymore with the current BetterTransformers). In that case, you can install the latest version by passing --ignore-requires-python to pip:

pipx install insanely-fast-whisper --force --pip-args="--ignore-requires-python"

If you're installing with pip, you can pass the argument directly: pip install insanely-fast-whisper --ignore-requires-python.

Run inference from any path on your computer:

insanely-fast-whisper --file-name <filename or URL>

Note: if you are running on macOS, you also need to add --device-id mps flag.

๐Ÿ”ฅ You can run Whisper-large-v3 w/ Flash Attention 2 from this CLI too:

insanely-fast-whisper --file-name <filename or URL> --flash True 

๐ŸŒŸ You can run distil-whisper directly from this CLI too:

insanely-fast-whisper --model-name distil-whisper/large-v2 --file-name <filename or URL> 

Don't want to install insanely-fast-whisper? Just use pipx run:

pipx run insanely-fast-whisper --file-name <filename or URL>

Note

The CLI is highly opinionated and only works on NVIDIA GPUs & Mac. Make sure to check out the defaults and the list of options you can play around with to maximise your transcription throughput. Run insanely-fast-whisper --help or pipx run insanely-fast-whisper --help to get all the CLI arguments along with their defaults.

CLI Options

The insanely-fast-whisper repo provides an all round support for running Whisper in various settings. Note that as of today 26th Nov, insanely-fast-whisper works on both CUDA and mps (mac) enabled devices.

  -h, --help            show this help message and exit
  --file-name FILE_NAME
                        Path or URL to the audio file to be transcribed.
  --device-id DEVICE_ID
                        Device ID for your GPU. Just pass the device number when using CUDA, or "mps" for Macs with Apple Silicon. (default: "0")
  --transcript-path TRANSCRIPT_PATH
                        Path to save the transcription output. (default: output.json)
  --model-name MODEL_NAME
                        Name of the pretrained model/ checkpoint to perform ASR. (default: openai/whisper-large-v3)
  --task {transcribe,translate}
                        Task to perform: transcribe or translate to another language. (default: transcribe)
  --language LANGUAGE   
                        Language of the input audio. (default: "None" (Whisper auto-detects the language))
  --batch-size BATCH_SIZE
                        Number of parallel batches you want to compute. Reduce if you face OOMs. (default: 24)
  --flash FLASH         
                        Use Flash Attention 2. Read the FAQs to see how to install FA2 correctly. (default: False)
  --timestamp {chunk,word}
                        Whisper supports both chunked as well as word level timestamps. (default: chunk)
  --hf-token HF_TOKEN
                        Provide a hf.co/settings/token for Pyannote.audio to diarise the audio clips
  --diarization_model DIARIZATION_MODEL
                        Name of the pretrained model/ checkpoint to perform diarization. (default: pyannote/speaker-diarization)
  --num-speakers NUM_SPEAKERS
                        Specifies the exact number of speakers present in the audio file. Useful when the exact number of participants in the conversation is known. Must be at least 1. Cannot be used together with --min-speakers or --max-speakers. (default: None)
  --min-speakers MIN_SPEAKERS
                        Sets the minimum number of speakers that the system should consider during diarization. Must be at least 1. Cannot be used together with --num-speakers. Must be less than or equal to --max-speakers if both are specified. (default: None)
  --max-speakers MAX_SPEAKERS
                        Defines the maximum number of speakers that the system should consider in diarization. Must be at least 1. Cannot be used together with --num-speakers. Must be greater than or equal to --min-speakers if both are specified. (default: None)

Frequently Asked Questions

How to correctly install flash-attn to make it work with insanely-fast-whisper?

Make sure to install it via pipx runpip insanely-fast-whisper install flash-attn --no-build-isolation. Massive kudos to @li-yifei for helping with this.

How to solve an AssertionError: Torch not compiled with CUDA enabled error on Windows?

The root cause of this problem is still unknown, however, you can resolve this by manually installing torch in the virtualenv like python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121. Thanks to @pto2k for all tdebugging this.

How to avoid Out-Of-Memory (OOM) exceptions on Mac?

The mps backend isn't as optimised as CUDA, hence is way more memory hungry. Typically you can run with --batch-size 4 without any issues (should use roughly 12GB GPU VRAM). Don't forget to set --device-id mps.

How to use Whisper without a CLI?

All you need to run is the below snippet:
pip install --upgrade transformers optimum accelerate
import torch
from transformers import pipeline
from transformers.utils import is_flash_attn_2_available

pipe = pipeline(
    "automatic-speech-recognition",
    model="openai/whisper-large-v3", # select checkpoint from https://huggingface.co/openai/whisper-large-v3#model-details
    torch_dtype=torch.float16,
    device="cuda:0", # or mps for Mac devices
    model_kwargs={"attn_implementation": "flash_attention_2"} if is_flash_attn_2_available() else {"attn_implementation": "sdpa"},
)

outputs = pipe(
    "<FILE_NAME>",
    chunk_length_s=30,
    batch_size=24,
    return_timestamps=True,
)

outputs

Acknowledgements

  1. OpenAI Whisper team for open sourcing such a brilliant check point.
  2. Hugging Face Transformers team, specifically Arthur, Patrick, Sanchit & Yoach (alphabetical order) for continuing to maintain Whisper in Transformers.
  3. Hugging Face Optimum team for making the BetterTransformer API so easily accessible.
  4. Patrick Arminio for helping me tremendously to put together this CLI.

Community showcase

  1. @ochen1 created a brilliant MVP for a CLI here: https://github.com/ochen1/insanely-fast-whisper-cli (Try it out now!)
  2. @arihanv created an app (Shush) using NextJS (Frontend) & Modal (Backend): https://github.com/arihanv/Shush (Check it outtt!)
  3. @kadirnar created a python package on top of the transformers with optimisations: https://github.com/kadirnar/whisper-plus (Go go go!!!)
View on GitHub

Recent activity

commits and pull requests

Recent open issues

view all

Commits per week

last 52 weeks

When work happens

weekday and hour
SunMonTueWedThuFriSat036912151821Sun 0:00 โ€” 0 commitsSun 1:00 โ€” 0 commitsSun 2:00 โ€” 0 commitsSun 3:00 โ€” 0 commitsSun 4:00 โ€” 0 commitsSun 5:00 โ€” 0 commitsSun 6:00 โ€” 1 commitsSun 7:00 โ€” 0 commitsSun 8:00 โ€” 0 commitsSun 9:00 โ€” 0 commitsSun 10:00 โ€” 0 commitsSun 11:00 โ€” 0 commitsSun 12:00 โ€” 1 commitsSun 13:00 โ€” 2 commitsSun 14:00 โ€” 2 commitsSun 15:00 โ€” 2 commitsSun 16:00 โ€” 3 commitsSun 17:00 โ€” 2 commitsSun 18:00 โ€” 0 commitsSun 19:00 โ€” 0 commitsSun 20:00 โ€” 6 commitsSun 21:00 โ€” 2 commitsSun 22:00 โ€” 4 commitsSun 23:00 โ€” 1 commitsMon 0:00 โ€” 0 commitsMon 1:00 โ€” 0 commitsMon 2:00 โ€” 0 commitsMon 3:00 โ€” 0 commitsMon 4:00 โ€” 0 commitsMon 5:00 โ€” 0 commitsMon 6:00 โ€” 0 commitsMon 7:00 โ€” 0 commitsMon 8:00 โ€” 0 commitsMon 9:00 โ€” 2 commitsMon 10:00 โ€” 0 commitsMon 11:00 โ€” 1 commitsMon 12:00 โ€” 0 commitsMon 13:00 โ€” 1 commitsMon 14:00 โ€” 0 commitsMon 15:00 โ€” 0 commitsMon 16:00 โ€” 0 commitsMon 17:00 โ€” 0 commitsMon 18:00 โ€” 8 commitsMon 19:00 โ€” 7 commitsMon 20:00 โ€” 6 commitsMon 21:00 โ€” 4 commitsMon 22:00 โ€” 2 commitsMon 23:00 โ€” 0 commitsTue 0:00 โ€” 5 commitsTue 1:00 โ€” 0 commitsTue 2:00 โ€” 0 commitsTue 3:00 โ€” 0 commitsTue 4:00 โ€” 0 commitsTue 5:00 โ€” 0 commitsTue 6:00 โ€” 0 commitsTue 7:00 โ€” 0 commitsTue 8:00 โ€” 0 commitsTue 9:00 โ€” 0 commitsTue 10:00 โ€” 0 commitsTue 11:00 โ€” 1 commitsTue 12:00 โ€” 12 commitsTue 13:00 โ€” 1 commitsTue 14:00 โ€” 1 commitsTue 15:00 โ€” 0 commitsTue 16:00 โ€” 4 commitsTue 17:00 โ€” 4 commitsTue 18:00 โ€” 2 commitsTue 19:00 โ€” 0 commitsTue 20:00 โ€” 1 commitsTue 21:00 โ€” 0 commitsTue 22:00 โ€” 0 commitsTue 23:00 โ€” 0 commitsWed 0:00 โ€” 2 commitsWed 1:00 โ€” 0 commitsWed 2:00 โ€” 0 commitsWed 3:00 โ€” 0 commitsWed 4:00 โ€” 0 commitsWed 5:00 โ€” 0 commitsWed 6:00 โ€” 0 commitsWed 7:00 โ€” 0 commitsWed 8:00 โ€” 0 commitsWed 9:00 โ€” 0 commitsWed 10:00 โ€” 0 commitsWed 11:00 โ€” 0 commitsWed 12:00 โ€” 1 commitsWed 13:00 โ€” 0 commitsWed 14:00 โ€” 4 commitsWed 15:00 โ€” 0 commitsWed 16:00 โ€” 0 commitsWed 17:00 โ€” 2 commitsWed 18:00 โ€” 0 commitsWed 19:00 โ€” 0 commitsWed 20:00 โ€” 3 commitsWed 21:00 โ€” 4 commitsWed 22:00 โ€” 2 commitsWed 23:00 โ€” 1 commitsThu 0:00 โ€” 1 commitsThu 1:00 โ€” 0 commitsThu 2:00 โ€” 0 commitsThu 3:00 โ€” 0 commitsThu 4:00 โ€” 0 commitsThu 5:00 โ€” 1 commitsThu 6:00 โ€” 0 commitsThu 7:00 โ€” 0 commitsThu 8:00 โ€” 0 commitsThu 9:00 โ€” 0 commitsThu 10:00 โ€” 1 commitsThu 11:00 โ€” 0 commitsThu 12:00 โ€” 1 commitsThu 13:00 โ€” 2 commitsThu 14:00 โ€” 0 commitsThu 15:00 โ€” 1 commitsThu 16:00 โ€” 1 commitsThu 17:00 โ€” 1 commitsThu 18:00 โ€” 1 commitsThu 19:00 โ€” 0 commitsThu 20:00 โ€” 0 commitsThu 21:00 โ€” 0 commitsThu 22:00 โ€” 0 commitsThu 23:00 โ€” 1 commitsFri 0:00 โ€” 1 commitsFri 1:00 โ€” 0 commitsFri 2:00 โ€” 0 commitsFri 3:00 โ€” 0 commitsFri 4:00 โ€” 0 commitsFri 5:00 โ€” 0 commitsFri 6:00 โ€” 0 commitsFri 7:00 โ€” 0 commitsFri 8:00 โ€” 0 commitsFri 9:00 โ€” 0 commitsFri 10:00 โ€” 1 commitsFri 11:00 โ€” 1 commitsFri 12:00 โ€” 4 commitsFri 13:00 โ€” 6 commitsFri 14:00 โ€” 1 commitsFri 15:00 โ€” 0 commitsFri 16:00 โ€” 0 commitsFri 17:00 โ€” 0 commitsFri 18:00 โ€” 1 commitsFri 19:00 โ€” 0 commitsFri 20:00 โ€” 2 commitsFri 21:00 โ€” 0 commitsFri 22:00 โ€” 0 commitsFri 23:00 โ€” 0 commitsSat 0:00 โ€” 1 commitsSat 1:00 โ€” 0 commitsSat 2:00 โ€” 0 commitsSat 3:00 โ€” 0 commitsSat 4:00 โ€” 0 commitsSat 5:00 โ€” 0 commitsSat 6:00 โ€” 0 commitsSat 7:00 โ€” 0 commitsSat 8:00 โ€” 0 commitsSat 9:00 โ€” 0 commitsSat 10:00 โ€” 1 commitsSat 11:00 โ€” 2 commitsSat 12:00 โ€” 0 commitsSat 13:00 โ€” 0 commitsSat 14:00 โ€” 1 commitsSat 15:00 โ€” 0 commitsSat 16:00 โ€” 0 commitsSat 17:00 โ€” 0 commitsSat 18:00 โ€” 0 commitsSat 19:00 โ€” 0 commitsSat 20:00 โ€” 0 commitsSat 21:00 โ€” 0 commitsSat 22:00 โ€” 1 commitsSat 23:00 โ€” 0 commits
Commit volume by weekday and hour (UTC). Larger dots mean more commits.
DateListRankStars gained
Mar 26, 2026daily#12+111