When deploying an agent to the hosted Livekit clou...
# ask-ai
n
When deploying an agent to the hosted Livekit cloud, how does one specify the Agent Name to assign on deploy?
t
Thanks for reaching out, Blaine. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
When you're ready to set the Agent Name while deploying an agent to the hosted LiveKit cloud, the best way is to specify the name right at the start when you create the agent. You can do this easily with the CLI command:
Copy code
lk agent create [AGENT-NAME]
For example:
Copy code
lk agent create my-voice-assistant
After creating the agent, its configuration—including the name—is saved in the
livekit.toml
file inside your project directory. This way, your chosen name stays consistent for all future deployments. When you're ready to deploy, you just need to run:
Copy code
lk agent deploy
If you have any more questions or would like a hand with any step, please don’t hesitate to reach out—I’m here to help! Sources: cmd/lk/agent.go | livekit/livekit_cloud_agent.pb.go | agent/README.md
n
what are the possible values we can specify in the
livekit.toml
?
t
The
livekit.toml
file is designed to help with agent deployment configuration, and it follows this structure and values:
Copy code
[project]
subdomain = "your-project-subdomain"

[agent]
id = "your-agent-id"
Details: • `[project]`: This part is essential and should include the
subdomain
field, which tells us the project subdomain. • `[agent]`: This part is optional and can have the
id
field if you want to specify the agent ID. The CLI is pretty smart and will automatically detect and use this file for agent operations when it’s in your working directory. If anything is unclear or you’d like a hand with this, just let me know—I’m here to help! Sources: pkg/config/livekit.go | Deploying to production | LiveKit Docs | Agent deployment CLI reference | LiveKit Docs
n
how is agent name specified in this config?
t
Thanks for reaching out! I wanted to share that the
livekit.toml
file doesn’t actually support specifying the agent name directly. Instead, it lets you configure the agent’s
id
within the
[agent]
section, like this:
Copy code
[agent]
id = "your-agent-id"
Usually, the agent name is set when you first create the agent using the CLI (for example,
lk agent create [AGENT-NAME]
) or passed as a parameter in API calls or CLI commands. It’s just not saved inside the
livekit.toml
file itself. If you’d like, I’m here to help clarify anything else or guide you through the process! Sources: cmd/lk/agent.go | examples/agent_dispatch/src/main.rs | Example Applications & Templates | livekit/livekit_composite | DeepWiki
n
if its not how do i set it after the fact?
t
I'm happy to guide you through updating the agent's display name after creation! You can easily do this using the
setName
method available in the LiveKit SDKs. This will update the name that shows up in the room for the local participant (including agents). Here’s a quick look at how it works: • JavaScript/TypeScript:
await localParticipant.setName("New Agent Display Name");
• Python:
await local_participant.set_name("New Agent Display Name")
• Rust:
await local_participant.set_name("New Agent Display Name".to_string());
Just a heads-up: please make sure the agent's token has the
canUpdateOwnMetadata
permission, as this is essential for the update to go through smoothly. Also, keep in mind that the
agent_name
used in
WorkerOptions
when dispatching can’t be changed once it’s set. If you’d like, I’m here to help with setting up your token or if you have any other questions! Sources: Agent dispatch | LiveKit Docs | Worker options | LiveKit Docs | src/room/participant/LocalParticipant.ts | examples/agent_dispatch.py | livekit/src/room/participant/local_participant.rs
n
oddly i do have it specified in
WorkerOptions
as:
Copy code
cli.run_app(WorkerOptions(entrypoint_fnc = entrypoint, agent_name="producer-agent"))
t
Thanks for your question! The
agent_name
specified in
WorkerOptions
(for example,
agent_name="producer-agent"
) plays an important role in how the system handles dispatching and identifies the agent type. This value is fixed once the worker is initialized, so it can’t be changed afterward. It’s mainly used behind the scenes for routing and explicit dispatching, rather than for the display name you see in the room. If you want to change the display name that participants see in the room, you can easily do that using the
setName
method available in the SDKs, as we mentioned earlier. Please don’t hesitate to reach out if you’d like me to walk you through it or if you have any other questions—I’m here to help!
n
but when its deployed to the livekit agent cloud, its untitled