# Repository Briefing: ahmetoner/whisper-asr-webservice
> Source: https://repoforai.com/repo/ahmetoner/whisper-asr-webservice (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/ahmetoner/whisper-asr-webservice
- **Official Docs / Website**: https://ahmetoner.github.io/whisper-asr-webservice
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A+ (96/100 · Maintenance 35/35 · Adoption 21/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v2.0.1 (2026-11-29) — https://github.com/ahmetoner/whisper-asr-webservice/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Docker, Self-Hosted, GPU, API
- **Momentum**: 3,372 ★ total (+0 24h / +0 7d) · 579 forks
- **Topics**: `asr`, `automatic-speech-recognition`, `docker`, `openai-whisper`, `speech`, `speech-recognition`, `speech-to-text`
- **When to Use**: Best for: Teams that need to process recorded audio or video on their own infrastructure, share a transcription endpoint across applications, or migrate existing OpenAI audio clients to local inference. Skip if: Your product requires live bidirectional streaming, you do not want to operate model-serving infrastructure, or a single application can call Faster Whisper directly.

## Overview
```text
### Architecture & Core Mechanics
This is a self-hosted Python REST service built on FastAPI and Uvicorn. A client submits an audio or video file as multipart data, and PyAV decodes it inside the service process. The selected Whisper engine then runs inference locally. `python-multipart`, `av`, and `numpy` are declared dependencies; the runtime entrypoint is `whisper-asr-webservice`, and application code lives under `app/`.

The integration boundary is HTTP: the service exposes an OpenAI-compatible transcription endpoint under `/v1` as well as the existing `/asr` route. Backend selection is a deployment setting, not a custom plugin protocol. `ASR_ENGINE` selects Faster Whisper, OpenAI Whisper, or WhisperX, while `ASR_MODEL` and `ASR_DEVICE` set the model and execution device.

### Key Capabilities & Differentiators
The service transcribes speech in Whisper-supported languages, translates into English, and detects the input language with a confidence score. Outputs include plain text, JSON, WebVTT, SRT, and TSV. Supported model examples include `tiny`, `base`, `small`, `large-v3`, and `turbo`. The upload path accepts audio and video formats supported by the FFmpeg libraries used through PyAV.

Backend choice affects more than throughput. Faster Whisper is the default and supports voice activity detection and batched inference. OpenAI Whisper is the reference implementation. WhisperX provides word alignment and speaker diarization, with `HF_TOKEN` required for diarization. Word-level timing is available, but clients should verify the chosen engine, endpoint, and output format together before relying on specific timestamp or speaker fields.

### Trade-offs & Limitations
Compared with a hosted Whisper API, this service keeps inference on infrastructure you control and can reuse clients that accept a custom OpenAI base URL. In return, you own model downloads, capacity planning, updates, and uptime. Compared with embedding Faster Whisper directly, a shared HTTP service simplifies integration across applications but adds file transport and another process to operate.

Capacity depends on the engine, model, input duration, and concurrency; the default `base` configuration is a useful starting point, not a production sizing estimate. `MODEL_IDLE_TIMEOUT` can reclaim memory between bursts, at the cost of reloading the model on a later request. Authentication is optional and unset by default. Treat the documented API as file-based transcription, not as a replacement for a streaming protocol.

### Hardware & Deployment Guide
The CPU and NVIDIA GPU images support amd64 and arm64 and serve HTTP on port 9000. GPU containers require the NVIDIA Container Toolkit and can be launched with `--gpus all` using the `latest-gpu` image. Persist `/root/.cache` to reuse downloaded model files. The CPU Compose file builds from `Dockerfile`, sets `ASR_MODEL=base`, bind-mounts `./app`, and uses a named cache volume. Running from source requires Python 3.12 or 3.13 and `uv`.

Version 1.11.0 added API key authentication, health checks, logging, and request limits. Version 2.0.0 added the OpenAI-compatible API and ARM64 GPU image, moved decoding to PyAV, and made Faster Whisper the default. It also changed `/asr` JSON output and subtitle defaults, so v1 integrations should regression-test their parsers. Version 2.0.1 fixed WhisperX startup in Docker by restoring the missing `libgomp` dependency.
```

## Key Capabilities
```text
- API boundary: OpenAI-compatible `/v1/audio/transcriptions` plus the existing `/asr` endpoint.
- Media ingest: PyAV decodes uploaded audio and video in-process instead of invoking an FFmpeg subprocess.
- Engine selection: `ASR_ENGINE` switches among `faster_whisper`, `openai_whisper`, and `whisperx`; `ASR_MODEL` selects the model.
- Speech annotation: Faster Whisper offers VAD and batched inference; WhisperX adds word alignment and token-gated diarization.
- Container footprint: CPU and NVIDIA GPU builds support amd64 and arm64, and `/root/.cache` can be persisted for model downloads.
- Runtime controls: `X-API-Key` authentication, health checks, request limits, and configurable idle model unloading.
```

## Quick Start / Clone
```bash
docker run -d -p 9000:9000 \
  -e ASR_ENGINE=faster_whisper \
  -e ASR_MODEL=base \
  onerahmet/openai-whisper-asr-webservice:latest
```
