Whisper-API-Server
Docker app from grtgbln's Repository
A drop-in replacement for the OpenAI's Whisper API using the same API but running locally.
Overview
Readme
View on GitHubWhisper API server
Drop-in replacement for the OpenAI's Whisper API using the same API but running locally.
Modified from https://github.com/morioka/tiny-openai-whisper-api.
Setup
With Docker compose (recommended)
Install Docker, then run:
docker build -t didmar/whisper-api-server .
docker run -d -p 127.0.0.1:8000:8000 -v .cache:/root/.cache:rw didmar/whisper-api-server --workers 1
# Customize number of workers is needs to handle multiple requests in parallel
Or use Docker compose:
docker compose up --build -d
Without Docker
Requires python >= 3.10, pip and virtualenv.
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
python3 main.py
Usage
Check out the API documentation at http://localhost:8000/docs.
For example:
curl -sSfLO https://upload.wikimedia.org/wikipedia/commons/2/2b/American_English_sound_%22h%22_%28female%29.wav
curl --request POST \
--url "http://localhost:8000/v1/audio/transcriptions" \
--header 'Content-Type: multipart/form-data' \
--form file=@American_English_sound_%22h%22_%28female%29.wav \
--form model=whisper-1
# {"text":" Hot hole high. Hu. Hu. Hu. Behind. Hu. Hu."}
Language
An optional language form field accepts an ISO 639-1 language code (for
example pl) and forces faster-whisper to transcribe with that language
instead of running automatic language detection.
- Omitting the field keeps automatic detection.
- An invalid code is rejected deterministically with
400 Bad Request.
curl --request POST \
--url "http://localhost:8000/v1/audio/transcriptions" \
--header 'Content-Type: multipart/form-data' \
--form file=@polski.wav \
--form model=whisper-1 \
--form language=pl
Development setup
We use uv to manage dependencies, Ruff for linting and formatting, and pytest for tests.
# Install dependencies (including development dependencies)
uv sync --dev
# Run tests
uv run pytest
# Setup pre-commit hooks (See https://pre-commit.com/)
pre-commit install
Categories
Download Statistics
Related apps
Explore more like this
Explore allLinks
Details
didmar/whisper-api-serverRuntime arguments
- Network
bridge- Privileged
- false
Template configuration
Container Port: 8000
- Target
- 8000
- Default
- 8000
- Value
- 8000
Path to the cache directory. This is where models will be stored, which can be quite large.
- Target
- /root/.cache
- Default
- /mnt/user/appdata/whisper_api_server/cache
- Value
- /mnt/user/appdata/whisper_api_server/cache