A lightweight, OpenAI-compatible audio transcription API server powered by faster-whisper. This Docker-based service provides fast and efficient audio transcription using OpenAI's Whisper models.
- OpenAI API-compatible endpoint (
/v1/audio/transcriptions) - Background processing for efficient transcription
- Configurable Whisper models (tiny to large)
- Docker-based deployment for easy setup
- Persistent output directory for transcriptions
- FFmpeg integration for audio metadata extraction
- Fully configurable via environment variables
-
Clone the repository:
git clone https://github.com/tonylea/whisper-server.git cd whisper-server -
(Optional) Copy and customize the environment file:
cp .env.example .env # Edit .env with your preferred settings -
Start the server:
docker-compose up -d
The server will be available at http://localhost:8000.
Build and run the container:
docker build -t whisper-server .
docker run -d -p 8000:8000 -v $(pwd)/output:/transcription/output whisper-serverPull and run the pre-built image:
docker pull deadrobot/whisper-server:latest
docker run -d -p 8000:8000 -v $(pwd)/output:/transcription/output deadrobot/whisper-server:latestConfigure the server using environment variables:
| Variable | Default | Description |
|---|---|---|
WHISPER_MODEL |
medium.en |
Whisper model to use (see below) |
DEVICE |
cpu |
Device to run on (cpu or cuda) |
COMPUTE_TYPE |
int8 |
Computation precision (see below) |
OUTPUT_DIR |
/transcription/output |
Directory for transcription outputs |
PORT |
8000 |
Server port |
HOST |
0.0.0.0 |
Server host |
tiny,tiny.enbase,base.ensmall,small.enmedium,medium.enlarge-v1,large-v2,large-v3
English-only models (.en) are faster and more accurate for English audio.
int8- Best for CPU (recommended)int8_float16- Mixed precisionint16- Higher precisionfloat16- GPU optimizedfloat32- Highest precision
Endpoint: POST /v1/audio/transcriptions
Request:
curl -X POST http://localhost:8000/v1/audio/transcriptions \
-F "[email protected]" \
-F "model=medium.en"Response:
{
"status": "processing",
"message": "Transcription started for audio.mp3",
"model": "medium.en",
"audio_duration": "3m 45s",
"output_file": "/transcription/output/audio.txt"
}The transcription is processed in the background. Results are saved to the output_file location.
Note: You can specify different Whisper models per request using the model parameter. If not specified, it defaults to the WHISPER_MODEL environment variable. Models are cached in memory after first use for better performance.
Using different models:
# Use tiny model for faster transcription
curl -X POST http://localhost:8000/v1/audio/transcriptions \
-F "[email protected]" \
-F "model=tiny.en"
# Use large model for better accuracy
curl -X POST http://localhost:8000/v1/audio/transcriptions \
-F "[email protected]" \
-F "model=large-v3"Any format supported by FFmpeg:
- MP3
- WAV
- M4A
- FLAC
- OGG
- And many more...
Once the server is running, visit:
- Interactive API docs:
http://localhost:8000/docs - Alternative docs:
http://localhost:8000/redoc
-
Clone the repository and create a virtual environment:
git clone https://github.com/tonylea/whisper-server.git cd whisper-server # Create virtual environment python -m venv venv # Activate virtual environment # On macOS/Linux: source venv/bin/activate # On Windows: # venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Ensure FFmpeg is installed:
# macOS brew install ffmpeg # Ubuntu/Debian sudo apt-get install ffmpeg # Windows # Download from https://ffmpeg.org/download.html
-
Run the server:
uvicorn server:app --reload
-
When done, deactivate the virtual environment:
deactivate
-
Go to your GitHub repository Settings → Secrets and variables → Actions
-
Add the following secrets:
DOCKERHUB_USERNAME: Your Docker Hub usernameDOCKERHUB_TOKEN: Your Docker Hub access token (create at Docker Hub Security)
-
Create releases using the Automated Release workflow:
Via GitHub Actions (Recommended):
- Go to Actions → "Automated Release"
- Click "Run workflow"
- Select release type (patch/minor/major)
- The workflow will:
- Generate/update CHANGELOG.md based on conventional commits
- Bump version in package.json
- Create a git tag (e.g.,
v1.2.3) - Push changes and tag to repository
- Automatically trigger the Docker build workflow
Via Local Development:
# Install Node.js dependencies npm install # Create a release (updates version, changelog, and creates tag) npm run release:patch # 1.0.0 → 1.0.1 npm run release:minor # 1.0.0 → 1.1.0 npm run release:major # 1.0.0 → 2.0.0 # Push changes and tags git push --follow-tags origin main
When a git tag is created (e.g., v1.2.3), the Docker workflow automatically builds and pushes images with multiple tags:
deadrobot/whisper-server:1.2.3- Full versiondeadrobot/whisper-server:1.2- Minor versiondeadrobot/whisper-server:1- Major versiondeadrobot/whisper-server:latest- Latest stable release
This allows users to pin to specific versions or always use the latest:
# Use specific version (recommended for production)
docker pull deadrobot/whisper-server:1.2.3
# Use minor version (gets patch updates)
docker pull deadrobot/whisper-server:1.2
# Use major version (gets minor and patch updates)
docker pull deadrobot/whisper-server:1
# Always use latest (gets all updates)
docker pull deadrobot/whisper-server:latest- Use English-only models (
.en) for English audio - they're faster and more accurate - For CPU: Use
int8compute type - For GPU: Use
float16orint8_float16compute type withDEVICE=cuda - Larger models are more accurate but slower
- Consider using
tinyorbasemodels for real-time applications
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
This project uses Conventional Commits for commit messages and automated versioning. Please follow the commit message format:
feat: add new feature
fix: resolve bug
docs: update documentation
chore: maintenance tasksSee COMMITS.md for detailed guidelines and examples.
- Fork the repository
- Create a feature branch:
git checkout -b feat/your-feature - Make changes using conventional commits
- Push and create a Pull Request
- Once merged, maintainers will create releases using the automated release workflow
See CONTRIBUTING.md for more details.
- OpenAI Whisper - Original Whisper model
- faster-whisper - Optimized Whisper implementation
- FastAPI - Modern web framework
If you encounter any issues or have questions, please open an issue on GitHub.