This project runs a Faster Whisper model locally, exposing a local REST endpoint.
You can launch the service by running e.g. python faster-whisper.py.
- Python 3.9 or newer
- Pip
- Windows
- FFMpeg - you can run
winget install ffmpegto install the package
- FFMpeg - you can run
- Linux
apt-get -y install python3-pyaudio portaudio19-dev- needed to installpyaudioapt-get -y install ffmpeg libavcodec-extra- needed for audio decodingapt-get -y install cudnn9-cuda-12- Follow instruction in NVIDIA cuDNN on Linux to enable NVIDIA network repository.
- MacOS
brew install ffmpeg portaudio- needed for audio decoding andpyaudio
Option 1: Batch file
- Windows:
- Run ./setup.cmd
- MacOS/Linux:
- Run
source setup.sh
- Run
Option 2: Manual steps
- Create and activate a python virtual environment.
pip config --site set global.extra-index-url https://download.pytorch.org/whl/cu121pip install -r requirements.txt
Test if the installation worked by starting the backend python faster-whisper.py.
You can connect to the whisper service using the example "whisperClient" project in the ts/examples folder. To use it:
- Go to the repo's ts/examples/whisperClient folder
- Build the project using
pnpm run build - Start the web UI using
pnpm run start
This web client will capture audio from microphone, send to the local service for transcription and show the result.
The service accepts audio files up to 30 MiB and recordings up to five minutes. The complete multipart request has a separate 30 MiB + 64 KiB limit for form headers. Both declared and streamed request sizes are checked before multipart parsing. Once a request reaches the front of the queue, its complete body must arrive within 30 seconds, including continuously streamed uploads. An upload timeout returns HTTP 408 with an error message and releases capacity for the next request; queueing and transcription do not count toward this deadline.
FFmpeg decodes only the first audio stream into 16 kHz mono 16-bit PCM, with bounded output and a 30-second decoding timeout. Oversized files or recordings return HTTP 413, invalid audio returns HTTP 400, and a decoding timeout returns HTTP 422. These responses contain an error message instead of transcription text.
One request is processed at a time, and one additional request can wait. Further requests receive HTTP 503 with Retry-After: 1. Processing remains reserved until the worker finishes, including when its client cancels. The Shell and example client display failures and stop the failed recording; start a new recording to retry. Delayed results or errors from an earlier recording do not affect a new recording.
The tests use the installed FFmpeg executable and a small model stand-in, without downloading a Whisper model or requiring a GPU:
pip install -r requirements-test.txt
python -m unittest -v test_audio_limits