I feel like sometimes I don't have an agent runnin...
# ask-ai
t
I feel like sometimes I don't have an agent running locally and then I click connect in the live kit's agent playground and somehow it connects to the cloud version. And so when I am running PNPM dev locally like I have to check the logs to make sure that it's working on the local agent instead of on the deployed agent. Is that possible? And if so why is that the case and how can I avoid that?
t
Thanks for reaching out, Ishil. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — that makes sense to be worried about. You’re asking whether the Playground can end up using a cloud-deployed agent when your local agent isn’t running, why that happens, and how to make sure your local agent is the one handling sessions. Short answer: yes, that can happen — here’s why and exactly what to do to avoid it. Why this can happen • The Playground routes sessions to any agent worker registered under the agent name you specify. • If your local agent isn’t running or hasn’t registered, LiveKit may dispatch the session to a previously deployed cloud agent with the same agent name. • That’s why you sometimes see activity but no local logs — the cloud instance handled the session. How to ensure your local agent is used 1. Start the local agent before connecting ◦ Run your agent in dev mode (or with your usual local command) before clicking Connect in the Playground, for example: ▪︎ Node:
pnpm dev
▪︎ Python/dev tooling:
uv run agent.py dev
◦ Watch the terminal until you see a confirmation like “registered worker.” That confirms your local agent is available for dispatch. 1. Match the agent name ◦ Make sure the
agent_name
your app uses is the same name you enter in the Playground. If they differ, Playground won’t reach your local process. 1. Watch local logs during a session ◦ While connected, speak or trigger activity and confirm corresponding logs appear in your local terminal. If you see activity locally, your local agent is handling the session. If you don’t, the session was routed elsewhere. 1. Avoid name collisions ◦ Rename your local agent to something unique for development (for example
my-agent-dev
) so it won’t conflict with deployed agents. ◦ Alternatively, temporarily undeploy or delete the cloud agent that shares the same name if you don’t need it while developing. 1. Use console/local-only mode for isolated testing ◦ If you want to guarantee no cloud involvement, run the agent in console/local-only mode (
console
or equivalent for your agent tooling). That keeps everything on your machine and bypasses cloud dispatch. If you’d like, tell me: • the command you use to run your local agent (pnpm dev or another), and • the agent name you put in the Playground. I can help check the exact log messages to look for (what indicates “registered worker” in your setup) and suggest the simplest rename or run command so you won’t have to check logs every time. Sources: Google AI and LiveKit | LiveKit Documentation | Build Your First AI Voice Agent in Python: Complete Tutorial | LiveKit | Agents Framework | livekit/livekit_composite | DeepWiki
t
worked, i just used a diff name locally