Skip to main content

mlx-meralion

CI

MLX-native inference for MERaLiON AudioLLM on Apple Silicon.

MERaLiON is A*STAR's multimodal audio-language model for speech transcription, translation, spoken question answering, and more.

Installation

pip install mlx-meralion

Requires macOS on Apple Silicon (M1/M2/M3/M4) and Python 3.10+.

Quick Start

Python API

from mlx_meralion import load_model, transcribe

# Load model (auto-downloads from HuggingFace on first use)
model = load_model("MERaLiON/MERaLiON-2-10B-MLX")  # 10B 8-bit, recommended
# model = load_model("MERaLiON/MERaLiON-2-3B-MLX")   # 3B fp16, smaller

# Transcribe speech
text = transcribe(model, "audio.wav")
print(text)

# Translate to Chinese
text = transcribe(model, "audio.wav", task="translate_zh")

# Spoken question answering
text = transcribe(model, "audio.wav", task="sqa", question="What is the speaker talking about?")

Batch Inference

Process multiple audio files with GPU-batched decoding for higher throughput:

from mlx_meralion import load_model, batch_transcribe

model = load_model("MERaLiON/MERaLiON-2-10B-MLX")

results = batch_transcribe(model, ["a.wav", "b.wav", "c.wav", "d.wav"])
for text in results:
    print(text)

CLI

mlx-meralion --model MERaLiON/MERaLiON-2-10B-MLX --audio audio.wav --task asr
mlx-meralion --model MERaLiON/MERaLiON-2-10B-MLX --audio audio.wav --task translate_zh

Supported Tasks

Task Description
asr Speech-to-text transcription
translate_zh Translate to Chinese
translate_id Translate to Indonesian
translate_ms Translate to Malay
translate_ta Translate to Tamil
sqa Spoken question answering (requires question=)
summarize Dialogue summarization
paralinguistics Speaker characteristic analysis

Available Models

Model Size RAM Quality HuggingFace
MERaLiON-2-10B-MLX ~10 GB 16+ GB Best MERaLiON/MERaLiON-2-10B-MLX
MERaLiON-2-3B-MLX ~6 GB 8+ GB Good MERaLiON/MERaLiON-2-3B-MLX

Batch Inference Benchmark

Measured on Apple M4 Pro (24 GB) with MERaLiON-2-10B-MLX, 8 audio samples (~25s each), max 256 tokens. Correctness validated by comparing batch outputs against sequential outputs token-for-token.

Method B Time Throughput Speedup Correct
Sequential (for-loop) 8 38.96s 0.21 aud/s 1.00x ---
batch_transcribe 4 13.93s 0.29 aud/s 1.40x PASS
batch_transcribe 8 23.25s 0.34 aud/s 1.68x PASS

Features

  • Apple Silicon native: Runs entirely on MLX with GPU acceleration
  • Batch inference: GPU-batched decoding via BatchKVCache for multi-audio throughput
  • N-gram blocking: Prevents repetitive output (matching HuggingFace quality)
  • Smart chunking: Long audio split at 30s boundaries; short tails merged to prevent hallucination
  • Auto-download: Models downloaded and cached from HuggingFace automatically

Architecture

Audio (WAV/MP3/FLAC)
  -> Whisper Encoder (1280-d)
    -> LayerNorm + MLP Adaptor
      -> Speech embeddings merged into text sequence
        -> Gemma2 Decoder -> text output

Metadata

Release files for mlx-meralion 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlx-meralion 0.2.0
File Size Uploaded
mlx_meralion-0.2.0.tar.gz 28.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mlx-meralion 0.2.0
File Interpreter ABI Platform
mlx_meralion-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.2 kB

Release files / mlx_meralion-0.2.0.tar.gz

Download URL mlx_meralion-0.2.0.tar.gz
Size 28.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a2fd6660bfb26d4b41324c2c55b733cfdc6e6e70a382fd83995d06b73e63ab33
BLAKE2b-256 checksum
How to use checksums
d049be127e33b845aa88bc7ed45d2f72351244fc3fc84dc3ef8d55ed1d4e3f62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / mlx_meralion-0.2.0-py3-none-any.whl

Download URL mlx_meralion-0.2.0-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c7d9632c362066d35f6d23c332a048baaea69e3160f49a3aaf1b4720d2fb42f
BLAKE2b-256 checksum
How to use checksums
2244c9810b1522d9d0fb2fe2b2766ccea43a1c22c2f651947ce2e2519b179059
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page