A template voice agent for Pipecat Cloud that demonstrates building and deploying a conversational AI agent.
- Python 3.10+
- Linux, MacOS, or Windows Subsystem for Linux (WSL)
- Docker and a Docker repository (e.g., Docker Hub)
- A Docker Hub account (or other container registry account)
- Pipecat Cloud account
Note: If you haven't installed Docker yet, follow the official installation guides for your platform (Linux, Mac, Windows). For Docker Hub, create a free account and log in via terminal with
docker login
.
We recommend using a virtual environment to manage your Python dependencies.
# Create a virtual environment
python -m venv venv
# Activate it
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
pip install pipecatcloud
Clone the starter project from GitHub:
git clone https://github.com/daily-co/pipecat-cloud-starter
cd pipecat-cloud-starter
or use the Pipecat Cloud CLI to initialize a new project:
mkdir pipecat-cloud-starter && cd pipecat-cloud-starter
pcc init
pcc auth login
This starter requires the following API keys:
- OpenAI API Key: Get from platform.openai.com/api-keys
- Cartesia API Key: Get from play.cartesia.ai/keys
- Daily API Key: Automatically provided through your Pipecat Cloud account
You can test your agent locally before deploying to Pipecat Cloud:
# Set environment variables with your API keys
export CARTESIA_API_KEY="your_cartesia_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 theSettings
in theDaily (WebRTC)
tab.
Launch the bot.py script locally:
LOCAL_RUN=1 python bot.py
# Build the image (targeting ARM architecture for cloud deployment)
docker build --platform=linux/arm64 -t my-first-agent:latest .
# Tag with your Docker username and version
docker tag my-first-agent:latest your-username/my-first-agent:0.1
# Push to Docker Hub
docker push your-username/my-first-agent:0.1
The starter project requires API keys for OpenAI and Cartesia:
# Copy the example env file
cp env.example .env
# Edit .env to add your API keys:
# CARTESIA_API_KEY=your_cartesia_key
# OPENAI_API_KEY=your_openai_key
# Create a secret set from your .env file
pcc secrets set my-first-agent-secrets --file .env
Alternatively, you can create secrets directly via CLI:
pcc secrets set my-first-agent-secrets \
CARTESIA_API_KEY=your_cartesia_key \
OPENAI_API_KEY=your_openai_key
pcc deploy my-first-agent your-username/my-first-agent:0.1
Note (Optional): For a more maintainable approach, you can use the included
pcc-deploy.toml
file:agent_name = "my-first-agent" image = "your-username/my-first-agent:0.1" secret_set = "my-first-agent-secrets" [scaling] min_instances = 0Then simply run
pcc deploy
without additional arguments.
Note: If your repository is private, you'll need to add credentials:
# Create pull secret (you'll be prompted for credentials) pcc secrets image-pull-secret pull-secret https://index.docker.io/v1/ # Deploy with credentials pcc deploy my-first-agent your-username/my-first-agent:0.1 --credentials pull-secret
By default, your agent will use "scale-to-zero" configuration, which means it may have a cold start of around 10 seconds when first used. By default, idle instances are maintained for 5 minutes before being terminated when using scale-to-zero.
For more responsive testing, you can scale your deployment to keep a minimum of one instance warm:
# Ensure at least one warm instance is always available
pcc deploy my-first-agent your-username/my-first-agent:0.1 --min-instances 1
# Check the status of your deployment
pcc agent status my-first-agent
By default, idle instances are maintained for 5 minutes before being terminated when using scale-to-zero.
# Create a public API key for accessing your agent
pcc organizations keys create
# Set it as the default key to use with your agent
pcc organizations keys use
# Start a session with your agent in a Daily room
pcc agent start my-first-agent --use-daily
This will return a URL, which you can use to connect to your running agent.
For more details on Pipecat Cloud and its capabilities:
Join our Discord community for help and discussions.