Prerequisites
System requirements
- Python 3.10+
- Linux, MacOS, or Windows Subsystem for Linux (WSL)
- Docker installed on your system
- Access to a container registry (e.g., Docker Hub, GitHub Container Registry, etc.)
Install Docker
Docker Desktop is recommended for development environments as it provides a comprehensive GUI and tools.
Set up a container registry
- Create a Docker Hub account
If you don't already have a Docker Hub account, create one for free.
While other container registries will work, this guide uses Docker Hub in its examples.
- Log in to Docker
After creating your account, log in via your terminal:
docker loginLearn about different Docker login options in the official documentation.
- No repository creation needed yet
Unlike some services, with Docker Hub you don't need to create a repository in advance.
When you push your first image later in this guide, a repository will be automatically created with the name you specify.
Take note of your Docker Hub username - you'll need it when pushing your agent image in later steps.
Create service accounts
The Pipecat Cloud starter agent uses OpenAI for LLM inference and LMNT for text-to-speech. You will need API keys for both services.
Create your starter project
A bare-bones voice AI agent template is available to help you get started. You'll need to set up your Python environment and authenticate with Pipecat Cloud before initializing the starter project.
First, create a new directory for your project:
mkdir pipecat-cloud-starter && cd pipecat-cloud-starterConfigure your Python environment
We recommend using a virtual environment to isolate your project dependencies:
Set up Pipecat Cloud
- Create a Pipecat Cloud account
Create an account at pipecat.daily.co.
You must have valid billing information associated with your account in order to deploy agents.
- Install Pipecat Cloud CLI
With your environment activated, install the Pipecat Cloud CLI:
pip install pipecatcloudThe Pipecat Cloud CLI can be used with either
pipecatcloudorpccas the command prefix. - Authenticate
Run
pcc auth loginto authenticate via your browser (if this doesn't work, trypython -m pipecatcloud auth login.)
Initialize the starter project
Now, clone the starter project.
git clone https://github.com/lmnt-com/pipecat-cloud-starter.gitThis command downloads a template that includes everything you need to build and deploy your first voice AI agent.
Project structure
The starter project includes these key files:
bot.py: Python entry-point containing your Pipecat agent pipelineDockerfile: Dockerfile for building the agent containerrequirements.txt: Python dependencies used by your agent codepcc-deploy.toml: Pipecat Cloud deployment configuration file (optional)
Configure to run locally (optional)
You can test your agent locally before deploying to Pipecat Cloud:
# Set environment variables with your API keys
export LMNT_API_KEY="your_lmnt_key"
export DAILY_API_KEY="your_daily_key"
export OPENAI_API_KEY="your_openai_key"Your DAILY_API_KEY can be found at https://pipecat.daily.co under the Settings in the Daily (WebRTC) tab.
First install requirements:
pip install -r requirements.txtThen, launch the bot.py script locally:
LOCAL_RUN=1 python bot.pyDeploy the agent
Pipecat Cloud expects a built Docker image that includes the agent code and all dependencies.
Build and push your Docker image
Build your Docker image
From within your project directory, run Docker build:
docker build --platform=linux/arm64 -t lmnt-agent:latest .This command builds a Docker image named lmnt-agent with the tag latest
from the current directory.
The --platform=linux/arm64 flag is required as Pipecat Cloud runs on
ARM64 architecture.
Tag your Docker image
Using the Docker image you just built, tag it with your Docker Hub username and
a version number. The tag should be
[your-username]/[image-name]:[version-number].
docker tag lmnt-agent:latest your-username/lmnt-agent:0.1Push your Docker image
After tagging your image, you can push it to your Docker Hub registry:
docker push your-username/lmnt-agent:0.1While in beta, Pipecat Cloud requires that your agent image is pushed to your own repository, such as Docker Hub. Both public and private repositories are supported.
Add secrets
Secrets are a secure way to manage sensitive information such as API keys, passwords, and other credentials.
The starter project requires the following API keys:
- OpenAI API key
- LMNT API key
- Daily API key (automatically provided through your Pipecat Cloud account)
Pipecat Cloud organizes your secrets into secret sets. This allows you to re-use the same set of secrets across multiple agents within your organization.
Creating a secret set from a file (recommended)
The starter project includes an env.example file that you can use as a
template. Create a copy of this file and add your actual API keys:
# Copy the example file
cp env.example .env
# Edit the file with your API keys
# LMNT_API_KEY=your_lmnt_key
# OPENAI_API_KEY=your_openai_keyThen, create a secret set from this file:
pcc secrets set lmnt-agent-secrets --file .envFor more information on managing secrets, please see Secrets.
Create a deployment
The CLI deploy command requires three key pieces of information:
- The name of your agent on Pipecat Cloud
- The repository and tag of your Docker image
- The secrets set to use for environment variables
Let's deploy the agent using your pushed image:
pcc deploy lmnt-agent your-username/lmnt-agent:0.1 --secrets lmnt-agent-secretsWhen you run this command, you'll be asked to confirm your deployment configuration before proceeding.
The starter project includes a pcc-deploy.toml file that already has the
agent name, image reference, and secret set configured. If you're using this
file, you can simply run pcc deploy without additional arguments.
See the Deployments section to learn more.
For more deployment configuration options, see the deploy reference docs.
Check the status of your deployment
Assuming the deployment was successful, you can check the status of your agent using the CLI:
# Deployment status
pcc agent status lmnt-agent
# List deployment history
pcc agent deployments lmnt-agentScale the deployment
Right now, your deployment has been made with the default runtime configuration.
This means that your agent defaults to "scale-to-zero", with no minimum agent instances to serve on-demand session requests.
If you were to attempt to connect with your agent now, it's likely you'd encounter a cold start while the agent spins up. Cold starts typically take around 10 seconds.
To avoid this, you can scale your deployment to a minimum of one instance:
pcc deploy lmnt-agent your-username/lmnt-agent:0.1 --min-agents 1This will provide you with one warm instance ready to serve any active sessions.
By default, idle agent instances are maintained for 5 minutes before being terminated when using scale-to-zero. For more information, please see Scaling.
Setting --min-agents to 1 or greater will incur charges even when
the agent is not in use.
Start an active session
Now that your agent has been deployed, you can start an active session to interact with it.
Creating active sessions requires passing a valid API key for your namespace or organization. This is used to authenticate the request and prevent unauthorized access.
Create a public access key
pcc organizations keys createRunning this command will ask if you'd like to set this key as your default.
Doing so will associate the created key with your current namespace, allowing
you to omit the --api-key flag in future requests.
Next set the key to be used with your agent:
pcc organizations keys useWhen prompted, select your agent from the list.
Talk to your agent
The starter project is configured to use Daily as a WebRTC transport. Pipecat Cloud has a direct integration with Daily, meaning you are issued a Daily API key when you create an account.
pcc agent start lmnt-agent --use-dailyThis command will start a new active session with your agent. Since you are using Daily, you will be given a URL in the terminal to open in your browser. This will open a new tab where you can interact with your agent.
When using the Daily key associated with your Pipecat Cloud account, your Daily voice minutes for one human and one bot are free.
Additional charges apply for features like recording, transcription, and PSTN/SIP. See Daily's pricing page for more information.
For more information on starting sessions, see Active Sessions.
Monitor and Troubleshoot
Once your agent is deployed, you can use the following commands to monitor its status and troubleshoot any issues:
# Check deployment status
pcc agent status lmnt-agent
# View deployment logs
pcc agent logs lmnt-agentThese commands provide visibility into your agent's operation and can help diagnose problems if your agent isn't functioning as expected.
Next Steps
Congratulations! You have successfully deployed your first agent w/ LMNT TTS to Pipecat Cloud.
Read on for more details about scaling your deployment and other useful integrations.