https://github.com/ahmetoner/whisper-asr-webservice
1M+
A self-hosted REST API for speech recognition, translation and language identification based on OpenAI Whisper. It runs as a Docker container on CPU or NVIDIA GPU.
CPU (amd64 and arm64):
docker run -d -p 9000:9000 \
-e ASR_ENGINE=faster_whisper \
-e ASR_MODEL=base \
onerahmet/openai-whisper-asr-webservice:latest
NVIDIA GPU (amd64, requires the NVIDIA Container Toolkit):
docker run -d --gpus all -p 9000:9000 \
-e ASR_ENGINE=faster_whisper \
-e ASR_MODEL=base \
onerahmet/openai-whisper-asr-webservice:latest-gpu
Open http://localhost:9000/docs to use the API from your browser, or send a request directly:
curl -F "[email protected]" "http://localhost:9000/asr?output=json"
| Engine | ASR_ENGINE | Notes |
|---|---|---|
| OpenAI Whisper | openai_whisper (default) | Reference implementation |
| Faster Whisper | faster_whisper | Faster and lighter on memory; VAD and batched inference |
| WhisperX | whisperx | Word alignment and speaker diarization |
The most common settings are listed below. See the configuration reference for all of them.
| Variable | Default | Description |
|---|---|---|
ASR_ENGINE | openai_whisper | openai_whisper, faster_whisper or whisperx |
ASR_MODEL | base | Model name, e.g. tiny, small, large-v3, turbo |
ASR_DEVICE | cuda if present | cuda or cpu |
MODEL_IDLE_TIMEOUT | 0 | Seconds of inactivity before the model is unloaded |
API_KEY | unset | Require this key in the X-API-Key header |
HF_TOKEN | unset | Hugging Face token, required for WhisperX diarization |
To avoid downloading the model on every start, mount a volume at /root/.cache:
docker run -d -p 9000:9000 -v $PWD/cache:/root/.cache onerahmet/openai-whisper-asr-webservice:latest
Full documentation is available at https://ahmetoner.github.io/whisper-asr-webservice.
Requires Python 3.12 or 3.13 and Poetry 2.x.
poetry install --extras cpu # or --extras cuda
poetry run whisper-asr-webservice --host 0.0.0.0 --port 9000
poetry run pytest
See the development guide for building Docker images and the documentation.
Report bugs and request features on GitHub Issues. For questions and discussion, join the Discord server.
Released under the MIT License. The Docker images include FFmpeg, licensed under the LGPL v2.1.
Content type
Image
Digest
sha256:f68b19f7a…
Size
813 MB
Last updated
2 days ago
docker pull onerahmet/openai-whisper-asr-webservice