Instructions to use mlx-community/silero-vad-v6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/silero-vad-v6 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download mlx-community/silero-vad-v6 --local-dir silero-vad-v6
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Initial release: Silero VAD v6 (16kHz only, MLX-format)
Browse filesFiles changed (3)
- README.mdAdded+169
- config.jsonAdded+20
- model.safetensorsAdded+3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169---library_name: mlx-audiotags:- mlx- mlx-audio- audio-classification- voice-activity-detection- vad- silerolicense: mitbase_model:- snakers4/silero-vad---
# Silero VAD v6 (MLX)
MLX-format weights for **Silero VAD v6** (16 kHz branch), converted from theofficial `silero_vad` PyPI package (v6.2.1).
This is the **v6** companion to [`mlx-community/silero-vad`](https://huggingface.co/mlx-community/silero-vad), which contains the older **v5** weights.Both are independent ports of different Silero release lines.
## TL;DR
| | This repo | `mlx-community/silero-vad` ||---|---|---|| Silero version | **v6** (latest) | v5 (previous) || Source | `silero_vad` PyPI 6.2.1 (torch.hub `snakers4/silero-vad`) | `onnx-community/silero-vad` || Branches | 16 kHz only | 16 kHz + 8 kHz || File size | 1.2 MB | 2.1 MB || Layout | `vad_16k.*` (mlx-audio convention) | `vad_16k.*` + `vad_8k.*` || Parity vs upstream PyTorch | bit-exact (max\|Ξ\| = 0.0) | bit-exact (max\|Ξ\| = 0.0) |
The two ports differ only in **which Silero checkpoint** they wrap β thearchitecture is identical (STFT β 4Γ Conv1d+ReLU β LSTM(128) β Conv1d β Sigmoid).
## Architecture
```Input: audio (1, 576) = 64-sample context + 512-sample chunk + LSTM state (h: 1Γ128, c: 1Γ128)
Pre-process: Reflection pad right (+64) β 640 samplesLearned STFT: Conv1d(1, 258, k=256, s=128) β magnitude β (1, 129, 4)Encoder: Conv1d(129β128) β ReLU Conv1d(128β64, s=2) β ReLU Conv1d(64β64, s=2) β ReLU Conv1d(64β128) β ReLULSTM: LSTMCell(128, 128) β state carried across chunks for streamingDecoder: ReLU β Conv1d(128β1, k=1) β Sigmoid β probability
Total parameters: ~309K, ~1.2 MB on diskStreaming: carry (h, c) across calls; per-chunk decision in <1 ms```
## Tensor inventory
```vad_16k.stft_conv.weight [258, 256, 1] β frozen learned DFT basisvad_16k.conv1.weight [128, 3, 129] β encoder 0 (BN-fused reparameterized)vad_16k.conv1.bias [128]vad_16k.conv2.weight [64, 3, 128] β encoder 1 (stride 2)vad_16k.conv2.bias [64]vad_16k.conv3.weight [64, 3, 64] β encoder 2 (stride 2)vad_16k.conv3.bias [64]vad_16k.conv4.weight [128, 3, 64] β encoder 3vad_16k.conv4.bias [128]vad_16k.lstm.Wx [512, 128] β input gate weights, [4Β·H, D] gate order i,f,g,ovad_16k.lstm.Wh [512, 128] β hidden gate weightsvad_16k.lstm.bias [512] β fused bias_ih + bias_hhvad_16k.final_conv.weight [1, 1, 128]vad_16k.final_conv.bias [1]```
All Conv1d weights are stored in MLX channels-last layout `[O, K, I]`.LSTM bias is the sum of PyTorch's `bias_ih + bias_hh` (single-tensor MLX convention).
## Conversion
Conversion script: see [`AudioEnhanceKit`](https://github.com/beshkenadze/AudioEnhanceKit) `scripts/convert_silero_vad_v6_to_mlx.py`.
```pythonfrom silero_vad import load_silero_vad # PyPI silero_vad >= 6.2.1sd = load_silero_vad().state_dict() # 30 tensors total
# 1. Drop 8 kHz branch (we ship 16 kHz only here)# 2. Map keys: _model.encoder.{i}.reparam_conv.weight -> vad_16k.conv{i+1}.weight etc.# 3. Transpose Conv1d weights [O, I, K] -> [O, K, I] (MLX channels-last)# 4. Sum LSTM biases: bias_ih + bias_hh -> single bias [4H]# 5. Save as safetensors```
The converter is not bundled here β see the AudioEnhanceKit repo for theexact reproducible script with parity tests against PyTorch ground-truth.
## Usage
### Python (load weights manually with MLX)
```pythonimport mlx.core as mxweights = mx.load("model.safetensors")# weights['vad_16k.stft_conv.weight'].shape == (258, 256, 1)```
For a complete inference pipeline, the easiest path is to vendor the`SileroVADMLXModel` Swift implementation from AudioEnhanceKit, or to follow thearchitecture summary above. A reference Python forward pass is in theAudioEnhanceKit repo's parity scripts.
### Swift (AudioEnhanceKit)
```swiftimport AudioEnhanceKitVADMLX
// Bundled weights (flat layout) ship with the packagelet engine = try SileroVADMLXEngine(backend: .cpu)
for chunk in audio16kStream { let prob = try engine.predictProbability(chunk16k: chunk) // 0.0 β 1.0 if prob > 0.5 { /* speech */ }}```
Note: the Swift engine in AudioEnhanceKit uses a flat key layout(`stft.weight`, `encoder.0.weight`, β¦). To load these HF weights from Swift,run the inverse remap (or use the bundled flat file shipped in the package'sresources).
## Performance (measured on M1 Max)
Real-meeting WAV, 47.5 s @ 16 kHz, 1483 chunks @ 32 ms each, real-time streaming(per-chunk single-call latency, not batch throughput):
| Backend | p50 / chunk | p95 / chunk | Notes ||---|---:|---:|---|| MLX (CPU stream + `mx.compile` + pre-alloc input) | **0.751 ms** | 0.928 ms | this repo, AudioEnhanceKit Swift engine || MLX (GPU naive, no compile) | 1.457 ms | 3.311 ms | Apple Silicon GPU |
Latency is identical between **v5** (mlx-community/silero-vad) and **v6** (thisrepo) because the architecture is identical β measured at 0.751 ms vs 0.753 msp50 on the same hardware (within run-to-run noise). Only the classifierbehavior differs (different weights β slightly different decisions per chunk).
For batch throughput with `mx.async_eval`, expect ~10Γ speedup over per-chunksingle-call latency (queue amortization). Batch is well-suited for offline VAD.
## License
MIT (matching the upstream Silero VAD license).
## Citation
```bibtex@misc{Silero VAD, author = {Silero Team}, title = {Silero VAD: pre-trained enterprise-grade Voice Activity Detector}, year = {2024}, publisher = {GitHub}, journal = {GitHub repository}, howpublished = {\url{https://github.com/snakers4/silero-vad}}}```
## Acknowledgments
- [Silero Team](https://github.com/snakers4/silero-vad) β original model- [Apple MLX](https://github.com/ml-explore/mlx) β runtime- [`mlx-community/silero-vad`](https://huggingface.co/mlx-community/silero-vad) β v5 port that demonstrated the conversion approach for this architecture1234567891011121314151617181920{ "model_type": "silero_vad", "architecture": "silero_vad", "version": "v6", "source": "silero_vad PyPI 6.2.1 (torch.hub snakers4/silero-vad)", "dtype": "float32", "threshold": 0.5, "min_speech_duration_ms": 250, "min_silence_duration_ms": 100, "speech_pad_ms": 30, "branch_16k": { "sample_rate": 16000, "filter_length": 256, "hop_length": 128, "pad": 64, "cutoff": 129, "context_size": 64, "chunk_size": 512 }}123version https://git-lfs.github.com/spec/v1oid sha256:65b6c5f0293cbc44d109e58bef78b474d9c65dedbee814cf0b90ef5f0d9150ffsize 1237860README.mdAdded+169
config.jsonAdded+20
model.safetensorsAdded+3