Deployment¶
PyFlue is a Python package, so deployment is centered on Python runtimes, containers, and CI jobs.
The closest PyFlue equivalent to a JavaScript server target is the Docker and
FastAPI target. In a workspace, runtime builds write a dist/ directory with
server.py, manifest.json, provider config, and any container files needed
by the selected platform.
Supported Targets¶
| Target | Status | Command | Notes |
|---|---|---|---|
| New Build System | |||
| Uvicorn | Implemented | pyflue build --target uvicorn |
FastAPI server with SSE/webhook support. |
| Lambda | Implemented | pyflue build --target lambda |
AWS Lambda with Mangum adapter. |
| Cloud Run | Implemented | pyflue build --target cloudrun |
Google Cloud Run with gunicorn. |
| Docker | Implemented | pyflue build --target docker |
General Python container. |
| CI/CD | |||
| GitHub Actions | Implemented | pyflue build --target github-actions |
Generates .github/workflows/pyflue-agent.yml. |
| GitLab CI/CD | Implemented | pyflue build --target gitlab-ci |
Generates .gitlab-ci.yml. |
| Platforms | |||
| Railway | Implemented | pyflue build --target railway |
Generates Docker/FastAPI artifacts and railway.json. |
| Render | Implemented | pyflue build --target render |
Generates Docker/FastAPI artifacts and render.yaml. |
| Fly.io | Implemented | pyflue build --target fly |
Generates Docker/FastAPI artifacts and fly.toml. |
| Vercel | Implemented | pyflue build --target vercel |
Generates Python app artifacts and vercel.json. |
| Netlify | Implemented | pyflue build --target netlify |
Generates Python app artifacts and netlify.toml. |
| Cloudflare Containers | Beta | pyflue build --target cloudflare |
Generates Docker/FastAPI artifacts, worker.ts, wrangler.jsonc, and package.json. |
Uvicorn/FastAPI¶
Generate a FastAPI server with built-in development support:
This writes:
Run the server:
The server exposes:
- GET /health - Health check
- GET /agents - List available agents
- POST /agents/{name}/{agent_id} - Run an agent
AWS Lambda¶
Generate an AWS Lambda handler with Mangum adapter:
This writes:
Deploy to Lambda using the AWS CLI or SAM. The handler is handler.
Google Cloud Run¶
Generate a Cloud Run optimized container:
This writes:
Deploy using:
Docker/FastAPI¶
Generate the default Python web artifacts:
This writes:
The generated server exposes the PyFlue server:
curl http://localhost:8000/prompt/default \
-H "Content-Type: application/json" \
-d '{"payload": {"prompt": "Review this project"}}'
File-based agents are exposed under /agents/{name}/{agent_id}.
GitHub Actions¶
Generate a workflow:
This writes:
The workflow is manual by default. Add provider keys as repository secrets, then run it from the GitHub Actions tab.
GitLab CI/CD¶
Generate a pipeline file:
This writes:
The generated job is designed for manual web pipelines. Add provider keys as masked CI/CD variables.
Railway¶
Generate Railway files:
This writes:
Deploy the project with Railway's GitHub integration or CLI.
When the Railway CLI is installed and authenticated, PyFlue runs
railway up.
Render¶
Generate Render files:
This writes:
Create a new Blueprint in Render and point it at the repository.
Fly.io¶
Generate Fly.io files:
This writes:
Review the generated app name and region before deploying with fly deploy.
When the Fly.io CLI is installed and authenticated, PyFlue runs fly deploy.
Cloudflare Containers¶
Generate Cloudflare Containers files:
This target generates:
dist/server.py
dist/Dockerfile
dist/requirements.txt
dist/worker.ts
dist/wrangler.jsonc
dist/package.json
dist/manifest.json
Cloudflare Containers are currently a beta Workers feature and require a
Workers Paid plan. wrangler deploy builds and pushes the Docker image, so
Docker must be running locally during deployment.
Deploy with Wrangler:
Vercel¶
Generate Vercel files:
This writes:
Review the generated route config before deploying.
When the Vercel CLI is installed and authenticated, PyFlue runs
vercel deploy.
Netlify¶
Generate Netlify files:
This writes:
dist/server.py
dist/requirements.txt
dist/netlify.toml
dist/netlify/functions/pyflue.py
dist/manifest.json
Review the generated function settings before deploying.
When the Netlify CLI is installed and authenticated, PyFlue runs
netlify deploy.