{"id":50030028,"url":"https://github.com/bubustack/silero-vad-engram","last_synced_at":"2026-05-20T19:52:23.536Z","repository":{"id":352193499,"uuid":"1117424778","full_name":"bubustack/silero-vad-engram","owner":"bubustack","description":"Silero VAD Engram for bobrapet — ONNX-based voice activity detection for streaming audio pipelines.","archived":false,"fork":false,"pushed_at":"2026-05-02T07:11:18.000Z","size":112,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-02T09:19:00.381Z","etag":null,"topics":["batch","bubustack","engram","go","kubernetes","onnx","silero","streaming","vad","voice-activity-detection"],"latest_commit_sha":null,"homepage":"https://bubustack.io/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bubustack.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["bubustack"]}},"created_at":"2025-12-16T09:46:24.000Z","updated_at":"2026-04-19T19:22:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bubustack/silero-vad-engram","commit_stats":null,"previous_names":["bubustack/silero-vad-engram"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bubustack/silero-vad-engram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fsilero-vad-engram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fsilero-vad-engram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fsilero-vad-engram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fsilero-vad-engram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bubustack","download_url":"https://codeload.github.com/bubustack/silero-vad-engram/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fsilero-vad-engram/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33273429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T15:12:43.734Z","status":"ssl_error","status_checked_at":"2026-05-20T15:12:42.300Z","response_time":356,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batch","bubustack","engram","go","kubernetes","onnx","silero","streaming","vad","voice-activity-detection"],"created_at":"2026-05-20T19:52:22.721Z","updated_at":"2026-05-20T19:52:23.528Z","avatar_url":"https://github.com/bubustack.png","language":"Go","funding_links":["https://github.com/sponsors/bubustack"],"categories":[],"sub_categories":[],"readme":"# 🎛️ Silero VAD Engram\n\nThis engram wraps [silero-vad-go](https://github.com/streamer45/silero-vad-go) to provide\nONNX-based voice-activity detection for the bobrapet realtime pipeline. It consumes\n`speech.audio.v1` payloads emitted by ingress engrams and produces\n`speech.vad.active` packets that contain utterance-sized PCM chunks along with\nsequence numbers, durations, and storage references when needed. Consumers listen for\nthe standard Tractatus stream types (`speech.vad.*`), so they can swap in any VAD\nprovider without bespoke routing.\n\n## 🌟 Highlights\n\n- Uses Silero's CPU-friendly ONNX model for robust VAD across multiple providers.\n- Pluggable frame sizing, silence tail, and amplitude thresholds with per-participant\n  buffering identical to the legacy WebRTC-based detector.\n- Optional WAV wrapping or raw PCM output plus automatic offload to shared storage\n  when turns exceed the inline byte budget.\n- Designed for the transport contracts (`speech.audio.v1` inputs) used across\n  providers, and emits the shared `speech.vad.*` stream types so it can plug into any\n  workflow that exchanges PCM via Tractatus.\n\n## 🚀 Quick Start\n\n```bash\nmake lint\ngo test ./...\nmake docker-build\n```\n\nApply `Engram.yaml`, mount the Silero model and ONNX Runtime libraries, then\nwire the engram into a realtime Story after your ingress step.\n\n## ⚙️ Configuration (`Engram.spec.with`)\n\n| Field | Default | Description |\n|-------|---------|-------------|\n| `modelPath` | `/models/silero_vad.onnx` | Path to the Silero ONNX file. Mount the model via a volume or baked image layer. |\n| `detectorSampleRateHz` | `16000` | Sample rate fed into the Silero model (8 kHz or 16 kHz). |\n| `threshold` | `0.5` | Probability threshold emitted by Silero to mark frames as speech. |\n| `frameDurationMs` | `32` | PCM frame duration processed before each VAD decision. |\n| `minSilenceDurationMs` | `400` | Trailing silence required to finalize a turn. |\n| `minDurationMs` | `200` | Minimum amount of voiced audio before emitting a turn. |\n| `maxDurationMs` | `12000` | Hard cap to avoid infinitely growing buffers. |\n| `outputEncoding` | `wav` | `wav` wraps PCM in a RIFF header, `pcm` keeps raw PCM16. |\n| `inlineAudioLimit` | `65536` | Inline byte budget before turn audio is offloaded via the shared storage manager. |\n| `coalesceDurationMs` | `0` | Optional merge window that combines adjacent turns for the same participant before emission. |\n| `coalesceMaxDurationMs` | `30000` | Maximum duration for a coalesced turn before forced emission. |\n\n## 📦 Model Requirements\n\nSilero requires the ONNX Runtime shared libraries. The provided Dockerfile downloads\n`onnxruntime-linux-x64-1.18.1` during the build stage and copies the shared objects into\nthe final image. If you use a custom base image, ensure the following environment\nvariables point to the directory that contains `libonnxruntime.so`:\n\n```\nLD_LIBRARY_PATH=/opt/onnxruntime/lib\nLIBRARY_PATH=/opt/onnxruntime/lib\nC_INCLUDE_PATH=/opt/onnxruntime/include\n```\n\nThe ONNX model itself is not embedded; mount it into the container filesystem and set\n`modelPath` accordingly (for example by referencing a ConfigMap, PVC, or baked image\nlayer with the Silero checkpoint).\n\n## 📥 Inputs\n\n- **Inputs**: `type=speech.audio.v1`. The `audio.data` field must contain\n  base64-encoded PCM16 data.\n\n## 📤 Outputs\n\n- **Outputs**: `type=speech.vad.active` with `audio.data` holding either raw PCM\n  or WAV data depending on `outputEncoding`. When offloading kicks in, the `audio.storage`\n  reference contains the blob path and matching content type (`audio/wav` for WAV output,\n  `audio/L16` for raw PCM) instead of inline bytes.\n\n## 🔄 Streaming Mode\n\n| Stream type | Description |\n|-------------|-------------|\n| `speech.vad.active` | Emitted for every detected speech turn. Includes buffered audio, duration, and sequence metadata. |\n\nThe engram also tags metadata with `provider=silero`, letting downstream stories mix\nand match VAD engines without brittle string comparisons.\n\n## 🧪 Local Development\n\n- `make lint` – Run the shared lint and static-analysis checks.\n- `go test ./...` – Run the Silero/VAD test suite in an environment with ONNX Runtime headers installed.\n- `make docker-build` – Build the engram image for local clusters.\n- Set `BUBU_DEBUG=true` to log sanitized input packet summaries and emitted turn metadata without dumping raw PCM into the logs.\n\n## 🔄 Runtime Notes\n\nThe engram runs as a streaming Deployment. Provide a read-only volume for\n`/models` (or whichever path you configure) so the ONNX file is available before\nstartup. The default container exposes gRPC on port `50051` like other streaming\nengrams.\n\n### 🏗️ Building multi-architecture images\n\nThe Dockerfile now honors BuildKit's `TARGETPLATFORM`, so running:\n\n```bash\ndocker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/bubustack/silero-vad-engram:latest --push .\n```\n\npublishes matching images for both architectures. When building without BuildKit,\npass `--build-arg TARGETARCH=$(uname -m)` to ensure the binary matches the base\nimage (`TARGETARCH=arm64` on Apple Silicon, `amd64` on x86 hosts).\n\n## 🤝 Community \u0026 Support\n\n- [Contributing](./CONTRIBUTING.md)\n- [Support](./SUPPORT.md)\n- [Security Policy](./SECURITY.md)\n- [Code of Conduct](./CODE_OF_CONDUCT.md)\n- [Discord](https://discord.gg/dysrB7D8H6)\n\n\n## 📄 License\n\nCopyright 2025 BubuStack.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubustack%2Fsilero-vad-engram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbubustack%2Fsilero-vad-engram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubustack%2Fsilero-vad-engram/lists"}