Same model weights, three runtimes worth knowing.
openai-whisper is the reference PyTorch implementation — slowest but the one papers cite.
faster-whisper wraps the CTranslate2 backend with int8 / fp16 quantization — ~4× faster, same accuracy.
HF transformers exposes Whisper through the standard pipeline / Trainer
API — the path for fine-tuning. whisper.cpp is a C++ port with no Python dependency — great for desktop / mobile / edge.
large-v3 is the current strongest checkpoint;
large-v3-turbo trades a small quality drop for ~8× speed.
Install · runtimesSetup
bash
# Pick ONE runtime — they all read the same .pt weights but ship different APIs
# 1 · Reference implementation (PyTorch, slow but matches paper)
pip install -U openai-whisper
# 2 · faster-whisper — CTranslate2 backend, 4× faster on CPU/GPU
pip install faster-whisper
# 3 · Hugging Face transformers — pipeline / Trainer / fine-tuning
pip install transformers accelerate
# 4 · whisper.cpp — C++ build, CPU + Apple Metal, no Python required
brew install whisper-cpp # or build from source
# ffmpeg is required by every Python runtime
brew install ffmpeg # macOS
apt install ffmpeg # Debian / Ubuntu
Pick the right oneModels
tiny / tiny.en
39M params. ~1GB VRAM. Real-time on CPU. Lowest accuracy.
base / base.en
74M. ~1GB. Strong CPU default.
small / small.en
244M. ~2GB. Good quality bump.
medium / medium.en
769M. ~5GB. Where quality starts to be production-grade.
large-v1, large-v2, large-v3
1550M. ~10GB. v3 is the current best multilingual.
English-only. Slightly better on English. Drop the suffix for multilingual.
Sizing rule: pick the largest that fits your latency budget. For batch transcription, use large-v3; for streaming or
edge, use small or large-v3-turbo.
Full text, per-segment metadata, detected language.
language="en", task="transcribe" | "translate"
Pin language; translate forces English output.
word_timestamps=True
Adds segment["words"] with per-word timing.
initial_prompt="acronyms: GPU, RAG, LCEL"
Seed the decoder. Improves rare vocab.
fp16=True, beam_size=5, temperature=0.0
Half precision, beam search, deterministic.
no_speech_threshold=0.6, logprob_threshold=-1.0
Heuristics for trimming silent or low-confidence segments.
condition_on_previous_text=False
Reset context between segments. Helps if hallucination loops appear.
Worked example
python
import whisper
# Loads weights to ~/.cache/whisper/ on first call
model = whisper.load_model("base", device="cuda") # cpu, cuda, mps
result = model.transcribe(
"interview.mp3",
language="en", # pin language to skip detection
task="transcribe", # or "translate" → English
fp16=True, # half precision on GPU
temperature=0.0, # deterministic
no_speech_threshold=0.6,
beam_size=5,
word_timestamps=True,
)
print(result["text"])
for seg in result["segments"]:
print(f"[{seg['start']:.2f} → {seg['end']:.2f}] {seg['text']}")
CTranslate2 backendfaster-whisper
from faster_whisper import WhisperModel
Drop-in alternative. Same weights, different runtime.
Boost specific phrases. Bias decoder probabilities.
Worked example
python
from faster_whisper import WhisperModel
# int8 = best speed/quality tradeoff on CPU; "float16" on GPU
model = WhisperModel(
"large-v3",
device="cuda",
compute_type="float16", # int8, int8_float16, float16, float32
)
segments, info = model.transcribe(
"interview.mp3",
language="en",
beam_size=5,
vad_filter=True, # built-in Silero VAD
vad_parameters={"min_silence_duration_ms": 500},
word_timestamps=True,
)
print(f"Detected: {info.language} ({info.language_probability:.2%})")
# segments is a generator — iterate to actually run inference
for seg in segments:
print(f"[{seg.start:.2f} → {seg.end:.2f}] {seg.text}")
for w in seg.words or []:
print(f" {w.start:.2f}-{w.end:.2f}: {w.word}")
Video → SRT · ~25 linesEnd-to-end · Video → subtitles
faster-whisper handles audio extraction (ffmpeg under the hood), VAD-filters silence, and we write a valid SRT file with segment timestamps.
python
from faster_whisper import WhisperModel
from datetime import timedelta
def fmt(t: float) -> str:
td = timedelta(seconds=t)
s = str(td)
return ("0:" + s if td.seconds < 3600 else s).replace(".", ",")[:11]
model = WhisperModel("medium", device="cuda", compute_type="float16")
segments, info = model.transcribe(
"lecture.mp4", # ffmpeg extracts audio automatically
vad_filter=True,
word_timestamps=True,
initial_prompt="Lecture on retrieval-augmented generation, May 2026.",
)
with open("lecture.srt", "w", encoding="utf-8") as f:
for i, seg in enumerate(segments, start=1):
f.write(f"{i}\n")
f.write(f"{fmt(seg.start)} --> {fmt(seg.end)}\n")
f.write(seg.text.strip() + "\n\n")
print(f"Wrote subtitles · language: {info.language}")
Best practiceGood to know
Pin language=… when you know it.
Language detection runs on the first 30s — on noisy or silent intros it picks wrong, then transcribes the whole file as Welsh. Skip the detection if you can.
Use faster-whisper for production.
Same weights, same accuracy, ~4× faster, supports int8 on CPU. The only reason to keep openai-whisper is if you’re reproducing paper numbers exactly.
initial_prompt is for vocabulary, not instructions.
Whisper isn’t instruction-tuned. Use a short string of domain terms / acronyms / proper nouns — not "transcribe carefully".
Common trapsWatch out for
Hallucinated repeating text on silence.
Whisper invents "thanks for watching" / "subtitles by…" during long pauses. Always run VAD on long-form audio, or set condition_on_previous_text=False.
.en models reject other languages silently.
Feed Spanish audio into base.en and you get garbage English. Use the multilingual checkpoint (drop the .en) when input language is not guaranteed.
Word timestamps cost ~30% more compute.
They require an extra cross-attention pass per word. Disable when you only need segment-level timing.
Whisper is an open-source speech-to-text model that transcribes and translates audio in 99 languages. It is used for video captions, meeting transcription, podcast search indexing, voice command pipelines, and accessibility tools. The large-v3 checkpoint achieves near-human accuracy on English.
What is the difference between Whisper and faster-whisper?
Both use the same model weights. openai-whisper is the reference PyTorch implementation — easiest to install, slowest to run. faster-whisper wraps the CTranslate2 backend with int8 or fp16 quantization, making it ~4x faster with the same accuracy. Use faster-whisper for production workloads.
How does Whisper handle long audio files?
Whisper has a 30-second context window. For long-form audio, enable VAD filtering (vad_filter=True in faster-whisper) to split on silences, or use the chunk_length_s parameter in the HuggingFace pipeline. The openai-whisper CLI handles long files automatically by splitting them with a sliding window.
Which Whisper model should I use?
large-v3 gives the highest accuracy. large-v3-turbo is ~8x faster with a small quality drop and is the practical default for most production use. medium.en is a good balance for English-only workloads. tiny and base are suitable for real-time on-device use where accuracy is less critical.
Is Whisper free to use?
Yes. The openai-whisper library and all model weights are open source under the MIT license. faster-whisper, whisper.cpp, and the HuggingFace transformers integration are also free. The OpenAI hosted Whisper API is a paid cloud service and is separate from the open-source model.