Overview
agent.serve() returns an ordinary ASGI app running under uvicorn, so anywhere
you can run a Python web service will do:
- Self-hosted Servers - uvicorn, gunicorn, or Docker
- Kubernetes - a standard Deployment and Service
- Serverless - AWS Lambda, Cloud Run, and similar
- ASGI Servers - any ASGI-compatible platform
Observability
Tracing is off unless you ask for it. A trace carries prompts, tool arguments and tool results, so nothing leaves your process by default:agent.run("...", tracing=False) sends nothing for
that call, and tracing=True traces one run without turning it on for the agent.
See Tracing for the full picture.
Self-Hosted Deployment
Local Development
Run agents locally:http://localhost:8000.
Production Server
For production, use Gunicorn with uvicorn workers:server.py:
uvicorn Deployment
Run with uvicorn directly:Docker Deployment
Dockerfile
Create aDockerfile:
Build and Run
Docker Compose
Createdocker-compose.yml:
Kubernetes Deployment
Deployment YAML
MCP Server Deployment
Deploy LiteMCP servers:MCP with Gunicorn
MCP as ASGI App
LiteMCP is a full ASGI application:Serverless Deployment
AWS Lambda
Use Mangum for Lambda compatibility:Google Cloud Run
Createapp.yaml:
Environment Configuration
Production Settings
Configure for production (src/agentor/config.py):Required Environment Variables
Health Checks
Agents automatically include health endpoints:Monitoring
Logging
Configure logging levels:Tracing
Enable Celesto tracing (src/agentor/tracer.py):Metrics
Integrate with Prometheus:Load Balancing
Nginx Configuration
Security
API Authentication
Implement authentication middleware:HTTPS/TLS
Use a reverse proxy (Nginx, Caddy) or configure uvicorn with SSL:Performance Tuning
Worker Configuration
Optimal workers = (2 × CPU cores) + 1:Concurrency Control
Limit concurrent requests:Troubleshooting
Common Issues
Port already in use:Debug Mode
Enable detailed logging:Next Steps
Agents
Learn about agent configuration
A2A Protocol
Deploy A2A-compatible agents
MCP Servers
Deploy MCP servers
Celesto AI
Deploy to Celesto platform
