This guide demonstrates how to deploy a Pipecat application on Modal, a cloud platform for running serverless Python applications.

Deployment example

View the complete Modal deployment example in our GitHub repository

Modal is well-suited for Pipecat deployments because it handles container orchestration, scaling, and cold starts efficiently. This makes it a good choice for production Pipecat bots that need reliable performance.

Deployment Steps

  1. Install dependencies
python -m venv venv
source venv/bin/active # or OS equivalent
pip install -r requirements.txt
  1. Setup environment variables
cp env.example .env

This example uses a local .env file for development, but for production, you can configure your Modal app to use secrets for secure credential management.

  1. Test the app locally
modal serve app.py

This command runs your Pipecat application locally through Modal’s development server, allowing you to test functionality before deploying.

  1. Deploy to production
modal deploy app.py

This will deploy your application to Modal’s cloud infrastructure, making it accessible through Modal’s API endpoints.

Configuration options

The example app in our repository includes several important configuration settings:

  • keep_warm=1: This ensures at least one warm instance of your function is always available, reducing cold start latency for users.

  • max_inputs=1: Limits concurrency to 1 since each user requires their own dedicated function instance.

These settings help balance performance with cost when running Pipecat applications on Modal. You can adjust these parameters based on your expected traffic patterns and budget constraints.