lively-coat-10905
09/29/2025, 2:24 PMtall-airline-16756
09/29/2025, 2:24 PMtall-airline-16756
09/29/2025, 2:25 PM@livekit/agents-plugin-silero plugin. I understand the errors you mentioned, like "runner initialization timed out" and "silero_vad.onnx not found," can be frustrating. These usually happen when the model file hasn’t downloaded correctly or the VAD hasn’t been prewarmed.
Let me guide you through the steps to integrate VAD in Node.js smoothly:
1. Install the Plugin:
pnpm install @livekit/agents-plugin-silero
2. Download Model Weights:
Make sure your package.json includes a download script. Then run:
pnpm run download
This will download silero_vad.onnx and place it in your project’s dist directory during the build process.
3. Initialize VAD with Prewarming:
It’s important to use the prewarm function to load the VAD model before running any jobs, which helps avoid those timeout issues:
import * as silero from '@livekit/agents-plugin-silero';
import { defineAgent } from '@livekit/agents';
export default defineAgent({
prewarm: async (proc) => {
proc.userData.vad = await silero.VAD.load();
},
entry: async (ctx) => {
const vad = ctx.proc.userData.vad as silero.VAD;
const session = new voice.AgentSession({ vad, /* other settings */ });
// ...
},
});
4. Configuration Options:
You have the flexibility to customize VAD.load() with parameters like minSpeechDuration, minSilenceDuration, sampleRate, and forceCPU to better fit your needs.
Troubleshooting tips:
• "Runner initialization timed out": This usually means the VAD model wasn’t prewarmed. Make sure to prewarm it to prevent delays during runtime.
• "silero_vad.onnx not found": Double-check that you’ve run pnpm run download and that the file is present in the dist directory after building.
If you’d like to dive deeper, feel free to explore the Silero VAD plugin documentation. I’m here if you need any more help!
Sources: Docs::Agents | examples/src/realtime_turn_detector.ts | Docs::Agents