RuntimeError: livekit-plugins-turn-detector initia...
# ask-ai
c
RuntimeError: livekit-plugins-turn-detector initialization failed. Could not find file "model_q8.onnx".
t
Thanks for reaching out, Nick. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I’m responding to the RuntimeError about the turn detector failing because it can’t find "model_q8.onnx". This plugin requires model weights to be downloaded before first use. To fix it, download the model files: • For Python agents:
Copy code
uv run agent.py download-files
• For Node.js agents:
Copy code
pnpm run download
Also ensure the turn-detector plugin is installed: • Python:
Copy code
uv add "livekit-agents[turn-detector]~=1.2"
• Node.js:
Copy code
pnpm install @livekit/agents-plugin-livekit
After downloading the model files and confirming the plugin is installed, restart your agent — the
model_q8.onnx
file should be present and the initialization error should be resolved. Would you like help running the download command or verifying the file location? Sources: LiveKit turn detector plugin | LiveKit docs | Improving voice AI's turn detection with transformers
c
how do i connect my agent to my playground
t
You're asking how to connect your agent to the Agents Playground — I can help. Which agent runtime are you using: Python or Node.js? Also confirm whether you’re using the Agent Builder preview or the public Agents Playground web app. Quick steps you’ll follow once I know that: • Start your agent in dev mode (
uv run agent.py dev
for Python or
pnpm dev
for Node.js). • Open the Agents Playground (or Builder preview) to connect and test audio/video/transcription. • Ensure your LIVEKIT_API_KEY / LIVEKIT_API_SECRET (and other env vars) are set. Tell me your runtime (Python/Node) and which playground you mean and I’ll give the exact commands and any troubleshooting tips. Sources: Agents playground | LiveKit Docs | Voice AI quickstart | LiveKit docs | Agent Builder | LiveKit docs
c
python, my agent is running in dev mode locally. playground is running and room says connected but agent not connected
t
Thanks — you're running a local Python agent in dev mode and the Playground room shows connected but the agent isn't joining. I’ll help diagnose. Please provide: 1. The terminal logs from when you run:
Copy code
uv run agent.py dev
(Include the lines around startup and any errors when you open the Playground room.) 1. Your environment values (redact secrets): ◦
LIVEKIT_URL
◦
LIVEKIT_API_KEY
(redact value but confirm it’s set) ◦
LIVEKIT_API_SECRET
(redact value but confirm it’s set) ◦ Confirm whether you used
lk app env -w
to write
.env.local
. 1. Confirm whether you changed `job_handler`/`entrypoint` logic or added filters such as
job_request.accept()
conditions that might reject Playground sessions. Quick checks you can run now: • Verify agent is running in dev mode and shows a worker registration message in logs (search for “Worker registered” or “Connected to LiveKit”). • Ensure no errors about authentication or WebSocket connection in the logs. • Confirm the Playground room name matches what the agent will accept (no metadata filtering). • Restart the agent after confirming env vars, then open a new Playground room. Send the logs and the three confirmations above and I’ll point to the exact failure cause and next steps. Sources: Voice AI quickstart | LiveKit docs | An open source stack for real-time multimodal AI | Deploying to custom environments | LiveKit docs
c
Copy code
LIVEKIT_URL=wss://tete-a-tete-ruwdglx3.livekit.cloud

    15:50:50.489 DEBUG  asyncio            Using selector: EpollSelector  
    15:50:50.491 DEV    livekit.agents     Watching /home/mmx/PycharmProjects/agents/examples/voice_agents  
                 DEV    livekit.agents     Watching /home/mmx/PycharmProjects/agents/livekit-agents  
    15:50:50.492 DEV    livekit.agents     Watching /home/mmx/PycharmProjects/agents/livekit-plugins/livekit-plugins-silero  
    15:50:50.493 DEV    livekit.agents     Watching /home/mmx/PycharmProjects/agents/livekit-plugins/livekit-plugins-turn-detector  
    15:50:51.454 DEBUG  asyncio            Using selector: EpollSelector  
    15:50:51.459 INFO   livekit.agents     starting worker {"version": "1.3.6", "rtc-version": "1.0.19"}
    15:50:51.460 INFO   livekit.agents     preloading plugins {"packages": ["livekit.plugins.silero", "livekit.plugins.turn_detector", "av"]}
    15:50:51.462 INFO   livekit.agents     starting inference executor  
    15:50:52.384 INFO   livekit.agents     initializing process {"pid": 204738, "inference": true}
    15:50:54.432 INFO   livekit.agents     process initialized {"pid": 204738, "inference": true, "elapsed_time": 2.05}
    15:50:54.434 INFO   livekit.agents     HTTP server listening on :43781  
    15:50:54.492 INFO   livekit.agents     registered worker  
                                         {"agent_name": "", "id": "AW_ZxsiqTSPUCCN", "url": "wss://tete-a-tete-ruwdglx3.livekit.cloud", "region": "UK", 
"protocol": 16}
t
Thanks — I can see the agent registered successfully (registered worker, HTTP server listening). That means the agent can reach LiveKit. Next steps to pinpoint why it’s not joining the Playground room: 1. After the Playground shows the room as connected, paste any new lines from the agent logs that appear at that exact moment (or the last ~30 lines). Look for messages like
Job assigned
,
rtc_session started
, or any errors. 2. Confirm whether you modified the agent’s job acceptance logic: ◦ Do you have custom
job_handler
or
job_request.accept()
conditions? If so, share that snippet (or confirm none exist). 1. Verify the Playground room name and any metadata: ◦ Which room name are you using in the Playground? ◦ If you set room metadata in the Playground, does your agent filter on metadata? (If unsure, say so.) 1. Quick checks you can run now: ◦ Create a fresh room in the Playground and then watch the agent logs in real time to capture any new output. ◦ Grep the agent logs for
job
,
rtc_session
,
accept
,
reject
,
error
, or
dispatch
to catch silent failures:
Copy code
uv run agent.py dev | sed -n '$((LINES-200)),\$p'
• Confirm your Playground is connecting to the same LiveKit project (the Playground UI should show your project URL or use the default Agents Playground which targets LiveKit Cloud). Send the new log lines and the answers to 2–3 and I’ll point to the exact cause and next action. Would you like me to show how to capture the logs when you create the room?
c
logs dont change when i hit connect in playground
t
Thanks — I hear your frustration. Since the agent registers but logs don’t change when you press Connect, let’s narrow where the handoff is failing. Please check/try the following and report back: 1. Confirm you’re using the unmodified example agent • Are you running an example/stock agent (no custom
job_handler
or
entrypoint
) or a modified one? If modified, paste the `job_handler`/accept logic. 1. Verify Playground is targeting the same LiveKit project • In the Playground UI, confirm the project URL matches
tete-a-tete-ruwdglx3.livekit.cloud
(or that you’re using the Agents Playground which uses LiveKit Cloud). 1. Reproduce while tailing full logs • Run the agent and stream logs to console, then immediately click Connect in the Playground and copy any new output. Use:
Copy code
uv run agent.py dev
If nothing appears, capture network activity (next step). 1. Check dispatch reachability from LiveKit • The agent registers but may not receive dispatch events. From your agent machine run a continuous curl to the agent HTTP endpoint to ensure it’s reachable locally:
Copy code
curl http://127.0.0.1:43781/health
(Adjust host/port shown in your logs if different.) Share the response. 1. Check LiveKit Workers list • In LiveKit Cloud dashboard > Agents > Active Workers, do you see your worker listed as active? If yes, note its ID matches
AW_ZxsiqTSPUCCN
. 1. Browser → Playground network check • In the browser DevTools (Network tab) while you press Connect, watch requests to LiveKit/Agents dispatch endpoints. Note any failed requests or 4xx/5xx responses and copy one example. 1. Temporarily enable verbose logging • Start with
LOG_LEVEL=debug
in your environment and restart the agent, then press Connect and paste any new debug output. If you prefer, start with steps 1–3 (are you on an unmodified example, confirm Playground project URL, and paste any new console output). I’ll use those to pinpoint the next action.
c
uv run examples/voice_agents/basic_agent.py dev
t
Thanks — you’re running the stock example agent in dev mode. Since the agent registers but logs don’t change when you click Connect in the Playground, let’s perform a few targeted checks to see why dispatch events aren’t reaching your agent. Please run these in order and paste the results: 1) Health check the agent HTTP endpoint (from the same machine):
Copy code
curl -sS http://127.0.0.1:43781/health || curl -sS http://localhost:43781/health
Paste the response. 2) Confirm the worker is active in LiveKit Cloud • In LiveKit Cloud dashboard → Agents → Active Workers, do you see the worker ID AW_ZxsiqTSPUCCN listed? Reply yes/no. 3) Capture live agent logs while you click Connect • Start the agent with debug logging and a timestamped tail:
Copy code
LOG_LEVEL=debug uv run examples/voice_agents/basic_agent.py dev
Then immediately click Connect in the Playground and copy any new lines that appear (if none appear, say “no new lines”). 4) Check browser network activity when clicking Connect • Open DevTools → Network, click Connect, and look for any failed requests (4xx/5xx) to LiveKit or agent endpoints. Copy the URL and status of any failed request. 5) Verify Playground target • In the Playground UI, confirm the project URL matches your LIVEKIT_URL (tete-a-tete-ruwdglx3.livekit.cloud). Reply “matches” or “different”. 6) If health returns OK and worker is listed but still no logs, run a local tcpdump (Linux) while clicking Connect and share the count of outbound websocket attempts to the LiveKit URL:
Copy code
sudo tcpdump -n -A host tete-a-tete-ruwdglx3.livekit.cloud and port 443 -c 50
Report whether packets were seen. Give me the outputs for 1–5 (and 6 only if 1–5 look normal). I’ll diagnose the exact dispatch failure next.
c
and i'm using the livekit hosted playground (not self hosted)
t
Thanks — confirmed you're using the hosted Agents Playground. Since the agent registers but shows no log activity when you click Connect, let’s run the minimal targeted checks I need to diagnose dispatch reachability. Please run these three items and paste results: 1) Health endpoint (run on the agent machine):
Copy code
curl -sS http://127.0.0.1:43781/health || curl -sS http://localhost:43781/health
Paste the response. 2) LiveKit Workers list confirmation: • In LiveKit Cloud → Agents → Active Workers, do you see worker ID AW_ZxsiqTSPUCCN? Reply “yes” or “no”. 3) Browser Network snapshot while clicking Connect: • In the hosted Playground, open DevTools → Network, click Connect, and copy any request to LiveKit or Agents dispatch endpoints that returns a non-2xx status (URL + status). If all are 2xx, reply “all 2xx”. With those three outputs I can pinpoint whether the hosted Playground’s dispatch reaches your local agent or if the issue is filtering/auth/agent HTTP reachability.
c
curl -sS http://127.0.0.1:43781/health || curl -sS http://localhost:43781/health curl: (7) Failed to connect to 127.0.0.1 port 43781 after 0 ms: Couldn't connect to server curl: (7) Failed to connect to localhost port 43781 after 0 ms: Couldn't connect to server
t
Thanks — the health check failing shows the agent's HTTP server on port 43781 is not reachable locally. That explains why the hosted Playground can't dispatch jobs. Let's confirm why the HTTP server isn't running and get it listening. Please run these in your agent machine and paste the short outputs: 1. Check the running agent process and recent logs (paste last ~30 lines):
Copy code
ps aux | grep -E "agent.py|uv run" | grep -v grep
# then restart and capture logs
uv run examples/voice_agents/basic_agent.py dev
If it immediately exits, paste the exit output. 1. Check if anything is listening on 43781:
Copy code
ss -ltnp | grep 43781 || netstat -ltnp | grep 43781
1. Search for the HTTP server log line you previously saw:
Copy code
grep -n "HTTP server listening" -n ~/.cache/livekit/*.log || true
(If logs are elsewhere, check the terminal output from step 1.) 1. Run the agent in foreground and watch for binding errors:
Copy code
LOG_LEVEL=debug uv run examples/voice_agents/basic_agent.py dev
Watch for errors about port binding, permission, or immediate crashes and paste any error lines. If you prefer, run the health curl again after starting the agent in step 4 and paste that response. I’ll use those outputs to tell you the exact fix (port conflict, agent crash, missing dependency, or startup flag).
c
(Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) 160123.538 DEBUG asyncio Using selector: EpollSelector 160123.540 DEV livekit.agents Watching /home/mmx/PycharmProjects/agents/examples/voice_agents 160123.541 DEV livekit.agents Watching /home/mmx/PycharmProjects/agents/livekit-agents 160123.542 DEV livekit.agents Watching /home/mmx/PycharmProjects/agents/livekit-plugins/livekit-plugins-silero DEV livekit.agents Watching /home/mmx/PycharmProjects/agents/livekit-plugins/livekit-plugins-turn-detector 160124.491 DEBUG asyncio Using selector: EpollSelector 160124.495 INFO livekit.agents starting worker {"version": "1.3.6", "rtc-version": "1.0.19"} 160124.496 INFO livekit.agents preloading plugins {"packages": ["livekit.plugins.silero", "livekit.plugins.turn_detector", "av"]} 160124.498 INFO livekit.agents starting inference executor 160125.400 INFO livekit.agents initializing process {"pid": 209839, "inference": true} 160127.498 INFO livekit.agents process initialized {"pid": 209839, "inference": true, "elapsed_time": 2.1} 160127.501 INFO livekit.agents HTTP server listening on :40813 160127.557 INFO livekit.agents registered worker {"agent_name": "", "id": "AW_ZhqWbuzj7HHa", "url": "wss://tete-a-tete-ruwdglx3.livekit.cloud", "region": "UK", "protocol": 16}
t
Thanks — I see the agent registered and the HTTP server is listening on port 40813 (not 43781). That explains the failed health check. Do this next and paste the results: 1) Health check using the correct port:
Copy code
curl -sS http://127.0.0.1:40813/health || curl -sS http://localhost:40813/health
2) Start the agent with debug logging, click Connect in the hosted Playground, and paste any new log lines:
Copy code
LOG_LEVEL=debug uv run examples/voice_agents/basic_agent.py dev
If no new lines appear after clicking Connect, say “no new lines”. 3) In the hosted Playground browser DevTools → Network, click Connect and copy any request to LiveKit or dispatch endpoints that is non-2xx (URL + status). If all requests are 2xx, reply “all 2xx”. With those three outputs I’ll determine whether dispatch reaches your agent or if there’s filtering/auth preventing job assignment.
c
t
Thanks — the 404 from /health shows the agent HTTP server is responding on 40813 but not serving the expected health endpoint. That prevents the Playground from dispatching jobs. Let’s enable/verify the health endpoint and confirm dispatch. 1) Check how the agent HTTP server is configured in your run output — paste any lines around “HTTP server listening on :40813” (you already did; good). 2) If you haven’t changed code, enable the health endpoint by setting a health port env var and restart the agent:
Copy code
export LIVEKIT_AGENT_HEALTH_PORT=40813
LOG_LEVEL=debug uv run examples/voice_agents/basic_agent.py dev
Then run:
Copy code
curl -sS http://127.0.0.1:40813/health || curl -sS http://localhost:40813/health
If that returns 200, try Connect in the Playground and paste any new log lines. 3) If the env var doesn’t enable it, add a minimal health route in the agent entrypoint (paste if you want exact snippet). Example approach: start an AgentServer with
health_port
set so
/health
and
/availability
are served. 4) If you prefer quicker checks first: • Paste the full lines after restarting with DEBUG when you click Connect (or “no new lines”). • Confirm the worker still appears active in LiveKit Cloud → Agents. Tell me the curl result and whether any new log lines appear after trying step 2 and clicking Connect. I’ll provide the exact code snippet to add if the env var didn’t work. Sources: Self-hosting the Ingress Service | LiveKit docs
c
curl -sS http://127.0.0.1:40813/health || curl -sS http://localhost:40813/health curl: (7) Failed to connect to 127.0.0.1 port 40813 after 0 ms: Couldn't connect to server curl: (7) Failed to connect to localhost port 40813 after 0 ms: Couldn't connect to server
t
Thanks — I can see the health endpoint is still not reachable (connection refused). That means the HTTP server either isn’t running at the moment you curl or it’s bound to a different interface/port and not accepting connections on localhost. Do this next so I can give the exact fix: 1) Start the agent in foreground and paste the full startup lines (from process init through the "HTTP server listening" line):
Copy code
LOG_LEVEL=debug uv run examples/voice_agents/basic_agent.py dev
Copy the lines from initialization until the HTTP server log appears. 2) Immediately after that log appears, run:
Copy code
ss -ltnp | grep LISTEN | grep -E "127.0.0.1|0.0.0.0|:<port>"
Replace
<port>
with the port shown in the HTTP server log (e.g., 40813). Paste the output. 3) If the server is listening on a non-loopback address (not 127.0.0.1 or 0.0.0.0), try curling that address and port:
Copy code
curl -v http://<address>:<port>/health
Paste the response or curl error. If you prefer, paste the full startup log from step 1 and I’ll identify the bound address/port and provide the exact env var or small code snippet to enable a /health route that returns 200 so the hosted Playground can dispatch jobs.
c
it's like the agent playground and my agent are looking at different projects
t
You’re right — it sounds like the Playground and your agent are pointed at different LiveKit projects. The hosted Playground defaults to its own project unless you set it to use yours, so jobs won’t be dispatched to your local agent until both target the same project. Do this: 1. Confirm your agent’s LIVEKIT_URL (you showed): LIVEKIT_URL=wss://tete-a-tete-ruwdglx3.livekit.cloud 1. In the hosted Agents Playground, set the project to that same URL and use matching API key/secret (or select “Use custom project” and enter your project URL and credentials). If the Playground UI shows the project URL, change it to tete-a-tete-ruwdglx3.livekit.cloud. 2. After matching the Playground project, click Connect and watch your agent logs. If the agent still shows no activity, paste the Playground Network request that runs when you click Connect (DevTools → Network) or paste any new agent log lines. If you want, tell me whether you see a “Use custom project” option in the Playground or send a screenshot of the Playground settings panel (redact secrets) and I’ll give exact steps.
c
this is livekit cloud playground
t
You’re right — the hosted Playground uses its own demo project by default. To get jobs dispatched to your locally running agent, both the Playground and your agent must target the same LiveKit Cloud project and credentials. Do the following and tell me the results: 1) In the Playground UI choose “Use custom project” (or project settings) and set: • Project URL: wss://tete-a-tete-ruwdglx3.livekit.cloud • API key and API secret for that project (redact values when sharing). 2) Restart your local agent in dev mode and watch logs:
Copy code
LOG_LEVEL=debug uv run examples/voice_agents/basic_agent.py dev
After the agent shows “registered worker” and the HTTP server line, click Connect in the Playground and paste any new log lines (or say “no new lines”). 3) If nothing appears in logs, run the Playground Connect while capturing network/dispatch requests in the browser DevTools → Network. Copy any failed request (URL + status) or reply “all 2xx”. 4) Verify the agent health endpoint returns 200 after startup: • Note the port from the “HTTP server listening on :<port>” log line. • Run:
Copy code
curl -v http://127.0.0.1:<port>/health
Paste the response (or the curl error). Tell me: • Whether you were able to set the Playground to your project (yes/no), • The new agent log output after clicking Connect (or “no new lines”), • The health curl result. I’ll use those to give the exact next step to restore dispatch.
c
my cloud account has a test project. how do i make sure my agent uses this test project?
t
You're on the right track — here’s exactly how to make your local Python agent use your LiveKit Cloud test project so the hosted Playground can dispatch jobs to it. 1) Create a
.env.local
in your agent project root with your test project values:
Copy code
LIVEKIT_URL=wss://tete-a-tete-ruwdglx3.livekit.cloud
LIVEKIT_API_KEY=<your_test_project_api_key>
LIVEKIT_API_SECRET=<your_test_project_api_secret>
2) Ensure your agent loads that file (add if missing):
Copy code
from dotenv import load_dotenv
load_dotenv(".env.local")
3) Restart the agent in dev mode:
Copy code
LOG_LEVEL=debug uv run examples/voice_agents/basic_agent.py dev
Wait for these log lines: “HTTP server listening on :<port>” and “registered worker”. 4) Configure the hosted Playground to use your test project: • In the Playground UI choose “Use custom project” (or project settings). • Enter the same Project URL (wss://tete-a-tete-ruwdglx3.livekit.cloud) and the API key + secret from step 1. 5) Verify connections: • After agent shows “registered worker”, click Connect in Playground. • Check agent logs for job/rtc messages (or say “no new lines”). • Test local health (replace <port> with the port from the log):
Copy code
curl -v http://127.0.0.1:<port>/health
If it still doesn’t join, tell me: • Whether you set the Playground to your project (yes/no). • The agent log lines after restart (the “HTTP server listening” & “registered worker” lines suffice). • The health curl result or any new log lines when you click Connect. I’ll give the next exact step based on those outputs. Sources: Voice AI quickstart | LiveKit docs | Deploying to production | LiveKit Docs | Secrets management | LiveKit docs