A fast and efficient audio transcription API that runs OpenAI's Whisper models locally using Apple's MLX framework. This API server provides OpenAI-compatible endpoints for converting speech to text, optimized for Apple Silicon Macs.
git clone https://github.com/duytechie/mlx-api.git
cd mlx-api
You'll need two tools: uv
(Python package manager) and ffmpeg
(audio processing).
Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
Install ffmpeg
brew install ffmpeg
This command will install all the necessary Python packages listed in the project configuration.
uv sync
uv run main.py
POST /v1/audio/transcriptions
: Upload audio file for transcriptionGET /v1/models
: List all models
Visit /docs
in your browser to see the interactive API documentation.
curl -X 'POST' \
'http://localhost:8000/v1/audio/transcriptions' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@/path/to/your/audio.mp3' \
-F 'model=mlx-community/whisper-tiny-mlx'
Note: Replace /path/to/your/audio.mp3
with the actual path to your audio file.