FastAPI server for OpenAI-compatible audio transcription and translation using faster-whisper. Supports single-model or multi-model hosting.
uv pip install -e .faster-whisper-server small --reloadfaster-whisper-server --config /path/to/config.yaml --reloadExample config:
batch_size: 1
model_options:
device: auto
compute_type: default
models:
- name: whisper-1
path: small
model_options:
device: cpu
transcribe_options:
beam_size: 5
vad_filter: true
- name: large-fast
path: /models/large-v3
batch_size: 4
model_options:
device: cuda
compute_type: float16
translate_options:
temperature: 0.2Transcription:
curl -X POST "http://localhost:8000/v1/audio/transcriptions" \
-F "file=@/path/to/audio.wav" \
-F "model=whisper-1" \
-F "response_format=json"Translation:
curl -X POST "http://localhost:8000/v1/audio/translations" \
-F "file=@/path/to/audio.wav" \
-F "model=whisper-1" \
-F "response_format=json"Health check:
curl "http://localhost:8000/health"- When running with a config file, the request
modelmust match a confignameentry. --log-levelcontrols only thefaster-whisper-serverlogger and defaults towarning.