Production-oriented Rust wrapper for the Silero VAD ONNX model.
Introduction
Production-oriented Rust wrapper for the Silero VAD ONNX model.
This crate is designed around the way we actually run VAD in services:
- one reusable ONNX session per worker
- one small stream state per active audio stream
- one optional segmenter that turns frame probabilities into speech ranges
It intentionally does not own queueing, health checks, worker counts, or ONNX thread policy. Those belong in a higher-level service crate.
Model layout
Silero VAD is a stateful model:
- input audio: fixed-size 8 kHz or 16 kHz chunks
- rolling context: 32 samples at 8 kHz, 64 samples at 16 kHz
- recurrent memory:
state/stateN
Because of that, the crate exposes three core building blocks:
Session- owns the ONNX Runtime session
- supports exact-chunk single inference and multi-stream batch inference
StreamState- owns per-stream model memory: recurrent state, rolling context, and tail buffer
SpeechSegmenter- turns frame probabilities into
SpeechSegments using hysteresis and timing rules
- turns frame probabilities into
Quick start
use ;
Streaming usage
use ;
Batch inference
Silero's batch dimension represents independent streams at the same sample rate, not consecutive chunks from one stream.
use ;
let model = include_bytes!;
let mut session = from_memory.unwrap;
let mut a = new;
let mut b = new;
let chunk_a = vec!;
let chunk_b = vec!;
let mut batch = ;
let probabilities = session.infer_batch.unwrap;
assert_eq!;
Session construction
The crate bundles models/silero_vad.onnx and exposes:
Session::bundled()when thebundledfeature is enabledSession::from_file(...)Session::from_memory(...)Session::from_ort_session(...)
SessionOptions only contains model-local options such as graph optimization.
If a service needs to tune intra_threads / inter_threads, build the ORT
session at the service layer and pass it into Session::from_ort_session(...).
Notes
- Direct sample rates: 8 kHz and 16 kHz.
- The crate does not do audio decoding or resampling.
SpeechDetectoris kept as a type alias forSpeechSegmenter.
Development
License
silero is under the terms of both the MIT license and the
Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT for details.
Copyright (c) 2026 FinDIT studio authors.
Third-party model notice
This crate bundles and redistributes models/silero_vad.onnx, a Silero VAD model
from the upstream Silero project.
The bundled model is third-party content and remains subject to its upstream license terms. The upstream Silero model is distributed under the MIT license, and redistribution should retain the upstream copyright and permission notice.
See THIRD_PARTY_NOTICES.md for the bundled model's upstream sources, attribution, and MIT notice text.