wooden-beard-26644
09/29/2025, 5:26 PMtall-airline-16756
09/29/2025, 5:26 PMtall-airline-16756
09/29/2025, 5:27 PMmain.py file is running in dev mode or prod mode, you can check the devmode parameter that’s passed to the Worker instance. This parameter is set automatically by the LiveKit Agents CLI depending on how you start the agent:
• Dev mode: This kicks in when you run python main.py dev, which sets devmode=True.
• Prod mode: This happens when you run python main.py start, setting devmode=False.
Feel free to use this devmode parameter in your code to tailor behaviors specifically for testing in dev mode or running smoothly in production. If you have any questions about this, I’m here to help!
Sources: livekit-plugins/livekit-plugins-browser/livekit/plugins/browser/proc_main.p... | Docs::Agentswooden-beard-26644
09/29/2025, 5:28 PMtall-airline-16756
09/29/2025, 5:29 PMagent_name parameter dynamically in the WorkerOptions when initializing your agent. Here’s a simple example to guide you:
from livekit.agents import cli, WorkerOptions, JobContext
def entrypoint(ctx: JobContext):
# Your agent logic here
pass
if __name__ == "__main__":
devmode = True # Replace with actual devmode check
agent_name = "my-agent-dev" if devmode else "my-agent-prod"
cli.run_app(
WorkerOptions(
entrypoint_fnc=entrypoint,
agent_name=agent_name, # Dynamically set based on mode
),
)
In this example, you’ll notice the agent_name switches to "my-agent-dev" when in dev mode, and "my-agent-prod" when in prod mode. Using the devmode parameter like this makes it straightforward to adjust the name based on your current environment. If you have any questions or want to explore this further, I’m here to help!
Sources: Accepting incoming calls | LiveKit Docs | README.md | livekit-agents/livekit/agents/cli/proto.py | Docs::Agentswooden-beard-26644
09/29/2025, 5:31 PMtall-airline-16756
09/29/2025, 5:31 PMdevmode parameter that gets passed to your Worker instance. The LiveKit Agents CLI does this for you automatically, depending on how you start the agent:
• If you run python main.py dev, then devmode=True.
• If you run python main.py start, then devmode=False.
Inside your code, you can use this parameter to decide what logic should run based on whether you’re in dev mode or not. Here’s a simple example to guide you:
from livekit.agents import cli, WorkerOptions, JobContext
def entrypoint(ctx: JobContext):
# Your agent logic here
pass
if __name__ == "__main__":
cli.run_app(
WorkerOptions(
entrypoint_fnc=entrypoint,
agent_name="my-agent",
),
devmode=True # This is automatically set by the CLI
)
So, by checking the devmode value, you can easily tailor your agent’s behavior to fit the current mode. If you have any questions or want to explore this further, I’m here to help!