So I’ve read through all of the docs on LiveKit Ag...
# agents
n
So I’ve read through all of the docs on LiveKit Agents and it’s not clear to me how a frontend would distinguish between your local running agent in dev mode and a deployed agent. It seems like both would enter the room (or the first available would enter). If you wanted to test only your local code (and basically ignore the deployed agent), what’s the simplest way to do that?
f
Correct. By default I believe agents are dispatched automatically even in dev mode. If you want the simplest test just for the agent and no front end run:
Copy code
uv run agent.py console
This runs the agent directly in your "console" which is great. When I'm troubleshooting or testing, I always start with console if possible. Then you upgrade to "dev". You can also give your agent a name and tell it to join a room explicit using dispatch. That way you can test a new agent into only your test room.
Copy code
Explicit dispatch is available for greater control over when and how agents join rooms. This approach leverages the same worker systems, allowing you to run agent workers in the same way.
Copy code
When you start your app with uv run agent.py dev, it registers as a worker with the LiveKit server. The server manages dispatching programmatic participants to rooms by sending requests to available workers.

A programmatic participant is any code that joins a LiveKit room as a participant—this includes AI agents, media processors, or custom logic that processes realtime streams. This topic describes the worker lifecycle for AI agents, but the same lifecycle applies to all programmatic participants.
Dev mode gives you some additional logging with debug and also terminates the session quickly rather than waiting for it to drain, quicker to run, test, join, repeat. https://docs.livekit.io/reference/python/livekit/agents/cli/cli.html https://docs.livekit.io/reference/python/livekit/agents/cli/proto.html#livekit.agents.cli.proto.CliArgs.devmode https://docs.livekit.io/agents/worker/ https://docs.livekit.io/agents/worker/agent-dispatch/
lk agent logs tail
is another handy one I almost always have running when testing
m
if you want to run agents in different environments (dev/staging/prod etc) create new livekit projects for each then adjust the
LIVEKIT_URL
accordingly
this 1