deploy command replaces the legacy serve and modal-serve commands, providing a consistent interface for running task apps locally or deploying to Modal.
Quick Start
Runtimes
The--runtime flag determines where your task app runs:
uvicorn - Local Development
Run your task app locally with hot reload, perfect for development and testing.
Basic usage:
--host TEXT- Bind address (default:0.0.0.0)--port INTEGER- Port number (prompted if not provided)--env-file PATH- Load environment variables (repeatable)--reload- Auto-reload on code changes--force- Kill existing process on port--trace DIR- Enable trace output directory--trace-db PATH- SQLite database for traces
modal - Cloud Deployment
Deploy to Modal’s cloud platform for production or remote access during RL training.
Basic usage:
--name TEXT- Override Modal app name--modal-mode [deploy|serve]- Deployment mode:deploy(default) - Persistent production deploymentserve- Ephemeral development deployment (shuts down on exit)
--modal-app PATH- Custom Modal wrapper file (rarely needed)--modal-cli PATH- Path to Modal CLI binary--dry-run- Print Modal command without executing (only works with--modal-mode deploy)
App Discovery
You can deploy in three ways:1. Registry-based (Recommended)
Deploy a registered task app by ID:2. File-based
Deploy from a task app file directly:3. Interactive discovery
If you don’t specify an app ID or--task-app, the CLI will discover and prompt you to select from:
- Registered task apps
- Demo apps
- Task apps in your current directory
Common Workflows
Local Development Loop
Preview on Modal Before Production
Production Deployment
Environment Variables
The deploy command respects:SYNTH_API_KEY- Your Synth platform API keyENVIRONMENT_API_KEY- Task app authentication (forwarded as X-API-Key)TASK_APP_URL- Default task app URLDEMO_DIR/SYNTH_DEMO_DIR- Demo directory paths
--env-file to load additional environment files:
Prerequisites
For uvicorn runtime:
- Python 3.11+
- Task app dependencies installed
For modal runtime:
- Modal account - Sign up at modal.com
- Modal authentication:
- Environment API key:
Troubleshooting
”ENVIRONMENT_API_KEY is required”
Run setup to configure your credentials:“Modal CLI not found”
Install Modal and authenticate:“Port already in use” (uvicorn)
Use--force to kill the existing process:
“Task app not found”
- Verify the app ID matches your task app registration
- Use
--task-appto specify the file path explicitly - Check that the task app file exists and is valid
Modal deployment fails
- Verify Modal authentication:
modal token new - Check that
ENVIRONMENT_API_KEYis set - Review Modal logs in the terminal output
- Try
--dry-runto preview the Modal command
Migration from Legacy Commands
If you were using the oldserve or modal-serve commands:
Old: