aufklarer/Silero-VAD-v5-MLX
329k
Silero VAD v5 — MLX
MLX-compatible weights for Silero VAD v5, converted from the official JIT model.
Model
Silero VAD v5 is a lightweight (~309K params) voice activity detection model that processes 512-sample chunks (32ms @ 16kHz) with sub-millisecond latency. It outputs a speech probability between 0 and 1 for each chunk, with LSTM state carried across chunks for streaming operation.
Architecture: STFT → 4×Conv1d+ReLU encoder → LSTM(128) → Conv1d decoder → sigmoid
Usage (Swift / MLX)
import SpeechVAD
// Load model
let vad = try await SileroVADModel.fromPretrained()
// Streaming: process 512-sample chunks
let prob = vad.processChunk(samples) // → 0.0...1.0
// Batch: detect speech segments in complete audio
let segments = vad.detectSpeech(audio: samples, sampleRate: 16000)
for seg in segments {
print("Speech: \(seg.startTime)s - \(seg.endTime)s")
}Part of speech-swift.
Conversion
python3 scripts/convert_silero_vad.py --uploadConverts the official Silero VAD v5 JIT model via torch.hub, transposes Conv1d weights for MLX channels-last format, sums LSTM biases (bias_ih + bias_hh), and saves as safetensors.
Weight Mapping
License
The original Silero VAD model is released under the MIT License.
- Guide: soniqo.audio/guides/vad
- Docs: soniqo.audio
- GitHub: soniqo/speech-swift
