HUB
Sign inSign up

onerahmet/openai-whisper-asr-webservice

By onerahmet

•Updated about 1 hour ago

https://github.com/ahmetoner/whisper-asr-webservice

Buildkit cache
Image
Machine learning & AI
Data science
102

1M+

onerahmet/openai-whisper-asr-webservice repository overview

⁠Whisper ASR Webservice

Release Docker Pulls Test License

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.

⁠Features

  • Three engines: OpenAI Whisper, Faster Whisper and WhisperX
  • Transcription in every language Whisper supports, and translation into English
  • Language detection with a confidence score
  • Output as plain text, JSON, WebVTT, SRT or TSV
  • Word-level timestamps, voice activity detection (VAD) and speaker diarization
  • Accepts any audio or video file FFmpeg can decode
  • Optional API key authentication
  • Unloads the model when idle to free memory
  • Interactive API documentation (Swagger UI)

⁠Quick Start

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"

⁠Engines

EngineASR_ENGINENotes
OpenAI Whisper⁠openai_whisper (default)Reference implementation
Faster Whisper⁠faster_whisperFaster and lighter on memory; VAD and batched inference
WhisperX⁠whisperxWord alignment and speaker diarization

⁠Request Flow

Request flow

⁠Configuration

The most common settings are listed below. See the configuration reference⁠ for all of them.

VariableDefaultDescription
ASR_ENGINEopenai_whisperopenai_whisper, faster_whisper or whisperx
ASR_MODELbaseModel name, e.g. tiny, small, large-v3, turbo
ASR_DEVICEcuda if presentcuda or cpu
MODEL_IDLE_TIMEOUT0Seconds of inactivity before the model is unloaded
API_KEYunsetRequire this key in the X-API-Key header
HF_TOKENunsetHugging 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

⁠Documentation

Full documentation is available at https://ahmetoner.github.io/whisper-asr-webservice⁠.

⁠Development

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.

⁠Support

Report bugs and request features on GitHub Issues⁠. For questions and discussion, join the Discord server⁠.

⁠License

Released under the MIT License⁠. The Docker images include FFmpeg⁠, licensed under the LGPL v2.1⁠.

Tag summary

Content type

Image

Digest

sha256:f68b19f7a…

Size

813 MB

Last updated

2 days ago

docker pull onerahmet/openai-whisper-asr-webservice