Skip to content

About

Fast batched Whisper transcription on Apple Silicon with VAD and speaker diarization

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mlx-whisper-fast

Extensions for mlx-whisper on Apple Silicon:

  • VAD (Voice Activity Detection) — skip silence using Silero VAD
  • Speaker diarization — identify who is speaking
  • Batched decoding — process multiple segments simultaneously (see benchmarks)
  • Flash Attention — mx.fast.scaled_dot_product_attention

Honest Benchmarks (M2 8GB MacBook Air)

Tested on a 1h14m Russian lecture video.

Key finding: whisper-small is 2x faster than whisper-turbo

Model Time Realtime Factor 5h video estimate
whisper-small (sequential) 3.3 min 23.6x RT ~16 min
whisper-turbo (sequential) 6.0 min 12.4x RT ~24 min
Original mlx-whisper (turbo) 6.5 min 11.5x RT ~26 min

Tip: If you're using whisper-turbo (the default), switch to whisper-small for 2x speedup with comparable quality.

Batching results (M2 8GB)

Batching does NOT help on M2 8GB — the memory bandwidth overhead exceeds the parallelism benefit:

Config Time RTF vs Sequential
whisper-small batch=1 3.3 min 23.6x baseline
whisper-small batch=12 4.6 min 16.3x 0.7x (slower)
whisper-turbo batch=4 8.9 min 8.3x 0.67x (slower)

Batching may help on machines with 16GB+ RAM and larger models (large-v3). On 8GB, sequential is fastest.

Useful features

VAD — skip silence

from mlx_whisper.vad import detect_speech, merge_segments
from mlx_whisper.audio import load_audio

audio = load_audio("meeting_with_pauses.mp3")
speech = detect_speech(audio)
merged = merge_segments(speech)
# Useful for audio with lots of pauses/silence

Best for: meetings, interviews, surveillance audio with lots of silence.

Speaker diarization

from mlx_whisper import transcribe
from mlx_whisper.speaker_diarize import diarize_audio, assign_speakers

result = transcribe("meeting.mp3")
speakers = diarize_audio("meeting.mp3", num_speakers=2)
result["segments"] = assign_speakers(result["segments"], speakers)

for seg in result["segments"]:
    print(f"[{seg['speaker']}] {seg['text']}")

Batch transcription (for 16GB+ machines)

from mlx_whisper import transcribe

# Only use batch_size > 1 on machines with 16GB+ RAM
result = transcribe("audio.mp3", batch_size=4,
                    path_or_hf_repo="mlx-community/whisper-large-v3-mlx")

Installation

git clone https://github.com/ilyasmukiev/mlx-whisper-fast.git
cd mlx-whisper-fast
pip install -e .

# Optional
pip install onnxruntime  # for VAD
pip install diarize      # for speaker diarization

Requirements

  • macOS with Apple Silicon (M1/M2/M3/M4)
  • Python 3.10+
  • MLX >= 0.5.0

License

MIT License

Credits

About

Fast batched Whisper transcription on Apple Silicon with VAD and speaker diarization

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages