Jesse A. Green / notebook

Live demo: the DocCompiler guide library as a static, read-only snapshot (October 2026). No backend, no accounts, nothing to submit.

whisper.cpp User Guide

Generated June 2026 from ggml-org/whisper.cpp at ad17783

AI-generated documentation. The library is checked by sampling (three repositories so far); this guide was not individually reviewed. Verify against the project before relying on it.

whisper.cpp is a high-performance, dependency-free C/C++ implementation of OpenAI's Whisper automatic speech recognition (ASR) model. It transcribes and translates speech from audio files — or from a live microphone — entirely on your own machine, with no cloud service, no Python runtime, and no GPU strictly required. It runs on macOS, Linux, Windows, Android, iOS, the browser (WebAssembly), and Raspberry Pi, and can optionally accelerate inference on Apple Silicon (Metal / Core ML), NVIDIA (CUDA), AMD (ROCm), Intel (OpenVINO / SYCL), Vulkan, and more.

This guide shows you how to install it, fetch a model, transcribe your first file, and use every feature of the command-line tools. For architecture, the full build-option matrix, the C API, and deployment details, see the companion Admin Guide.

Note

The project ships as a small core library (whisper.h / libwhisper) plus a family of ready-to-use example programs — whisper-cli, whisper-server, whisper-stream, whisper-command, whisper-bench, and quantize. Most users interact with whisper-cli. This guide covers all of them.


Table of Contents

  1. Quick Start
  2. Requirements
  3. Installation
  4. Getting a Model
  5. Preparing Your Audio
  6. Transcribing with whisper-cli
  7. Output Formats
  8. Common Tasks (Recipes)
  9. Voice Activity Detection (VAD)
  10. Real-Time Microphone Transcription (whisper-stream)
  11. Voice Commands (whisper-command)
  12. The HTTP Server (whisper-server)
  13. Benchmarking (whisper-bench)
  14. Quantizing Models (quantize)
  15. whisper-cli Complete Option Reference
  16. How It Works (Concepts)
  17. Troubleshooting
  18. Frequently Asked Questions
  19. Reference Tables

1. Quick Start

Get from zero to a transcript in four commands:

# 1. Clone the repository
git clone https://github.com/ggml-org/whisper.cpp.git
cd whisper.cpp

# 2. Download a model (English-only "base" — small and fast)
sh ./models/download-ggml-model.sh base.en

# 3. Build the project
cmake -B build
cmake --build build -j --config Release

# 4. Transcribe the bundled sample
./build/bin/whisper-cli -f samples/jfk.wav

Expected output (abbreviated):

[00:00:00.000 --> 00:00:11.000]   And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country.

Tip

For an even faster demo, run make base.en from the repository root. It downloads the base.en model and transcribes every .wav file in the samples/ folder.

Important

By default the tools accept 16 kHz, 16-bit WAV audio. To transcribe an MP3, FLAC, OGG, or any other format, either convert it first with ffmpeg (see Section 5) or build with FFmpeg support enabled.


2. Requirements

Item Requirement
Compiler A C/C++17 toolchain — GCC, Clang, or MSVC
Build system CMake 3.28.0 or later
Disk (model) 75 MiB (tiny) to 2.9 GiB (large) per model — see memory table
RAM ~273 MB (tiny) to ~3.9 GB (large) at runtime
Audio (default) 16 kHz, 16-bit, mono or stereo WAV
ffmpeg (optional) For converting non-WAV audio, or for --convert on the server
sdl2 (optional) Required to build whisper-stream and whisper-command (live mic)

Supported platforms: macOS (Intel & Apple Silicon), Linux, FreeBSD, Windows (MSVC & MinGW), Android, iOS, Raspberry Pi, WebAssembly, and Docker.

Note

No Python is required to run whisper.cpp. Python is only needed if you convert your own models from PyTorch/Hugging Face or generate Core ML / OpenVINO encoder models (see the Admin Guide).


3. Installation

3.1 Build from source (all platforms)

This is the canonical install path. It produces all the example binaries in build/bin/.

Linux / macOS

git clone https://github.com/ggml-org/whisper.cpp.git
cd whisper.cpp
cmake -B build
cmake --build build -j --config Release

Windows (MSVC)

git clone https://github.com/ggml-org/whisper.cpp.git
cd whisper.cpp
cmake -B build
cmake --build build --config Release

After a successful build, the main tool is at ./build/bin/whisper-cli (on Windows, .\build\bin\Release\whisper-cli.exe).

Tip

cmake -B build configures a CPU-only build. To enable GPU or platform acceleration (CUDA, Metal, Vulkan, ROCm, OpenVINO, Core ML, BLAS), pass the matching -D flag at configure time. The full matrix is in the Admin Guide; the most common ones are summarized in Section 19.

3.2 Install with Conan

Pre-built binaries (or a from-source build) are available through the Conan C/C++ package manager:

conan install --requires="whisper-cpp/[*]" --build=missing

3.3 Docker

Official images are published to GitHub Container Registry. They bundle the binaries plus curl and ffmpeg:

# Download a model into a persistent local folder
docker run -it --rm \
  -v path/to/models:/models \
  ghcr.io/ggml-org/whisper.cpp:main "./models/download-ggml-model.sh base /models"

# Transcribe an audio file
docker run -it --rm \
  -v path/to/models:/models \
  -v path/to/audios:/audios \
  ghcr.io/ggml-org/whisper.cpp:main "whisper-cli -m /models/ggml-base.bin -f /audios/jfk.wav"
Image Description Platforms
ghcr.io/ggml-org/whisper.cpp:main Main binaries + curl + ffmpeg linux/amd64, linux/arm64
ghcr.io/ggml-org/whisper.cpp:main-cuda As above, compiled with CUDA linux/amd64
ghcr.io/ggml-org/whisper.cpp:main-musa As above, compiled with MUSA (Moore Threads) linux/amd64
ghcr.io/ggml-org/whisper.cpp:main-vulkan As above, compiled with Vulkan linux/amd64

3.4 Apple platforms (XCFramework)

For Swift projects, a precompiled whisper.xcframework (iOS, visionOS, tvOS, macOS) is attached to each release, so you do not need to compile from source. Add it as a Swift Package binary target — see the example in the README.


4. Getting a Model

whisper.cpp loads models in its own compact ggml binary format (a single .bin file containing the weights, mel filters, and vocabulary). The easiest way to get one is the bundled download script.

4.1 Download a ready-made model

sh ./models/download-ggml-model.sh base.en

This saves ggml-base.en.bin into the models/ directory. Run the script with no arguments to list every available model:

sh ./models/download-ggml-model.sh

You can also download all the common models through make:

make -j tiny.en
make -j base
make -j small
make -j large-v3-turbo
# ...etc

4.2 Which model should I choose?

Model names follow the pattern {size}[.en][-{quantization}]:

  • Size — tiny, base, small, medium, large-v1, large-v2, large-v3, large-v3-turbo. Bigger = more accurate but slower and heavier.
  • .en — English-only variant. Smaller and more accurate for English, but cannot transcribe or detect other languages.
  • -q5_0 / -q5_1 / -q8_0 — integer-quantized variants. Smaller on disk and in RAM, often faster, with a small accuracy cost.
  • -tdrz — a tinydiarize model that marks speaker turns (currently small.en-tdrz).

Tip

Start with base.en for English or base for other languages. Move up to small/medium if accuracy is insufficient. Use large-v3-turbo when you want near-large quality at much higher speed.

See the full model list in the reference section.

Note

When downloading gated or rate-limited models, set the HF_TOKEN environment variable to a Hugging Face access token; the download script forwards it as an Authorization header.

4.3 Convert your own model

If you have a fine-tuned Whisper checkpoint (PyTorch or Hugging Face), you can convert it to ggml format with the Python scripts in models/. This requires Python and the original OpenAI whisper package. See the Admin Guide for the conversion workflow.


5. Preparing Your Audio

The example tools decode audio with the built-in miniaudio library. whisper-cli directly supports these formats:

flac, mp3, ogg, wav

Internally, Whisper always works at a 16 kHz sample rate. If you have audio in another format or sample rate, convert it with ffmpeg:

ffmpeg -i input.mp3 -ar 16000 -ac 1 -c:a pcm_s16le output.wav
  • -ar 16000 resamples to 16 kHz.
  • -ac 1 downmixes to mono (use -ac 2 to keep stereo, which is needed for --diarize).
  • -c:a pcm_s16le writes 16-bit PCM WAV.

Tip

To decode a broader range of formats directly (Opus, M4A, etc.) without a manual conversion step, build with FFmpeg support: cmake -B build -D WHISPER_COMMON_FFMPEG=yes (requires the libav* development libraries). See the Admin Guide.

Warning

Passing a non-16 kHz or non-WAV file to a tool built without FFmpeg support will fail to decode. Convert it first.


6. Transcribing with whisper-cli

whisper-cli is the primary tool. The general form is:

whisper-cli [options] file0.wav [file1.wav ...]

You can pass one or more audio files as positional arguments, or use -f/--file.

6.1 Basic transcription

./build/bin/whisper-cli -m models/ggml-base.en.bin -f samples/jfk.wav
  • -m / --model — path to the ggml model. Defaults to models/ggml-base.en.bin.
  • -f / --file — input audio file. May be repeated for multiple files.

By default, transcribed segments are printed to standard output with timestamps:

[00:00:00.000 --> 00:00:11.000]   And so my fellow Americans...

6.2 Choosing a language

For multilingual models, set the spoken language with -l/--language (a two-letter code such as de, es, fr, or a full name):

whisper-cli -m models/ggml-base.bin -l de -f german_audio.wav

Use -l auto to let Whisper detect the language automatically. To only detect the language and then exit (without transcribing), use -dl/--detect-language:

whisper-cli -m models/ggml-base.bin -dl -f mystery.wav

Note

English-only (.en) models ignore language and translation options. If you need other languages, use a multilingual model (one without the .en suffix).

6.3 Translating to English

Add -tr/--translate to translate speech in any supported language into English text:

whisper-cli -m models/ggml-medium.bin -l ja -tr -f japanese_audio.wav

6.4 Controlling threads and processors

whisper-cli -m models/ggml-base.en.bin -t 8 -f audio.wav
  • -t / --threads N — number of CPU threads (default: up to 4, capped at your core count).
  • -p / --processors N — split the audio into N chunks processed in parallel. Useful on many-core CPUs, but accuracy can degrade at chunk boundaries.

6.5 Selecting a portion of the audio

# Start 30 seconds in, process 60 seconds of audio
whisper-cli -m models/ggml-base.en.bin -ot 30000 -d 60000 -f long_audio.wav
  • -ot / --offset-t N — start offset in milliseconds.
  • -d / --duration N — duration to process in milliseconds (0 = to the end).

6.6 An initial prompt

Provide context or a vocabulary hint to improve accuracy on names and jargon:

whisper-cli -m models/ggml-base.en.bin --prompt "Acme Corp, Kubernetes, gRPC" -f meeting.wav

Use --carry-initial-prompt to prepend the prompt to every decoding window (not just the first).


7. Output Formats

whisper-cli can write results to files alongside printing to the console. Each flag enables one format; the file is named after the input (or after -of).

Flag Long form File Contents
-otxt --output-txt .txt Plain text, one segment per line
-ovtt --output-vtt .vtt WebVTT subtitles
-osrt --output-srt .srt SubRip subtitles
-olrc --output-lrc .lrc LRC synced-lyrics format
-ocsv --output-csv .csv CSV: start,end,[speaker,]text
-oj --output-json .json Structured JSON
-ojf --output-json-full .json JSON with per-token data (implies -oj)
-owts --output-words .wts Bash script that renders a karaoke video with ffmpeg

Example — produce SRT subtitles and a JSON transcript:

whisper-cli -m models/ggml-base.en.bin -f talk.wav -osrt -oj

This writes talk.wav.srt and talk.wav.json. To control the base output name:

whisper-cli -m models/ggml-base.en.bin -f talk.wav -osrt -of subtitles/talk

Tip

Use -of - to write a single format to standard output (stdout). You cannot stream more than one file format to stdout at once.

Karaoke videos

-owts generates a shell script that drives ffmpeg to produce a video with the currently spoken word highlighted:

whisper-cli -m models/ggml-base.en.bin -f samples/jfk.wav -owts
source ./samples/jfk.wav.wts
ffplay ./samples/jfk.wav.mp4

You may need to supply a monospace font with -fp/--font-path on non-macOS systems.


8. Common Tasks (Recipes)

Transcribe and save subtitles for a video

ffmpeg -i lecture.mp4 -ar 16000 -ac 1 -c:a pcm_s16le lecture.wav
whisper-cli -m models/ggml-small.en.bin -f lecture.wav -osrt

Color-code transcription confidence

whisper-cli -m models/ggml-base.en.bin -f samples/gb0.wav --print-colors

High-confidence words are printed brighter, low-confidence words dimmer. Use --print-confidence for a confidence-highlighting style instead.

Limit segment length / get word-level timestamps

# Cap each line at 16 characters
whisper-cli -m models/ggml-base.en.bin -f samples/jfk.wav -ml 16

# One word per segment (word-level timestamps)
whisper-cli -m models/ggml-base.en.bin -f samples/jfk.wav -ml 1

Combine -sow/--split-on-word so splits happen on word boundaries rather than mid-token.

Speaker turn detection (tinydiarize)

sh ./models/download-ggml-model.sh small.en-tdrz
whisper-cli -m models/ggml-small.en-tdrz.bin -tdrz -f samples/a13.wav

Speaker changes are marked inline with [SPEAKER_TURN]:

[00:00:00.000 --> 00:00:03.800]   Okay Houston, we've had a problem here. [SPEAKER_TURN]
[00:00:03.800 --> 00:00:06.200]   This is Houston. Say again please. [SPEAKER_TURN]

Stereo speaker diarization

For two-channel recordings (e.g. two-party phone calls panned left/right), -di/--diarize labels each segment with (speaker 0) / (speaker 1) based on per-channel energy:

whisper-cli -m models/ggml-base.en.bin -di -f stereo_call.wav

Caution

--diarize and --tinydiarize are mutually exclusive — the tool exits with an error if both are given. --diarize requires a true stereo (2-channel) file.

Token-level timestamps (DTW)

whisper-cli -m models/ggml-base.en.bin -dtw base.en -f samples/jfk.wav

-dtw/--dtw enables experimental Dynamic Time Warping alignment. Pass the model preset that matches your model (tiny, base.en, small, large.v3.turbo, etc.).

Guide decoding with a grammar

whisper-cli -m models/ggml-base.en.bin --grammar commands.gbnf --grammar-rule root -f audio.wav

--grammar accepts a GBNF grammar file or string, biasing the output toward grammar-conformant tokens. --grammar-penalty scales down non-grammar tokens (default 100.0).

Read arguments from a file

If the only argument starts with @, whisper-cli reads its command-line arguments line-by-line from that file:

whisper-cli @args.txt

9. Voice Activity Detection (VAD)

VAD pre-filters the audio so Whisper only processes segments that actually contain speech. This can dramatically speed up transcription of recordings with long silences. whisper.cpp uses the Silero-VAD model.

Enable VAD

# Download a VAD model
sh ./models/download-vad-model.sh silero-v6.2.0

# Transcribe with VAD
whisper-cli \
   --file ./samples/jfk.wav \
   --model ./models/ggml-base.en.bin \
   --vad \
   --vad-model ./models/ggml-silero-v6.2.0-ggml.bin

Available VAD models: silero-v5.1.2, silero-v6.2.0.

VAD tuning options

Flag Default Meaning
-vt, --vad-threshold 0.5 Speech probability threshold; frames above it count as speech
-vspd, --vad-min-speech-duration-ms 250 Discard speech segments shorter than this (filters noise)
-vsd, --vad-min-silence-duration-ms 100 Silence shorter than this does not end a segment
-vmsd, --vad-max-speech-duration-s FLT_MAX Force-split segments longer than this
-vp, --vad-speech-pad-ms 30 Padding added before/after each speech segment
-vo, --vad-samples-overlap 0.10 Seconds of overlap carried between adjacent segments

Tip

Lower --vad-threshold if quiet speech is being dropped; raise it if background noise is being treated as speech.


10. Real-Time Microphone Transcription (whisper-stream)

whisper-stream transcribes live audio from your microphone continuously, sampling in fixed windows.

Important

whisper-stream requires SDL2 and is only built when you configure with -DWHISPER_SDL2=ON:

cmake -B build -DWHISPER_SDL2=ON
cmake --build build -j --config Release
./build/bin/whisper-stream -m ./models/ggml-base.en.bin -t 8 --step 500 --length 5000
Flag Default Meaning
-t, --threads N 4 CPU threads
--step N — Audio step size in milliseconds between transcription passes
--length N — Length of the audio window in milliseconds
--keep N — Audio (ms) to carry over from the previous step
-c, --capture ID — Capture device ID (which microphone)
-mt, --max-tokens N — Max tokens per audio chunk
-ac, --audio-ctx N — Audio context size (0 = full)
-bs, --beam-size N — Beam size for beam search
-vth, --vad-thold — Voice-activity-detection threshold
-fth, --freq-thold — High-pass frequency cutoff
-tr, --translate off Translate to English
-kc, --keep-context off Keep decoder context between chunks
-sa, --save-audio off Save the captured audio to a file
-l, --language — Spoken language
-f, --file FNAME — Write transcript to a text file

Tip

Setting --step 0 switches whisper-stream into a sliding VAD-based mode where it transcribes whenever it detects a pause. Smaller --step values give lower latency but more CPU load.


11. Voice Commands (whisper-command)

whisper-command is a minimal offline voice-assistant example: it listens for short spoken commands and prints them. Like whisper-stream, it requires SDL2.

./build/bin/whisper-command -m ./models/ggml-base.en.bin -t 8
Flag Meaning
-pms, --prompt-ms N Prompt (activation phrase) duration in ms
-cms, --command-ms N Command capture duration in ms
-c, --capture ID Capture device ID
-cmd, --commands FNAME Text file listing the allowed commands
-p, --prompt Required activation prompt phrase
-ctx, --context Sample text to help transcription
--grammar GRAMMAR GBNF grammar to constrain recognized commands
--grammar-penalty N Scales down non-grammar tokens
-pe, --print-energy Print sound energy (debugging)
-vth, --vad-thold VAD threshold
-fth, --freq-thold High-pass frequency cutoff

Provide a fixed command list with -cmd commands.txt (one command per line) to restrict recognition to a known vocabulary, or a --grammar for more structured input.


12. The HTTP Server (whisper-server)

whisper-server exposes transcription over an HTTP API with an OpenAI-compatible response shape. Start it pointing at a model:

./build/bin/whisper-server -m models/ggml-base.en.bin --host 0.0.0.0 --port 8080

It prints:

whisper server listening at http://0.0.0.0:8080

Open http://localhost:8080/ in a browser for a simple upload form, or use the API directly.

12.1 POST /inference — transcribe

Send a multipart/form-data request with a file field:

curl 127.0.0.1:8080/inference \
  -H "Content-Type: multipart/form-data" \
  -F file="@samples/jfk.wav" \
  -F temperature="0.0" \
  -F temperature_inc="0.2" \
  -F response_format="json"

The file field is required (a missing file returns HTTP 400). Most whisper-cli parameters can be supplied as additional form fields, including: temperature, temperature_inc, offset_t, offset_n, duration, max_context, max_len, best_of, beam_size, audio_ctx, word_thold, entropy_thold, logprob_thold, no_speech_thold, translate, diarize, tinydiarize, split_on_word, no_timestamps, token_timestamps, language, detect_language, prompt, carry_initial_prompt, suppress_nst, the vad* family, and no_language_probabilities.

Response formats (set via the response_format field):

response_format Content-Type Description
json (default) application/json { "text": "..." }
verbose_json application/json Full object: task, language, duration, per-segment data, tokens, words, timestamps, probabilities
text text/html; charset=utf-8 Plain transcript
srt application/x-subrip SubRip subtitles
vtt text/vtt WebVTT subtitles

A verbose_json response looks like:

{
  "task": "transcribe",
  "language": "english",
  "duration": 11.0,
  "text": " And so my fellow Americans...",
  "segments": [
    {
      "id": 0,
      "text": " And so my fellow Americans...",
      "start": 0.0,
      "end": 11.0,
      "words": [ { "word": " And", "start": 0.0, "end": 0.32, "probability": 0.97 } ],
      "temperature": 0.0,
      "avg_logprob": -0.21,
      "no_speech_prob": 0.02
    }
  ]
}

Note

Computing the full language_probabilities block is expensive. Start the server with -nlp/--no-language-probabilities (or send the form field) to omit it from verbose_json responses.

12.2 POST /load — swap models at runtime

curl 127.0.0.1:8080/load \
  -H "Content-Type: multipart/form-data" \
  -F model="models/ggml-small.en.bin"

The model field must be a path to a file that exists on the server. On success it returns Load was successful!.

12.3 GET /health — readiness check

curl 127.0.0.1:8080/health

Returns {"status":"ok"} (HTTP 200) when the model is loaded, or {"status":"loading model"} (HTTP 503) while it is still starting.

12.4 Server options

In addition to the shared transcription flags, the server accepts:

Flag Default Meaning
--host HOST 127.0.0.1 Bind address
--port PORT 8080 Listen port
--public PATH examples/server/public Folder of static files to serve at /
--request-path PATH (empty) Prefix applied to all request paths
--inference-path PATH /inference Path for the transcription endpoint
--convert off Convert uploaded audio to WAV with ffmpeg (server must have ffmpeg installed)
--tmp-dir PATH . Temp directory for ffmpeg-transcoded files

Warning

Without --convert, the server only accepts audio formats that miniaudio can decode directly (WAV/FLAC/MP3/OGG). Uploading other formats (e.g. a raw container the decoder does not recognize) will fail with a 400/500 error. Enable --convert for broad format support, and make sure ffmpeg is on the server's PATH.

Important

The server processes one request at a time (a single model context guarded by a mutex). For higher throughput, run multiple instances behind a load balancer.


13. Benchmarking (whisper-bench)

whisper-bench measures how fast the model's encoder (and related operations) run on your hardware:

./build/bin/whisper-bench -m models/ggml-base.en.bin -t 4
Flag Default Meaning
-m, --model FNAME models/ggml-base.en.bin Model to benchmark
-t, --threads N 4 CPU threads
-w, --what N 0 What to benchmark (0 = encoder; other values run memcpy / matrix-multiply micro-benchmarks)
-ng, --no-gpu off Disable GPU
-fa, --flash-attn off Enable flash attention

A higher-level Python script, scripts/bench.py, runs whisper.cpp across several models and thread counts and emits a CSV:

python3 scripts/bench.py -f samples/jfk.wav -t 2,4,8 -p 1,2

14. Quantizing Models (quantize)

Quantization shrinks a model and can speed up inference at a small accuracy cost. The quantize tool converts a full-precision ggml model into a quantized one:

./build/bin/quantize models/ggml-base.en.bin models/ggml-base.en-q5_0.bin q5_0

The general form is:

quantize <model-f32.bin> <model-quant.bin> <type>

Common <type> values include q4_0, q5_0, q5_1, and q8_0 (run quantize with no arguments to print the supported types). Then use the quantized model exactly like any other:

whisper-cli -m models/ggml-base.en-q5_0.bin -f samples/gb0.wav

Tip

Many quantized models are already published and downloadable directly (e.g. base.en-q5_1, large-v3-turbo-q5_0) — you only need quantize for models you converted yourself.


15. whisper-cli Complete Option Reference

Every option accepted by whisper-cli, with its default value and meaning.

General

Short Long Default Description
-h --help — Show help and exit
-t --threads N 4 (capped at cores) Threads used during computation
-p --processors N 1 Processors to split work across
-m --model FNAME models/ggml-base.en.bin Model path
-f --file FNAME — Input audio file (repeatable)
-of --output-file FNAME — Output base name (no extension)

Audio range & decoding

Short Long Default Description
-ot --offset-t N 0 Start offset (ms)
-on --offset-n N 0 Segment index offset
-d --duration N 0 Duration to process (ms)
-mc --max-context N -1 Max text-context tokens carried
-ml --max-len N 0 Max segment length (characters)
-sow --split-on-word false Split on word, not token
-bo --best-of N model default Candidates kept (greedy)
-bs --beam-size N model default Beam size (beam search)
-ac --audio-ctx N 0 Audio context size (0 = all)
-wt --word-thold N 0.01 Word-timestamp probability threshold
-et --entropy-thold N 2.40 Entropy threshold for decoder fallback
-lpt --logprob-thold N -1.00 Log-probability threshold for fallback
-nth --no-speech-thold N 0.60 No-speech threshold
-tp --temperature N 0.00 Sampling temperature
-tpi --temperature-inc N 0.20 Temperature increment on fallback
-nf --no-fallback false Disable temperature fallback

Language & task

Short Long Default Description
-l --language LANG en Spoken language (auto to detect)
-dl --detect-language false Detect language, then exit
-tr --translate false Translate to English
— --prompt PROMPT — Initial prompt (≤ n_text_ctx/2 tokens)
— --carry-initial-prompt false Prepend prompt to every window
-sns --suppress-nst false Suppress non-speech tokens
— --suppress-regex REGEX — Regex of tokens to suppress

Output

Short Long Description
-otxt --output-txt Text file
-ovtt --output-vtt VTT file
-osrt --output-srt SRT file
-olrc --output-lrc LRC file
-owts --output-words Karaoke video script
-ocsv --output-csv CSV file
-oj --output-json JSON file
-ojf --output-json-full JSON with token detail
-fp --font-path Monospace font for karaoke video

Display

Short Long Default Description
-np --no-prints false Print only the results
-ps --print-special false Print special tokens
-pc --print-colors false Color-code by confidence
— --print-confidence false Confidence-highlighting style
-pp --print-progress false Print progress
-nt --no-timestamps false Hide timestamps
-ls --log-score false Log decoder token scores
-debug --debug-mode false Extra debug info (e.g. dump log_mel)

Diarization & alignment

Short Long Default Description
-di --diarize false Stereo (2-channel) diarization
-tdrz --tinydiarize false tinydiarize speaker-turn detection (needs a -tdrz model)
-dtw --dtw MODEL — Token-level timestamps via DTW (give model preset)

Hardware & backends

Short Long Default Description
-ng --no-gpu GPU on Disable GPU
-dev --device N 0 GPU device ID
-fa --flash-attn on Enable flash attention
-nfa --no-flash-attn — Disable flash attention
-oved --ov-e-device DNAME CPU OpenVINO device for encoder

VAD

See Section 9 for the --vad, -vm, -vt, -vspd, -vsd, -vmsd, -vp, and -vo options.

Note

The environment variable WHISPER_ARG_DEVICE, if set, overrides the default GPU device ID at startup (equivalent to -dev).


16. How It Works (Concepts)

Understanding a few concepts helps you pick the right options.

The model pipeline. whisper.cpp runs the Whisper architecture end to end: raw audio → log-mel spectrogram → Transformer encoder → Transformer decoder → text. The decoder generates text tokens autoregressively, optionally conditioned on an initial prompt and previous context.

Segments. Output is divided into segments — a few words, a sentence, or a paragraph — each with a start and end timestamp. The output-format and display options all operate on segments (or, for word-level features, on the tokens within them).

Temperature fallback. Whisper decodes greedily at temperature 0 by default. If a segment fails quality checks (entropy or log-probability thresholds), it retries at progressively higher temperatures, stepping by --temperature-inc. --no-fallback disables this, which is faster but can leave low-quality segments.

Quantization. The ggml format supports integer-quantized weights (q5_0, q8_0, etc.), trading a little accuracy for smaller memory footprint and often faster inference. See Section 14.

Acceleration backends. The same model file runs on CPU or any compiled-in accelerator (Metal, CUDA, Vulkan, ROCm, OpenVINO, Core ML, BLAS). The backend is chosen at build time; at runtime you can only toggle GPU on/off (-ng) and pick a device (-dev). For the full backend matrix and how to build each, see the Admin Guide.

VAD. Voice Activity Detection (Silero) finds the speech regions and skips silence, reducing the amount of audio Whisper has to process.


17. Troubleshooting

Error: error: failed to initialize whisper context

Cause: The model file is missing, corrupt, or not in ggml format. Solution: Confirm the path passed to -m exists and re-download with sh ./models/download-ggml-model.sh <model>. Prevention: Keep models in a known models/ directory and verify downloads completed.

Error: error: input file not found '<file>'

Cause: The audio path is wrong, or the file was removed before processing. Solution: Check the path; use an absolute path if unsure. Non-existent inputs are skipped automatically.

Error: error: no input files specified

Cause: No audio file was passed (neither positionally nor with -f). Solution: Add an audio file: whisper-cli -f samples/jfk.wav.

Error: error: unknown language '<x>'

Cause: The -l value is not a recognized language code or name. Solution: Use a valid two-letter code (e.g. en, de, ja) or auto.

Error: error: cannot use both --diarize and --tinydiarize

Cause: Both diarization modes were requested. Solution: Choose one. Use --diarize for stereo channel-energy diarization, --tinydiarize (with a -tdrz model) for speaker-turn marking.

Error: error: failed to read audio data / failed to read WAV file

Cause: The audio is not 16 kHz/16-bit WAV and the build lacks FFmpeg support, or the file is malformed. Solution: Convert first: ffmpeg -i input.* -ar 16000 -ac 1 -c:a pcm_s16le output.wav, or build with -D WHISPER_COMMON_FFMPEG=yes.

Error: error: unknown DTW preset '<x>'

Cause: The -dtw value does not match a known model preset. Solution: Pass a preset that matches your model: tiny, tiny.en, base, base.en, small, small.en, medium, medium.en, large.v1, large.v2, large.v3, large.v3.turbo.

The server returns an error for non-WAV uploads

Cause: whisper-server was started without --convert, so it can only decode formats miniaudio supports directly. Solution: Start it with --convert and ensure ffmpeg is installed on the server (see GitHub issues #3774, #3819).

whisper-stream / whisper-command were not built

Cause: SDL2 support was not enabled at configure time. Solution: Reconfigure with cmake -B build -DWHISPER_SDL2=ON and rebuild.

Transcription is slow on CPU

Cause: Large model, CPU-only build, or too few threads. Solution: Increase -t, use a smaller or quantized model, enable a GPU backend at build time, or use --vad to skip silence.

Output contains repeated or hallucinated text on silence

Cause: Whisper can hallucinate on long silences or noise. Solution: Enable --vad, raise --no-speech-thold, or use --suppress-nst.

How do I suppress all the log output?

Cause: whisper.cpp prints model/system info to stderr by default. Solution: Use -np/--no-prints to print only results (see issue #1448).

Caution

Two security issues affecting the bundled audio/model loaders were reported by the community (#3807 null-pointer/assertion via zero-dimension model parameters, and #3802 heap overflow in vendored stb_vorbis). Only process audio and model files from sources you trust, especially when running whisper-server exposed to a network.


18. Frequently Asked Questions

Q: Do I need a GPU? No. whisper.cpp runs on CPU out of the box. GPU/accelerator support is optional and enabled at build time for extra speed.

Q: Does it work offline? Yes — entirely. The only network access is downloading the model once.

Q: What audio formats are supported? whisper-cli accepts flac, mp3, ogg, and wav directly via miniaudio. For anything else, convert to 16 kHz WAV with ffmpeg, or build with WHISPER_COMMON_FFMPEG.

Q: Which model is most accurate? large-v3 is the most accurate; large-v3-turbo is nearly as accurate but much faster. For English, the .en models are excellent and lighter.

Q: Can it translate, not just transcribe? Yes. -tr/--translate translates speech in any supported language to English text (multilingual model required).

Q: How do I get subtitles? Use -osrt (SubRip) or -ovtt (WebVTT). For a video, extract/convert the audio first.

Q: How do I transcribe live from my microphone? Build with -DWHISPER_SDL2=ON and use whisper-stream.

Q: Can I call it from my own program? Yes. whisper.cpp ships a C API in whisper.h and has official bindings for Go, Java, Ruby, and JavaScript/WASM, plus many community bindings (Rust, Python, .NET, Swift, Unity, R). See the C API and bindings sections of the Admin Guide.

Q: How do I reduce memory use? Use a smaller model or a quantized variant (-q5_0, -q8_0). See the memory table.

Q: Why are language and translation options ignored? You are using an English-only (.en) model. Switch to a multilingual model.

Q: Can the server load a different model without restarting? Yes — POST /load with a model form field pointing at a file on the server.

Q: What does [SPEAKER_TURN] mean in the output? You ran with --tinydiarize and a -tdrz model; it marks where the speaker changes.

Q: What does --print-colors do? It color-codes each word by the model's confidence (brighter = higher confidence).

Q: Is there speaker diarization? Two experimental approaches: --diarize (stereo channel-energy heuristic) and --tinydiarize (speaker-turn detection with a special model). Full multi-speaker diarization is a long-standing feature request (#64).


19. Reference Tables

Example binaries

Binary Purpose Needs SDL2
whisper-cli Transcribe / translate audio files No
whisper-server HTTP transcription server (OpenAI-like API) No
whisper-stream Real-time microphone transcription Yes
whisper-command Offline voice-command assistant Yes
whisper-bench Benchmark inference performance No
quantize Quantize a ggml model No
whisper-talk-llama Voice chat with a LLaMA model Yes
vad-speech-segments Extract speech segments using VAD No

Available models

Downloadable via models/download-ggml-model.sh:

tiny            tiny.en         tiny-q5_1       tiny.en-q5_1    tiny-q8_0
base            base.en         base-q5_1       base.en-q5_1    base-q8_0
small           small.en        small.en-tdrz   small-q5_1      small.en-q5_1   small-q8_0
medium          medium.en       medium-q5_0     medium.en-q5_0  medium-q8_0
large-v1        large-v2        large-v2-q5_0   large-v2-q8_0
large-v3        large-v3-q5_0   large-v3-turbo  large-v3-turbo-q5_0   large-v3-turbo-q8_0

Legend: .en = English-only, -q5_[01]/-q8_0 = quantized, -tdrz = tinydiarize.

VAD models (via models/download-vad-model.sh): silero-v5.1.2, silero-v6.2.0.

Memory and disk by model

Model Disk RAM (approx.)
tiny 75 MiB ~273 MB
base 142 MiB ~388 MB
small 466 MiB ~852 MB
medium 1.5 GiB ~2.1 GB
large 2.9 GiB ~3.9 GB

Backend build flags

Set at cmake -B build configure time (see the Admin Guide for full details):

Flag Enables
-DGGML_CUDA=1 NVIDIA GPU (cuBLAS + CUDA kernels)
-DGGML_VULKAN=1 Vulkan (cross-vendor GPU)
-DGGML_HIP=1 AMD ROCm GPU
-DGGML_BLAS=1 CPU BLAS (e.g. OpenBLAS)
-DGGML_CANN=1 Huawei Ascend NPU
-DGGML_MUSA=1 Moore Threads GPU
-DWHISPER_COREML=1 Apple Core ML (ANE) encoder
-DWHISPER_OPENVINO=1 Intel OpenVINO encoder
-DWHISPER_SDL2=ON Build whisper-stream / whisper-command
-DWHISPER_COMMON_FFMPEG=yes FFmpeg audio decoding in examples

Audio at a glance

  • Internal sample rate: 16 kHz (WHISPER_SAMPLE_RATE).
  • Default-supported formats: flac, mp3, ogg, wav.
  • Convert anything else: ffmpeg -i in.* -ar 16000 -ac 1 -c:a pcm_s16le out.wav.