Skip to content

The audio transcription API powered by MLX Whisper for Apple Silicon Macs. OpenAI-compatible endpoints with multiple model options.

License

Notifications You must be signed in to change notification settings

duytechie/mlx-api

Repository files navigation

MLX Whisper API

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.

Installation

1. Clone the repository

git clone https://github.com/duytechie/mlx-api.git
cd mlx-api

2. Install required dependencies

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

3. Install Python dependencies

This command will install all the necessary Python packages listed in the project configuration.

uv sync

4. Start the local API server

uv run main.py

Usage

API Enpoints:

  • POST /v1/audio/transcriptions: Upload audio file for transcription
  • GET /v1/models: List all models

Interactive Documentation

Visit /docs in your browser to see the interactive API documentation.

docs

Examples

Using curl

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.

curl_example

Using Postman

postman_example

Using /docs

docs_example

About

The audio transcription API powered by MLX Whisper for Apple Silicon Macs. OpenAI-compatible endpoints with multiple model options.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages