Deploy Quick Start
Deploy an agent as an API server, Docker image, or cloud service in five lines
Add a deploy: section to agents.yaml, then deploy it with three method calls.
from praisonai_deploy import Deploy
deploy = Deploy.from_yaml("agents.yaml")
result = deploy.deploy()
status = deploy.status()Quick Start
- Write agents.yaml
Add a
deploy:block alongside your agent definition.yaml name: Sample Agent framework: praisonai agents: assistant: role: Assistant goal: Help users with tasks backstory: Experienced assistant ready to help deploy: type: api api: host: 127.0.0.1 port: 8005 - Deploy from Python
python from praisonai_deploy import Deploy deploy = Deploy.from_yaml("agents.yaml") result = deploy.deploy() print(result.url) # http://127.0.0.1:8005 - Or deploy from the CLI
bash praisonai deploy run --file agents.yaml
agents.yaml by Type
Each deployment type reads a matching block under deploy:.
API
deploy:
type: api
api:
host: 127.0.0.1
port: 8005
workers: 1
cors_enabled: true
auth_enabled: trueDocker
deploy:
type: docker
docker:
image_name: praisonai-app
tag: latest
base_image: python:3.11-slim
expose:
- 8005
push: false
# Optional — configure the generated in-container server.
# Omit to keep default auth on.
api:
host: 0.0.0.0
port: 8005
auth_enabled: false # exposes /chat without a tokenCloud (GCP)
deploy:
type: cloud
cloud:
provider: gcp
region: us-central1
service_name: my-agent
project_id: your-project-id
min_instances: 1
max_instances: 10Generate a Sample
generate_sample_yaml produces a ready-to-edit config for any type.
from praisonai_deploy import generate_sample_yaml, DeployType, CloudProvider
yaml_text = generate_sample_yaml(DeployType.CLOUD, CloudProvider.GCP)
print(yaml_text)Best Practices
Start with type: api
The API type needs no cloud credentials and runs on your machine. Validate the agent locally before moving to Docker or cloud.
Validate before you deploy
Run praisonai deploy validate --file agents.yaml to catch schema errors early. It fails fast on:
- A
type: cloudblock without acloud:section. - Misspelled field keys (e.g.
clustor_namevscluster_name) — no more silent defaults. - Misspelled section names (e.g.
dockerr:vsdocker:), with the allowed-keys list in the error.