Skip to content
プロジェクト

ahmetoner/whisper-asr-webservice

GitHubで見る

概要

OpenAI Whisper 音声認識 Web サービス API

AI・機械学習

この数値の測り方

できること

  • OpenAI-compatible API: works with the OpenAI SDKs and any application that lets you set the OpenAI base URL
  • Three engines: OpenAI Whisper, Faster Whisper and WhisperX
  • Transcription in every language Whisper supports, and translation into English
  • Language detection with a confidence score

計測したスター増加

24時間
0
7日間
0
15日間
+2
1か月
+3

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

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

  • OpenAI-compatible API: works with the OpenAI SDKs and any application that lets you set the OpenAI base URL
  • 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, decoded in-process with PyAV
  • 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 and arm64, requires the NVIDIA Container Toolkit):

docker run -d --gpus all -p 9000:9000 \
  -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 http://localhost:9000/v1/audio/transcriptions -F model=whisper-1 -F [email protected]

Or use any OpenAI SDK by setting its base URL:

from openai import OpenAI

client = OpenAI(base_url="http://localhost:9000/v1", api_key="unused")
print(client.audio.transcriptions.create(model="whisper-1", file=open("audio.mp3", "rb")).text)

Engines

Engine ASR_ENGINE Notes
OpenAI Whisper openai_whisper Reference implementation
Faster Whisper faster_whisper (default) Faster and lighter on memory; VAD and batched inference
WhisperX whisperx Word alignment and speaker diarization

Request Flow

Request flow

Configuration

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

Variable Default Description
ASR_ENGINE faster_whisper faster_whisper, openai_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

Documentation

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

Development

Requires Python 3.12 or 3.13 and uv.

uv sync                           # for NVIDIA GPUs: uv sync --no-group cpu --group cuda
uv run whisper-asr-webservice --host 0.0.0.0 --port 9000
uv 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. Audio is decoded with PyAV, which bundles FFmpeg libraries licensed under the LGPL v3.

関連プロジェクトを探す

読み込み中…