Skip to content
프로젝트

ahmetoner/whisper-asr-webservice

GitHub에서 보기

소개

OpenAI Whisper 자동 음성 인식 웹 서비스 API

AI 및 머신러닝

이 수치를 측정하는 방법

What you can do

  • 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

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
+2
in 1 month
+3

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

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.

관련 프로젝트 살펴보기

불러오는 중…