Whisper Cheatsheet
Whisper is OpenAI's open-source general-purpose speech recognition model. It supports transcription and translation across 100+ languages, offers model sizes from tiny to large, runs on CPU or GPU, and outputs in txt/vtt/srt/tsv/json formats.
Quick Start
``bash
# Install
pip install openai-whisper
# Basic transcription whisper recording.mp3
# Specify model and language whisper meeting.mp3 --model small --language zh
# Translate Chinese audio to English whisper chinese_speech.mp3 --task translate
# Generate SRT subtitles whisper video_audio.mp3 --model base --output_format srt --output_dir ./subtitles
# GPU accelerated transcription
whisper long_podcast.mp3 --model medium --device cuda --fp16 True
`
Model Sizes
Whisper offers five pre-trained models trading speed for accuracy: tiny (39M params, ~1GB VRAM), base (74M, ~1GB), small (244M, ~2GB), medium (769M, ~5GB), large (1.5B, ~10GB). Models are downloaded automatically on first use.
Transcription & Translation
Two task modes: transcribe (speech to text in original language) and translate (speech to English text). Use --language to hint the source language for better accuracy. For bilingual audio, Whisper auto-detects.
Output Formats
Whisper supports multiple output formats. Use --output_format to choose: txt (plain text, default), vtt (WebVTT subtitles), srt (SubRip subtitles), tsv (tab-separated values with timestamps), json (full metadata including segments and word-level timestamps). Use all to generate all formats at once.
Advanced Options
--initial_prompt guides style or domain-specific terminology. --temperature controls sampling randomness (0 = deterministic). --condition_on_previous_text` improves long-form coherence. Batch transcribe multiple files with shell glob patterns.
Startup & Modes(20)
| Command | Level | ||
|---|---|---|---|
whisper --helpShow Whisper CLI help | Basic | whisper --help | |
whisper audio.mp3Transcribe audio file to text (basic usage) | Basic | whisper recording.mp3 | |
whisper audio.mp3 --modelSpecify Whisper model size | Basic | whisper recording.mp3 --model medium | |
whisper audio.mp3 --model tinyUse smallest model (fastest, least accurate) | Basic | whisper recording.mp3 --model tiny | |
whisper audio.mp3 --model largeUse largest model (slowest, most accurate) | Basic | whisper recording.mp3 --model large | |
whisper audio.mp3 --languageSpecify audio language (improves accuracy) | Intermediate | whisper chinese_speech.mp3 --language zh | |
whisper audio.mp3 --task transcribeTranscription task (default, keeps original language) | Basic | whisper french_audio.mp3 --task transcribe | |
whisper audio.mp3 --task translateTranslation task (translates any language to English) | Basic | whisper japanese_audio.mp3 --task translate | |
whisper audio.mp3 --output_formatSpecify output format (txt/vtt/srt/tsv/json/all) | Intermediate | whisper recording.mp3 --output_format srt | |
whisper audio.mp3 --output_dirSpecify output directory | Basic | whisper recording.mp3 --output_dir ./transcripts | |
whisper audio.mp3 --deviceSpecify inference device (cpu/cuda) | Intermediate | whisper recording.mp3 --device cuda | |
whisper audio.mp3 --fp16Enable half-precision inference (GPU acceleration) | Intermediate | whisper recording.mp3 --fp16 True | |
whisper audio.mp3 --verboseShow verbose output (with timestamps and confidence) | Basic | whisper recording.mp3 --verbose True | |
whisper audio.mp3 --temperatureSet sampling temperature (0-1, default 0) | Intermediate | whisper recording.mp3 --temperature 0.2 | |
whisper audio.mp3 --initial_promptSet initial prompt (guides style or corrects terms) | Expert | whisper medical.mp3 --initial_prompt 'Use medical terminology.' | |
whisper audio.mp3 --condition_on_previous_textUse previous text for better coherence | Intermediate | whisper long_lecture.mp3 --condition_on_previous_text True | |
pip install openai-whisperInstall Whisper | Basic | pip install openai-whisper | |
pip install openai-whisper[audio]Install Whisper (with audio dependencies) | Basic | pip install openai-whisper[audio] | |
whisper --model small audio.mp3Transcribe with small model (speed-quality balance) | Basic | whisper --model small meeting.mp3 --output_dir ./notes --output_format txt | |
whisper dir/*.mp3Batch transcribe all audio files in a directory | Intermediate | whisper podcasts/*.mp3 --model base --output_dir ./transcripts |