Example: Modal
Deploy Pipecat applications to Modal
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
- Install dependencies
- Setup environment variables
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.
- Test the app locally
This command runs your Pipecat application locally through Modal’s development server, allowing you to test functionality before deploying.
- Deploy to production
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.