New Tool Radar

Local Speech & Transcription

How to Shrink a whisper.cpp Model With Q5_0 Quantization

Quantize a whisper.cpp model to q5_0 with the quantize tool so it takes less disk and memory, then run it the same way.

Schematic diagram with four steps: build whisper.cpp, run the quantize tool with q5_0, check the file is smaller, then transcribe with the quantized model.

Whisper models are big — the large model is 2.9 GiB on disk — and quantization shrinks them. whisper.cpp supports integer quantization of its ggml models: a quantized model needs less memory and disk, and on some hardware it runs faster too.

Quantize the model and run it

Build the project, then run the quantize tool: ./build/bin/quantize models/ggml-base.en.bin models/ggml-base.en-q5_0.bin q5_0. Then use the quantized file exactly like the original: ./build/bin/whisper-cli -m models/ggml-base.en-q5_0.bin ./samples/gb0.wav. The command line does not change — only the model file does.

cmake -B build
cmake --build build -j --config Release
./build/bin/quantize models/ggml-base.en.bin models/ggml-base.en-q5_0.bin q5_0
./build/bin/whisper-cli -m models/ggml-base.en-q5_0.bin ./samples/gb0.wav

Quantization trades a little accuracy for size: a q5_0 model is smaller and lighter, and the transcription quality drops slightly. Test the quantized model on a recording you can check by ear before replacing the full model in a workflow.

Try it: four checks

Check What you should see If you do not see it
Quantize runs The quantize tool finishes Check the build completed
File smaller The q5_0 file is smaller than the original Compare the file sizes
Runs the same whisper-cli accepts the quantized file Only the -m path changes
Quality checked The transcript is still accurate enough Compare with the full model

Expected result. We checked the whisper.cpp README, which documents the quantize steps with the q5_0 method and running the quantized model with whisper-cli. We did not quantize a model on this machine.

Limits

This guide covers the q5_0 quantization only. Quantization trades accuracy for size. We did not test any quantization ourselves.

Sources

See all