Skip to content
Proyek

ahmetoner/whisper-asr-webservice

Lihat di GitHub

Tentang

API layanan web pengenalan ucapan otomatis (ASR) OpenAI Whisper

AI dan pembelajaran mesin

Cara angka ini diukur

Yang dapat Anda lakukan

  • 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

Pertumbuhan bintang terukur

dalam 24 jam
0
dalam 7 hari
0
dalam 15 hari
+2
dalam 1 bulan
+3

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

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.

Jelajahi proyek terkait

Memuat…