Transcribe speech locally using Apple Silicon's MLX framework, 10 times faster than OpenAI Whisper. Fully offline, private and secure.
Use Cases
- The user says "help me convert this recording to text" or "transcribe this audio file"
- Need to quickly transcribe meeting recordings or voice memos
- Preferred over openai-whisper (faster) and openai-whisper-api (free, private)
Prerequisites
pip install mlx-whisper
Requires an Apple Silicon Mac (M1/M2/M3/M4).
Execution Method
Basic Transcription
import mlx_whisper
result = mlx_whisper.transcribe(
"audio.mp3",
path_or_hf_repo="mlx-community/whisper-large-v3-turbo",
)
print(result["text"])
With Timestamps
result = mlx_whisper.transcribe(
"audio.mp3",
path_or_hf_repo="mlx-community/whisper-large-v3-turbo",
word_timestamps=True,
)
for segment in result["segments"]:
print(f"[{segment['start']:.1f}s - {segment['end']:.1f}s] {segment['text']}")
Model Selection
| Model | Size | Speed | Accuracy |
|---|---|---|---|
whisper-tiny |
39M | Fastest | Average |
whisper-base |
74M | Fast | Good |
whisper-small |
244M | Medium | Good |
whisper-large-v3-turbo |
809M | Slower | Best |
Uses large-v3-turboby default; for short audio (<1 minute), small can be used for acceleration.
Language Specification
result = mlx_whisper.transcribe("audio.mp3", language="zh")
Output Specifications
- Outputs plain text by default
- Provides segmented output with timestamps when the user needs it
- Shows transcription progress for long audio
- Automatically downloads the model on first use (about 800MB); remind the user