Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Whisper Bridge

OpenAI-compatible transcription proxy for Whisper services.

Features

  • OpenAI /v1/audio/transcriptions API compatibility
  • Docker support with multi-service orchestration
  • Configurable upstream Whisper backend
  • File size limits and input validation

Quick Start

Using Docker

docker build -t whisper-bridge .
docker run -p 9100:9100 whisper-bridge

Using Docker Compose

# Modern syntax (Docker 2.23+)
docker compose up -d

# Legacy syntax (older Docker versions)
docker-compose up -d

API Endpoints

Method Endpoint Description
GET /health Health check
POST /v1/audio/transcriptions Transcribe audio file

Transcription Request

Form Parameters:

Parameter Type Default Description
file file (required) - Audio file to transcribe
model string "whisper-1" Model identifier
language string | null null Language code (e.g., "en", "no")
response_format string "json" Output format: json, text, srt, verbose_json, vtt
temperature float 0.0 Sampling temperature

Example:

curl -X POST http://localhost:9100/v1/audio/transcriptions \
  -F "file=@audio.wav" \
  -F "model=whisper-1" \
  -F "language=en" \
  -F "response_format=json"

Response:

{
  "text": "Transcribed text here",
  "model": "whisper-1",
  "language": "en"
}

Configuration

Environment variables:

Variable Default Description
WHISPER_URL http://whisper:9000/asr Upstream Whisper service URL
MAX_FILE_SIZE 104857600 (100 MB) Maximum upload size in bytes
REQUEST_TIMEOUT 300 Request timeout in seconds
LOG_LEVEL INFO Python logging level (DEBUG, INFO, WARNING, ERROR)

Development

Requirements

  • Python 3.11+
  • Docker (optional, for containerized deployment)

Local Setup

pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port 9100 --reload

Project Structure

whisper-bridge/
├── .dockerignore   # Docker build exclusions
├── .gitignore      # Git exclusions
├── app.py          # FastAPI application
├── docker-compose.yml  # Service orchestration
├── Dockerfile      # Container definition
├── README.md       # This file
└── requirements.txt  # Python dependencies

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages