Recipe Serve - Python Usage
This guide covers how to configure and manage the recipe server programmatically.Starting the Server Programmatically
Basic Server Start
With Configuration
Creating ASGI App for Custom Deployment
Configuration File Format
serve.yaml
Using agents.yaml (Unified Config)
You can include serve configuration in your existingagents.yaml:
Authentication Middleware
API Key Authentication
Custom Authentication
Route Handlers
Available Routes
| Route | Method | Description |
|---|---|---|
/health | GET | Health check |
/v1/recipes | GET | List recipes |
/v1/recipes/{name} | GET | Describe recipe |
/v1/recipes/{name}/schema | GET | Get recipe schema |
/v1/recipes/run | POST | Run recipe (sync) |
/v1/recipes/stream | POST | Run recipe (SSE) |
/v1/recipes/validate | POST | Validate recipe |
Custom Route Example
Docker Deployment
Dockerfile
docker-compose.yaml
Kubernetes Deployment
deployment.yaml
Testing the Server
Unit Test Example
Best Practices
1. Always Use Auth in Production
2. Preload Recipes for Faster First Request
3. Use Health Checks
4. Configure CORS for Web Clients
Next Steps
- See CLI Usage for command-line options
- Review Integration Models
- Explore Endpoints Code for client usage

