I just self-hosted an agent on my computer, how do...
# ask-ai
a
I just self-hosted an agent on my computer, how do I push it to the Live Kit cloud? What are the commands?
t
Thanks for reaching out, Tanguy. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi there! I understand you're looking to migrate your self-hosted agent to LiveKit Cloud. While LiveKit Cloud doesn’t support directly migrating or "pushing" a self-hosted agent, don’t worry—we can get your agent up and running by re-deploying your code using the LiveKit CLI. Here’s a friendly step-by-step guide to help you through the process: 1. Prepare Your Codebase: Make sure your agent code is all set for deployment. It’s a good idea to remove any self-hosting-specific environment variables like
LIVEKIT_URL
,
LIVEKIT_API_KEY
, and
LIVEKIT_API_SECRET
to avoid conflicts. 2. Install and Configure the LiveKit CLI: If you haven’t already, install the CLI and authenticate with your LiveKit Cloud project by running:
lk cloud auth
lk project set-default "<your-cloud-project>"
3. Generate Deployment Files: Use
lk agent dockerfile
to create a Dockerfile and a
.dockerignore
file if you need one. This helps package your agent properly. 4. Deploy Your Agent: Next, run
lk agent create
to register and deploy your agent. If you have secrets to include, you can pass them using
--secrets
or a
--secrets-file
. 5. Manage Your Agent: Once deployed, you can easily update your agent with
lk agent deploy
, roll back changes with
lk agent rollback
, and keep an eye on logs using
lk agent logs
. If any part of this feels tricky or you want a hand with any step, please don’t hesitate to reach out. I’m here to help you every step of the way! Sources: Deploy and scale agents on LiveKit Cloud | Deploying to production | LiveKit Docs | README.md | agent/.env.sample | cmd/lk/agent.go
a
Once the agent is uploaded to the platform, how do I update it?
t
To update an agent on LiveKit Cloud, you can easily use the LiveKit CLI. Here’s a simple guide to help you through it: 1. Update the Agent: Just run the command:
lk agent update
This will update the agent and restart it smoothly, without interrupting any active sessions. 2. Update Secrets: If you need to change secrets, you can do so with:
lk agent update --secrets KEY=VALUE
Or, if you have a file with your secrets, use:
lk agent update --secrets-file .secrets.env
3. Monitor Status: To keep an eye on things, check the agent’s status with:
lk agent status
and you can also view logs anytime using:
lk agent logs
If you’d like, I’m here to help you with any specific step or question you have! Sources: autocomplete/fish_autocomplete | Agent deployment CLI reference | LiveKit Docs | livekit/livekit_cloud_agent.twirp.go | agent_client.go | Deploying to production | LiveKit Docs
a
What are the uses of ingresses and egresses in the context of telephone AI agents?
t
Thanks for reaching out! Could you help me understand a bit more about the specific functionality or use case you're thinking of when it comes to ingresses and egresses in telephone AI agents? For instance, are you curious about how they manage call routing, handle data flow, or connect with other systems? I'm here to help clarify anything you need!
a
à chaque fois que j'essaye de mettre à jour l'agent j'ai ce message d'erreur qui apparait : tanguyauguet@OrdinatdeTanguy Livekit Test3 % lk agent update Using project [aitom2] project does not match agent subdomain [] tanguyauguet@OrdinatdeTanguy Livekit Test3 %
t
It looks like you're encountering the error "project does not match agent subdomain," which usually happens when there's a mismatch between the subdomain in your
livekit.toml
file and the project URL used by the CLI. No worries—let’s walk through some steps to help you fix this: 1. Verify `livekit.toml`: Double-check that this file has the correct subdomain for your project: `[project] subdomain = "your-project-subdomain" [agent] id = "your-agent-id"`If needed, you can regenerate this file by running:
lk agent config --id <your-agent-id>
2. Explicitly Specify the Subdomain: To avoid any confusion, try using the
--subdomain
flag like this:
lk agent update --subdomain your-subdomain
3. Check Environment Variables: Make sure your
LIVEKIT_URL
matches your project’s subdomain (for example,
<https://your-subdomain.livekit.cloud>
). If you want to see more details, you can add
--verbose
for debugging:
lk agent update --verbose
4. Validate CLI Configuration: It’s helpful to list and update your projects to ensure everything’s set up correctly:
lk project list
lk project add --name my-project --subdomain your-subdomain --api-key YOUR_KEY --api-secret YOUR_SECRET
Then, set your project as the default with:
lk project set-default my-project
5. Ensure Correct Directory: Make sure you’re running the command in the directory that contains the right
livekit.toml
, or specify the path explicitly:
lk agent update /path/to/agent/directory
If you run into any other questions or need a hand with these steps, just let me know—I’m here to help! Sources: autocomplete/fish_autocomplete | Deploying to production | LiveKit Docs | .env.example