Whisper.cpp is a high-performance C/C++ port of the OpenAI Whisper automatic speech recognition (ASR) model. This project reimplements the original Python-based Whisper model in pure C/C++ code, achieving dependency-free and highly efficient speech recognition. It is particularly well-suited for resource-constrained environments and embedded devices.
Model | Disk Size | Memory Footprint | Inference Speed | Accuracy |
---|---|---|---|---|
tiny | 75 MiB | ~273 MB | Fastest | Basic |
base | 142 MiB | ~388 MB | Fast | Good |
small | 466 MiB | ~852 MB | Medium | Very Good |
medium | 1.5 GiB | ~2.1 GB | Slower | Excellent |
large | 2.9 GiB | ~3.9 GB | Slow | Best |
# Clone the project
git clone https://github.com/ggml-org/whisper.cpp.git
cd whisper.cpp
# Compile the project
cmake -B build
cmake --build build --config Release
# Download the model
./models/download-ggml-model.sh base.en
# Transcribe audio
./build/bin/whisper-cli -f samples/jfk.wav -m models/ggml-base.en.bin
# Download the model
docker run -it --rm -v $(pwd)/models:/models \
ghcr.io/ggml-org/whisper.cpp:main \
"./models/download-ggml-model.sh base /models"
# Transcribe audio
docker run -it --rm \
-v $(pwd)/models:/models \
-v $(pwd)/audio:/audio \
ghcr.io/ggml-org/whisper.cpp:main \
"whisper-cli -m /models/ggml-base.bin -f /audio/sample.wav"
Whisper.cpp is an extremely excellent speech recognition solution. It successfully ported OpenAI's Whisper model to the C/C++ platform, achieving high performance, low resource consumption, and broad platform compatibility. Whether it is used for mobile application development, embedded systems, or large-scale server deployment, whisper.cpp can provide reliable and efficient speech recognition capabilities.
This project is particularly suitable for the following scenarios: