New Tool Radar

Local AI

How to Serve a Faster-Whisper Model as a Local API Server

Run Speaches, the OpenAI-compatible server built on faster-whisper, in Docker, then send an audio file to its /v1/audio/transcriptions endpoint and get the transcript back over HTTP.

Schematic diagram with three steps: start the Speaches container on port 8000, send an audio file to /v1/audio/transcriptions, and read the transcript returned as JSON.

Faster-whisper on its own is a library: you import WhisperModel in Python and transcribe inside your own script. That is fine for one script, but another app cannot call a library over HTTP. Speaches fills that gap. It is an OpenAI API-compatible server whose speech-to-text is powered by faster-whisper, it supports GPU and CPU, and it is deployable via Docker. Once it runs, any app that already talks to OpenAI’s transcription endpoint can point at your machine instead.

Start the server in Docker

On a machine with a GPU, run the CUDA image. The volume keeps downloaded models in a cache so a restart does not download them again:

docker run --rm --detach --publish 8000:8000 \
    --name speaches \
    --volume hf-hub-cache:/home/ubuntu/.cache/huggingface/hub \
    --gpus=all \
    ghcr.io/speaches-ai/speaches:latest-cuda

That is the GPU command. For CPU only, swap the tag for latest-cpu and drop the --gpus flag:

docker run --rm --detach --publish 8000:8000 \
    --name speaches \
    --volume hf-hub-cache:/home/ubuntu/.cache/huggingface/hub \
    ghcr.io/speaches-ai/speaches:latest-cpu

The server listens on port 8000. Speaches loads models dynamically: you specify which model you want in the request and it is loaded automatically, then unloaded after a period of inactivity.

Send an audio file and read the transcript

Transcribe with plain curl. Pass a faster-whisper model from Hugging Face by ID, and Speaches downloads it on first use. For a first run, use the small model, which has 244M parameters, rather than the large-v3 model at 1550M parameters. Use a short WAV file of yourself reading the practice sentence, “The lighthouse keeper named Mara checked the lamp at noon,” saved as audio.wav:

curl -s "http://localhost:8000/v1/audio/transcriptions" \
    -F "[email protected]" \
    -F "model=Systran/faster-whisper-small"

The response is JSON carrying the transcript text. If you need the best accuracy rather than the fastest first run, ask for Systran/faster-whisper-large-v3 instead; the large-v3-turbo model at 809M parameters is an optimized version of large-v3 that offers faster transcription speed with a minimal degradation in accuracy.

Point an existing OpenAI client at it

Because the server is OpenAI API-compatible, the OpenAI Python client works against it by changing only the base URL:

from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="<your-key>")

Then call the audio transcription method with the same model ID you used in curl, and read the text field of the result. The same endpoint also streams partial transcripts over server-sent events as the audio is processed, so a client does not have to wait for the whole file to finish before receiving text.

Check What you should see If you do not see it
Container The speaches container is running and port 8000 is published on the host Docker is not running, or port 8000 is already in use
First request The first curl takes a while, then returns JSON, because the model downloads on first use A later request with the same model should be fast — the cache volume keeps it
Transcript JSON text containing “The lighthouse keeper named Mara checked the lamp at noon.” The wrong file was sent, or the model ID was mistyped — use Systran/faster-whisper-small
OpenAI client The same transcript comes back with base_url="http://localhost:8000/v1" The client still points at OpenAI’s own API URL instead of localhost port 8000

Expected result. We checked the Speaches documentation for the CPU and GPU Docker commands on port 8000 with the hf-hub-cache volume, the Speaches repository for the OpenAI-compatible server, faster-whisper speech-to-text, dynamic model loading and unloading, and streaming, and OpenAI’s Whisper README for the small, large-v3, and large-v3-turbo parameter counts and the turbo description. We did not run Speaches or Docker.

Limits

The first request for a model is slow because the model downloads then; only later requests are fast, and only while the cache volume is kept. A model is unloaded after a period of inactivity, so an idle server pays the load time again on the next request. This endpoint takes a finished audio file; for live microphone transcription, WhisperLive is the matching tool, not this server. The practice sentence above is fictional, and the API key in the client example is a placeholder. We did not run Speaches, so no transcript here is a recorded result.

Sources

See all