SpeechBrain ECAPA VoxCeleb MLX
This is a reproducible MLX weight export of
speechbrain/spkrec-ecapa-voxceleb
for native Apple Silicon inference. It produces a 192-dimensional,
L2-normalized voice embedding for cosine-similarity speaker comparison.
Model
| Property | Value |
|---|---|
| Parameters | 20.77 million |
| Weights | Safetensors, FLOAT16 |
| Weight size | 39.7 MiB |
| Input | SpeechBrain log-mel [1, frames, 80] |
| Sample rate | 16 kHz |
| Output | 192-dimensional L2-normalized embedding |
Files
| File | Description |
|---|---|
model.safetensors | MLX-layout ECAPA weights |
mlx_model.py | Native MLX ECAPA graph |
frontend.py | Reproducible SpeechBrain log-mel frontend |
config.json | Architecture, frontend, source revision, and checksums |
artifact_manifest.json | SHA-256 and size of every artifact file |
validation.json | PyTorch/MLX parity and local latency measurements |
requirements.txt | Pinned standalone runtime dependencies |
LICENSE | Apache 2.0 license |
Validation
| Check | Result |
|---|---|
| Minimum PyTorch/MLX output cosine | 0.999999 |
| Maximum absolute error | 0.000372 |
| Warm local inference | 5.2 ms |
The source model reports 0.80% equal-error rate on cleaned VoxCeleb1. Run a fresh VoxCeleb1-O evaluation before treating that upstream score as conversion parity or changing a production threshold.
Usage
import mlx.core as mx
import soundfile as sf
from frontend import compute_fbank
from mlx_model import SpeakerModel
audio, sample_rate = sf.read("voice.wav", dtype="float32")
assert sample_rate == 16000 and audio.ndim == 1
features = compute_fbank(audio, 80)[None, :, :]
model = SpeakerModel()
model.load_weights(list(mx.load("model.safetensors").items()), strict=True)
embedding = model(mx.array(features))
mx.eval(embedding)
print(embedding.shape, float(mx.linalg.norm(embedding).item()))
The exact frontend contract is in config.json. Speaker embeddings are not
secure authentication and should not be used alone for access control.
Source
Converted from the official SpeechBrain checkpoint at revision
0f99f2d0ebe89ac095bcc5903c4dd8f72b367286. The original checkpoint and graph revisions are pinned
in config.json.
Links
- speech-swift — Apple SDK
- Docs — install and CLI docs
- soniqo.audio
- blog