{"id":48014735,"url":"https://github.com/wavekat/wavekat-turn","last_synced_at":"2026-04-04T13:42:49.649Z","repository":{"id":347266678,"uuid":"1193222882","full_name":"wavekat/wavekat-turn","owner":"wavekat","description":"Turn detection library for Rust with a unified trait interface over multiple backends (Pipecat Smart Turn, LiveKit EOU). Part of the WaveKat voice pipeline.","archived":false,"fork":false,"pushed_at":"2026-03-27T09:38:01.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-27T18:44:22.174Z","etag":null,"topics":["audio","end-of-utterance","livekit","pipecat-smart-turn","rust","telephony","turn-detection","voice","voice-ai","wavekat"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":false,"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/wavekat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"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}},"created_at":"2026-03-27T02:03:02.000Z","updated_at":"2026-03-27T09:37:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wavekat/wavekat-turn","commit_stats":null,"previous_names":["wavekat/wavekat-turn"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/wavekat/wavekat-turn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavekat%2Fwavekat-turn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavekat%2Fwavekat-turn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavekat%2Fwavekat-turn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavekat%2Fwavekat-turn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavekat","download_url":"https://codeload.github.com/wavekat/wavekat-turn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavekat%2Fwavekat-turn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31218079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-31T03:16:13.749Z","status":"ssl_error","status_checked_at":"2026-03-31T03:15:17.442Z","response_time":111,"last_error":"SSL_read: 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":["audio","end-of-utterance","livekit","pipecat-smart-turn","rust","telephony","turn-detection","voice","voice-ai","wavekat"],"created_at":"2026-04-04T13:42:49.418Z","updated_at":"2026-04-04T13:42:49.629Z","avatar_url":"https://github.com/wavekat.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/wavekat/wavekat-turn\"\u003e\n    \u003cimg src=\"https://github.com/wavekat/wavekat-brand/raw/main/assets/banners/wavekat-turn-narrow.svg\" alt=\"WaveKat Turn\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n[![Crates.io](https://img.shields.io/crates/v/wavekat-turn.svg)](https://crates.io/crates/wavekat-turn)\n[![docs.rs](https://docs.rs/wavekat-turn/badge.svg)](https://docs.rs/wavekat-turn)\n\nUnified turn detection for voice pipelines, wrapping multiple open-source\nmodels behind common Rust traits. Same pattern as\n[wavekat-vad](https://github.com/wavekat/wavekat-vad).\n\n\u003e [!WARNING]\n\u003e Early development. API may change between minor versions.\n\n## Backends\n\n| Backend | Feature flag | Input | Model size | Inference | License |\n|---------|-------------|-------|------------|-----------|---------|\n| [Pipecat Smart Turn v3](https://github.com/pipecat-ai/smart-turn) | `pipecat` | Audio (16 kHz PCM) | ~8 MB (int8 ONNX) | ~12 ms CPU | BSD 2-Clause |\n| [LiveKit Turn Detector](https://github.com/livekit/turn-detector) | `livekit` | Text (ASR transcript) | ~400 MB (ONNX) | ~25 ms CPU | LiveKit Model License |\n\n## Quick Start\n\n```sh\ncargo add wavekat-turn --features pipecat\n```\n\nUse `TurnController` to wrap any detector with automatic state tracking:\n\n```rust\nuse wavekat_turn::{TurnController, TurnState};\nuse wavekat_turn::audio::PipecatSmartTurn;\n\nlet detector = PipecatSmartTurn::new()?;\nlet mut ctrl = TurnController::new(detector);\n\n// Feed audio continuously\nctrl.push_audio(\u0026audio_frame);\n\n// VAD speech start — soft reset (keeps buffer if turn was unfinished)\nctrl.reset_if_finished();\n\n// VAD speech end — predict\nlet prediction = ctrl.predict()?;\nmatch prediction.state {\n    TurnState::Finished   =\u003e { /* user is done, send to LLM */ }\n    TurnState::Unfinished =\u003e { /* keep listening */ }\n    TurnState::Wait       =\u003e { /* user asked AI to hold */ }\n}\n\n// After assistant finishes responding — hard reset\nctrl.reset();\n```\n\nOr the text-based detector directly:\n\n```rust\nuse wavekat_turn::{TextTurnDetector, TurnState};\nuse wavekat_turn::text::LiveKitEou;\n\nlet mut detector = LiveKitEou::new()?;\n\nlet prediction = detector.predict_text(\"I was wondering if\", \u0026context)?;\nassert_eq!(prediction.state, TurnState::Unfinished);\n```\n\nSee [`examples/controller.rs`](crates/wavekat-turn/examples/controller.rs) for a\nfull walkthrough with real audio.\n\n## Architecture\n\nTwo trait families cover the two input modalities:\n\n- **`AudioTurnDetector`** -- operates on raw audio frames (no ASR needed)\n- **`TextTurnDetector`** -- operates on ASR transcript text with optional conversation context\n\n`TurnController` wraps any `AudioTurnDetector` and adds orchestration helpers\nlike soft-reset (preserves buffer when the user pauses mid-sentence).\n\n```\nwavekat-vad   --\u003e  \"is someone speaking?\"\nwavekat-turn  --\u003e  \"are they done speaking?\"\n     |                   |\n     v                   v\nwavekat-voice --\u003e  orchestrates VAD + turn + ASR + LLM + TTS\n```\n\n## Feature Flags\n\n| Flag | Default | Description |\n|------|---------|-------------|\n| `pipecat` | off | Pipecat Smart Turn v3 audio backend (requires `ort`, `ndarray`) |\n| `livekit` | off | LiveKit text-based backend (requires `ort`, `ndarray`) |\n\n## Important Notes\n\n- **8 kHz telephony audio must be upsampled to 16 kHz** before passing to\n  audio-based detectors. Smart Turn v3 silently produces incorrect results\n  at 8 kHz.\n- Text-based detectors depend on ASR transcript quality. Pair with a\n  streaming ASR provider for best results.\n\n## Accuracy\n\nCross-validated against the original Python (Pipecat) pipeline on three fixture clips.\nTolerance: ±0.02 probability.\n\n\u003c!-- benchmark-table-start --\u003e\n\u003c!-- benchmark-table-end --\u003e\n\nRun locally with `make accuracy`. See [`scripts/README.md`](scripts/README.md) for how to regenerate the Python reference.\n\n## License\n\nLicensed under [Apache 2.0](LICENSE).\n\nCopyright 2026 WaveKat.\n\n### Acknowledgements\n\n- [Pipecat Smart Turn](https://github.com/pipecat-ai/smart-turn) by Daily (BSD 2-Clause)\n- [LiveKit Turn Detector](https://github.com/livekit/turn-detector) by LiveKit (LiveKit Model License)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavekat%2Fwavekat-turn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavekat%2Fwavekat-turn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavekat%2Fwavekat-turn/lists"}