Example
Let’s create a simple chatbot that can be deployed to all the rooms in our project. This will ensure everyone always has access to an LLM in any room inside the project. To deploy this we’ll create three files:- main.py: A MeshAgent-native chatbot service using ServiceHost
 - Dockerfile: Packages the service as a container
 - meshagent.yaml: A ServiceSpec that defines how to run the service
 
main.py
Python
Dockerfile
Dockerfile
meshagent.yaml
yaml
pull_secret parameter to the container section of the manifest if you are pulling from a private repository.
Build and Push the Container
Now that we’ve defined our agent and written the applicable Dockerfile and meshagent.yaml let’s build and push the docker container to our registry.Note: We recommend docker buildx because it supports cross-platform builds, pushes directly to your registry in one step, and enables optional layer caching for much faster CI builds.
Deploy the Project-Wide Service
From the terminal in the directory with your yaml file simply run:bash
Use the Service
Now that your service is deployed try it out in MeshAgent Studio. You’ll see the new project service appear in the Services tab of the UI. To use the service, simply start a new session and enter the room, the chatbot will appear in the participants tab for you to interact with.Related topics
- Introduction to Services and Containers: Understand services in MeshAgent and learn when to use project services, room services, and the containers API.
 - Packaging Services: Understand how to package a service for deployment.
 - Deploying Services: Learn how to deploy and update a project or room service through the MeshAgent CLI or Studio UI.
 - Deploying a Chatbot as a Room Service: Learn how to deploy a room specific service that can be customized to each room.
 - Containers API: Run containers on-demand without saving them as services