livekit agents new adaptive interruption, how does...
# ask-ai
b
livekit agents new adaptive interruption, how does it work, what is the flow for it draw a little chart to explain its flow mainly my question is does the raw audio first come to the agent AND THEN it gets passed to the cloud from agent to cloud or the audio is in the room and model is applied to the audio in the room and then through websocket livekit agent gets events, basically what happens how does it work???
✅ 1
t
Thanks for reaching out, Mohammed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’ll explain how Adaptive Interruption works and clarify the audio flow, plus a simple flowchart. Short answer: the raw audio is processed in the LiveKit room (on LiveKit’s media/inference infrastructure). The audio does NOT go to the agent first; LiveKit’s VAD and the adaptive-interruption model run server-side, and the agent receives an interruption event (e.g.,
user_interruption_detected
) when the model decides it’s a true barge-in. Flow (text + simple chart) 1. Participant speaks while agent is speaking 2. LiveKit Room captures the raw audio stream 3. Voice Activity Detection (VAD) flags overlapping speech 4. LiveKit Cloud inference service runs the adaptive-interruption model on the audio in real time: ◦ analyzes waveform shape, onset, duration, prosody ◦ requires aligned transcripts from STT for proper timing 1. Model decides: interruption or not ◦ If NO → nothing sent; agent continues ◦ If YES → LiveKit sends an interruption event to the agent (via signaling/websocket) 1. Agent receives event → stops/truncates response and begins listening Simple chart (linear): Participant speaks → LiveKit Room (capture) → VAD detects overlap → LiveKit Cloud inference (adaptive model) → Decision → [No: continue] / [Yes: send interruption event → Agent stops & listens] If you’d like, I can: • Draw this as a visual diagram (PNG/SVG), or • Provide exact event names and example payloads for the websocket events used by agents. Which would help more? Sources: Adaptive interruption handling | LiveKit Documentation | Solving unwanted interruptions with Adaptive Interruption Handling | LiveKi... | Turns overview | LiveKit Documentation, with interactive elements
b
then what is meant by this error - 152008.869 WARNI… livekit.agents adaptive interruption disabled due to unrecoverable error, falling back to VAD-based interruption {"room": "test_room_pXcLYzRg8zZOvQNN6rq8", "pid": 2309545, "job_id": "AJ_zXaSKTuH9psc", "room_id": "RM_PCxxgLghanAm"} 152008.870 ERROR livekit.agents Error in _main_task Traceback (most recent call last): File "/home/mohammedusamaahmed/usama1/Voice-Agents/newLivekitVersion/1_0_21_newLivekitVersionVenv/lib/python3.… line 17, in async_fn_logs return await fn(*args, **kwargs) File "/home/mohammedusamaahmed/usama1/Voice-Agents/newLivekitVersion/1_0_21_newLivekitVersionVenv/lib/python3.… line 478, in _main_task return await self._run() File "/home/mohammedusamaahmed/usama1/Voice-Agents/newLivekitVersion/1_0_21_newLivekitVersionVenv/lib/python3.… line 1093, in _run task.result() File "/home/mohammedusamaahmed/usama1/Voice-Agents/newLivekitVersion/1_0_21_newLivekitVersionVenv/lib/python3.… line 946, in send_task raise APIStatusError( livekit.agents._exceptions.APIStatusError: message='interruption inference timed out after 0.9s (ws)', status_code=408, retryable=False {"room": "test_room_pXcLYzRg8zZOvQNN6rq8", "pid": 2309545, "job_id": "AJ_zXaSKTuH9psc", "room_id": "RM_PCxxgLghanAm"} Traceback (most recent call last): File "/home/mohammedusamaahmed/usama1/Voice-Agents/newLivekitVersion/1_0_21_newLivekitVersionVenv/lib/python3.10/site-packages/livekit/agents/utils/log.py", line 17, in async_fn_logs return await fn(*args, **kwargs) File "/home/mohammedusamaahmed/usama1/Voice-Agents/newLivekitVersion/1_0_21_newLivekitVersionVenv/lib/python3.10/site-packages/livekit/agents/inference/inte rruption.py", line 478, in _main_task return await self._run() File "/home/mohammedusamaahmed/usama1/Voice-Agents/newLivekitVersion/1_0_21_newLivekitVersionVenv/lib/python3.10/site-packages/livekit/agents/inference/inte rruption.py", line 1093, in _run task.result() File "/home/mohammedusamaahmed/usama1/Voice-Agents/newLivekitVersion/1_0_21_newLivekitVersionVenv/lib/python3.10/site-packages/livekit/agents/inference/inte rruption.py", line 946, in send_task raise APIStatusError( livekit.agents._exceptions.APIStatusError: message='interruption inference timed out after 0.9s (ws)', status_code=408, retryable=False when im trying to use adaptive interruption?
t
Thanks — I’m responding to the timeout error you pasted:
interruption inference timed out after 0.9s (ws)
and the accompanying warning that adaptive interruption was disabled and fell back to VAD. What that error means (short) • The adaptive-interruption inference request to LiveKit’s cloud inference service timed out (HTTP 408 after ~0.9s). • Because the adaptive model didn’t return in time, the agent disabled adaptive interruption for that session and reverted to VAD-only barge-in detection. Why this happens (most likely causes) • Network latency or connectivity between your agent host and LiveKit’s inference endpoints. • Agent running in a restricted / air-gapped environment where it can’t reach the inference service. • STT model doesn’t provide aligned transcripts (a requirement for adaptive interruption). • Temporary service-side delay or high inference load causing slower responses. • SDK/deployment mismatch (older SDK or config that tries adaptive mode but can’t meet requirements). Quick troubleshooting checklist 1. Confirm outbound connectivity from the agent host to LiveKit Cloud WebSocket endpoints (test ping/latency and websocket handshake). 2. Verify your STT supports aligned transcripts. Adaptive interruption requires aligned timing info. 3. Check you meet the runtime requirements (agent deployed to LiveKit Cloud or dev mode, VAD enabled, LLM not realtime). 4. Review deployment environment: if self-hosted in a restricted network, adaptive inference may be unavailable — fallback to VAD is expected. 5. Reproduce and collect timing logs: measure round-trip to inference endpoint to see if >0.9s. 6. If adaptive consistently fails and you prefer predictable behavior, set interruption mode to VAD explicitly:
Copy code
interruption = {"mode": "vad"}
What to expect • The fallback to VAD is a designed resilience behavior — interruptions still work but with less nuance than the adaptive model. • If connectivity and STT alignment are correct and timeouts persist, it’s likely transient network/service latency or a regional routing issue. If you want, tell me: • Are you running agents in LiveKit Cloud or self-hosted? • Which STT provider/model are you using (does it support aligned transcripts)? I’ll suggest the next specific checks and commands to run. Sources: Adaptive interruption handling | LiveKit Documentation | Solving unwanted interruptions with Adaptive Interruption Handling | LiveKi... | Turns overview | LiveKit Documentation | How to match the latency of the homepage agent | LiveKit, with interactive elements