whisper.cpp/models
Georgi Gerganov 02d5316af5
ci : refactor + optimize (#3847)
* ci : add ccache clear action

* ci : split self-hosted GPU jobs into build-self-hosted.yml

Extract self-hosted runner jobs from build.yml into a dedicated
build-self-hosted.yml following the llama.cpp pattern:
  - gpu-cuda (NVIDIA Linux)
  - gpu-vulkan-nvidia-cm (NVIDIA Linux)
  - gpu-vulkan-nvidia-cm2 (NVIDIA Linux + COOPMAT2)
  - gpu-metal (macOS ARM64)
  - gpu-vulkan (macOS ARM64)

GitHub-hosted CPU jobs remain in build.yml.

Assisted-by: llama.cpp:local pi

* ci : split release jobs into release.yml

Extract release-related jobs from build.yml into a dedicated
release.yml following the llama.cpp pattern:
  - determine-tag
  - windows (Win32/x64, SDL2)
  - windows-blas (Win32/x64, OpenBLAS)
  - windows-cublas (x64, CUDA 11.8/12.4)
  - ios-xcode-build
  - bindings-java (depends on windows)
  - release (artifact aggregation + GitHub release)

CoreML job stays in build.yml with its own local tag calculation.

Assisted-by: llama.cpp:local pi

* ci : remove bindings-java job from release.yml

Assisted-by: llama.cpp:local pi

* cont : add manual trigger for build.yml

* cont : remove obsolete ifs

* ci : extract sanitizer job to bild-sanitize.yml

* ci : extract linux jobs into build-linux.yml

* ci : extract macos jobs to build-macos.yml

* ci : extract gcc jobs to build-gcc.yml

* ci : extract clang jobs to build-clang.yml

* ci : extract sycl jobs to build-sycl.yml

* ci : extract windows jobs to build-windows.yml

* ci : extract emscripten job to build-wasm.yml

* ci : extract android jobs into build-android.yml

* ci : extract quantize job to quantize.yml

* ci : extract coreml job into coreml.yml

* ci : extract vad job to vad.yml

* ci : extract cpu jobs to build-cpu.yml

* ci : make naming of yml files consistent

* ci : add --fail to curl download and propagate

This commit adds the --fail option to the model download scripts so that
if the model download returns a server error this is picked up. This is
then detected in run.sh and a error message is displayed and the script
stops and returns an error.

The motivation for this is that currently it is possible for the model
download to fail but this script proceeds and instead of a model file
the contents will be an html page probably with the error. This will
then cause the model to not be able to load due to a missing magic
number. I'm not sure we can do much about the downloading failing,
perhaps a retry but at least this will give a clearer error message.

Refs: https://github.com/danbev/whisper.cpp/actions/runs/26866349389/job/79230794512

* ci : enable command traces to see download command in use

* ci : add retry functionality to download model script

This commit adds curl retry options to the model download script.

The motivation is that currently when CI jobs run huggingface rate limit
the requests and return:
```console
curl: (22) The requested URL returned error: 429
```
This is an attempt to work around this and if it does not work then we
can an authorization token.

* ci : extract freebsd job to build-freebsd.yml

This job has been commented out as it has been flaky in the past. I'll
monitor this and if it continues to be unreliable we can disable it in
the github actions GUI instead of commenting it out like we did before.

* ci : add ccache to jobs (non-docker builds)

The ccache will only be saved on pushed to master.

* ci : bump ccache-action version to v1.2.21

The motivation for this is that the save parameter does not seem to work
with the current version.

* ci : add ccache to docker jobs in build-linux.yml

* ci : add debug statements to linux docker build

* ci : set CCACHE_DIR for build-linux.yml

* ci : add ccache to the remaining docker jobs

* ci : remove build-linux.yml

This commit remove build-linux.yml as the same jobs are also run by
build-gcc.yml, with the exception that build-gcc.yml also run ctest).
So keeping build-gcc.yml and removing the redundant build-linux.yml.

* ci : add linux build artifacts to release

* ci : revert to hendrikmuhs/ccache-action for win job

This is currently causing the following failure:
```console
sccache C:\PROGRA~1\NVIDIA~1\CUDA\v\bin\nvcc.exe -forward-unknown-to-host-compiler -DGGML_BACKEND_BUILD -DGGML_BACKEND_SHARED -DGGML_CUDA_PEER_MAX_BATCH_SIZE=128 -DGGML_SCHED_MAX_COPIES=4 -DGGML_SHARED -D_CRT_SECURE_NO_WARNINGS -D_XOPEN_SOURCE=600 -Dggml_cuda_EXPORTS -DCMAKE_INTDIR=\"Release\" -ID:\a\whisper.cpp\whisper.cpp\ggml\src\ggml-cuda\.. -ID:\a\whisper.cpp\whisper.cpp\ggml\src\..\include -isystem "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v\include" -Xcompiler="-MD -O2 -Ob2" -DNDEBUG -std=c++17 -arch=native -use_fast_math -extended-lambda -Xcompiler /Zc:preprocessor -MD -MT ggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\Release\allreduce.cu.obj -MF ggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\Release\allreduce.cu.obj.d -x cu -c D:\a\whisper.cpp\whisper.cpp\ggml\src\ggml-cuda\allreduce.cu -o ggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\Release\allreduce.cu.obj -Xcompiler=-Fdggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\Release\,-FS
sccache: encountered fatal error
sccache: error: Could not parse shell line
sccache: caused by: Could not parse shell line
```

Refs: https://github.com/danbev/whisper.cpp/actions/runs/26883673904/job/79290017353

* ci : make static linux artifacts

* ci : make linux release artifact names consistent

This commit removes the tag form the linux release artifacts to be
consistent with the existing artifacts.

If we want to include the tag then we can do that in a follow-up PR.

* ci : fix linux zip files to have a directory

* ci : add HF_TOKEN secret for HF download authorization

This is to avoid the HR rate limiting when downloading model.

---------

Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
2026-06-04 09:35:58 +03:00
..
.gitignore
README.md models : fix dead link to models in readme (#3006) 2025-04-06 08:29:41 +03:00
convert-h5-to-coreml.py whisper : add large-v3-turbo (#2440) 2024-10-01 15:57:06 +03:00
convert-h5-to-ggml.py rename : ggerganov -> ggml-org (#3005) 2025-04-04 16:11:52 +03:00
convert-pt-to-ggml.py whisper : add support for large v3 (#1444) 2023-11-07 15:30:18 +02:00
convert-silero-vad-to-ggml.py vad : add initial Voice Activity Detection (VAD) support (#3065) 2025-05-12 16:10:11 +02:00
convert-whisper-to-coreml.py coreml : set convert_to="mlprogram" in convert 2025-04-23 08:24:38 +02:00
convert-whisper-to-openvino.py py : replace deprecated openvino-dev with openvino>=2023.3.0 (#3678) 2026-03-16 13:41:54 +02:00
download-coreml-model.sh whisper : enhance model download scripts functionality and resolve compiler warning (#2925) 2025-03-24 10:39:50 +02:00
download-ggml-model.cmd models : update`./models/download-ggml-model.cmd` to allow for tdrz download (#3381) 2025-08-24 11:52:33 +02:00
download-ggml-model.sh ci : refactor + optimize (#3847) 2026-06-04 09:35:58 +03:00
download-vad-model.cmd vad : Silero VAD v6.2.0 (#3524) 2025-11-17 22:26:17 +09:00
download-vad-model.sh vad : Silero VAD v6.2.0 (#3524) 2025-11-17 22:26:17 +09:00
for-tests-ggml-base.bin Adding dummy models for testing purposes 2022-10-08 11:43:42 +03:00
for-tests-ggml-base.en.bin Adding dummy models for testing purposes 2022-10-08 11:43:42 +03:00
for-tests-ggml-large.bin Adding dummy models for testing purposes 2022-10-08 11:43:42 +03:00
for-tests-ggml-medium.bin Adding dummy models for testing purposes 2022-10-08 11:43:42 +03:00
for-tests-ggml-medium.en.bin Adding dummy models for testing purposes 2022-10-08 11:43:42 +03:00
for-tests-ggml-small.bin Adding dummy models for testing purposes 2022-10-08 11:43:42 +03:00
for-tests-ggml-small.en.bin Adding dummy models for testing purposes 2022-10-08 11:43:42 +03:00
for-tests-ggml-tiny.bin Adding dummy models for testing purposes 2022-10-08 11:43:42 +03:00
for-tests-ggml-tiny.en.bin Adding dummy models for testing purposes 2022-10-08 11:43:42 +03:00
for-tests-silero-v6.2.0-ggml.bin tests : update VAD tests to use Silero V6.2.0 (#3534) 2025-12-06 10:58:58 +01:00
generate-coreml-interface.sh coreml: fix Whisper to CoreML conversion by disabling SDPA [no ci] (#2979) 2025-04-01 18:01:23 +02:00
generate-coreml-model.sh readme : update Python version to 3.11 for Core ML support [no -ci] (#2919) 2025-03-21 10:31:55 +01:00
ggml_to_pt.py models : add ggml_to_pt script (#1042) 2023-06-25 15:29:54 +03:00
requirements-coreml.txt models : add update py requirements 2024-02-13 11:51:32 +02:00
requirements-openvino.txt py : replace deprecated openvino-dev with openvino>=2023.3.0 (#3678) 2026-03-16 13:41:54 +02:00

README.md

Whisper model files in custom ggml format

The original Whisper PyTorch models provided by OpenAI are converted to custom ggml format in order to be able to load them in C/C++. Conversion is performed using the convert-pt-to-ggml.py script.

There are three ways to obtain ggml models:

1. Use download-ggml-model.sh to download pre-converted models

Example download:

$ ./download-ggml-model.sh base.en
Downloading ggml model base.en ...
models/ggml-base.en.bin          100%[=============================================>] 141.11M  5.41MB/s    in 22s
Done! Model 'base.en' saved in 'models/ggml-base.en.bin'
You can now use it like this:

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

2. Manually download pre-converted models

ggml models are available from the following locations:

3. Convert with convert-pt-to-ggml.py

Download one of the models provided by OpenAI and generate the ggml files using the convert-pt-to-ggml.py script.

Example conversion, assuming the original PyTorch files have been downloaded into ~/.cache/whisper. Change ~/path/to/repo/whisper/ to the location for your copy of the Whisper source:

mkdir models/whisper-medium
python models/convert-pt-to-ggml.py ~/.cache/whisper/medium.pt ~/path/to/repo/whisper/ ./models/whisper-medium
mv ./models/whisper-medium/ggml-model.bin models/ggml-medium.bin
rmdir models/whisper-medium

Available models

Model Disk SHA
tiny 75 MiB bd577a113a864445d4c299885e0cb97d4ba92b5f
tiny.en 75 MiB c78c86eb1a8faa21b369bcd33207cc90d64ae9df
base 142 MiB 465707469ff3a37a2b9b8d8f89f2f99de7299dac
base.en 142 MiB 137c40403d78fd54d454da0f9bd998f78703390c
small 466 MiB 55356645c2b361a969dfd0ef2c5a50d530afd8d5
small.en 466 MiB db8a495a91d927739e50b3fc1cc4c6b8f6c2d022
small.en-tdrz 465 MiB b6c6e7e89af1a35c08e6de56b66ca6a02a2fdfa1
medium 1.5 GiB fd9727b6e1217c2f614f9b698455c4ffd82463b4
medium.en 1.5 GiB 8c30f0e44ce9560643ebd10bbe50cd20eafd3723
large-v1 2.9 GiB b1caaf735c4cc1429223d5a74f0f4d0b9b59a299
large-v2 2.9 GiB 0f4c8e34f21cf1a914c59d8b3ce882345ad349d6
large-v2-q5_0 1.1 GiB 00e39f2196344e901b3a2bd5814807a769bd1630
large-v3 2.9 GiB ad82bf6a9043ceed055076d0fd39f5f186ff8062
large-v3-q5_0 1.1 GiB e6e2ed78495d403bef4b7cff42ef4aaadcfea8de
large-v3-turbo 1.5 GiB 4af2b29d7ec73d781377bfd1758ca957a807e941
large-v3-turbo-q5_0 547 MiB e050f7970618a659205450ad97eb95a18d69c9ee

Models are multilingual unless the model name includes .en. Models ending in -q5_0 are quantized. Models ending in -tdrz support local diarization (marking of speaker turns) using tinydiarize. More information about models is available upstream (openai/whisper). The list above is a subset of the models supported by the download-ggml-model.sh script, but many more are available at https://huggingface.co/ggerganov/whisper.cpp/tree/main and elsewhere.

Model files for testing purposes

The model files prefixed with for-tests- are empty (i.e. do not contain any weights) and are used by the CI for testing purposes. They are directly included in this repository for convenience and the Github Actions CI uses them to run various sanitizer tests.

Fine-tuned models

There are community efforts for creating fine-tuned Whisper models using extra training data. For example, this blog post describes a method for fine-tuning using Hugging Face (HF) Transformer implementation of Whisper. The produced models are in slightly different format compared to the original OpenAI format. To read the HF models you can use the convert-h5-to-ggml.py script like this:

git clone https://github.com/openai/whisper
git clone https://github.com/ggml-org/whisper.cpp

# clone HF fine-tuned model (this is just an example)
git clone https://huggingface.co/openai/whisper-medium

# convert the model to ggml
python3 ./whisper.cpp/models/convert-h5-to-ggml.py ./whisper-medium/ ./whisper .

Distilled models

Initial support for https://huggingface.co/distil-whisper is available.

Currently, the chunk-based transcription strategy is not implemented, so there can be sub-optimal quality when using the distilled models with whisper.cpp.

# clone OpenAI whisper and whisper.cpp
git clone https://github.com/openai/whisper
git clone https://github.com/ggml-org/whisper.cpp

# get the models
cd whisper.cpp/models
git clone https://huggingface.co/distil-whisper/distil-medium.en
git clone https://huggingface.co/distil-whisper/distil-large-v2

# convert to ggml
python3 ./convert-h5-to-ggml.py ./distil-medium.en/ ../../whisper .
mv ggml-model.bin ggml-medium.en-distil.bin

python3 ./convert-h5-to-ggml.py ./distil-large-v2/ ../../whisper .
mv ggml-model.bin ggml-large-v2-distil.bin