Deploy CLI
Deploy agents using praisonai deploy command
Deploy agents to API servers, Docker containers, or cloud providers using praisonai deploy.
Quick Start
- Install PraisonAI
bash pip install praisonai - Set API Key
bash export OPENAI_API_KEY="your-key" - Initialize Deploy Config
bash praisonai deploy init --file agents.yaml --type api - Deploy
bash praisonai deploy run --file agents.yaml
Deploy Types
| Type | Command | Description |
|---|---|---|
| API | --type api | Local FastAPI server |
| Docker | --type docker | Docker container |
| AWS | --type cloud --provider aws | AWS ECS/Fargate |
| GCP | --type cloud --provider gcp | Google Cloud Run |
CLI Commands
praisonai deploy run
Execute deployment.
praisonai deploy run --file agents.yaml --type api
praisonai deploy run --file agents.yaml --type docker
praisonai deploy run --file agents.yaml --type cloud --provider aws
praisonai deploy run --file agents.yaml --type cloud --provider gcppraisonai deploy init
Generate sample agents.yaml with deploy configuration.
praisonai deploy init --file agents.yaml --type api
praisonai deploy init --file agents.yaml --type docker
praisonai deploy init --file agents.yaml --type cloud --provider aws
praisonai deploy init --file agents.yaml --type cloud --provider gcppraisonai deploy validate
Validate agents.yaml deploy configuration.
praisonai deploy validate --file agents.yamlpraisonai deploy plan
Show deployment plan without executing.
praisonai deploy plan --file agents.yamlpraisonai deploy status
Show deployment status.
praisonai deploy status --file agents.yamlExpected Output:
๐ Checking deployment status...
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Deployment Status โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Property โ Value โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ State โ RUNNING โ
โ Service Name โ praisonai-api โ
โ Provider โ api โ
โ URL โ http://127.0.0.1:8005 โ
โ Healthy โ โ
Yes โ
โ Instances โ 1/1 โ
โฐโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏpraisonai deploy doctor
Check deployment readiness.
praisonai deploy doctor
praisonai deploy doctor --provider aws
praisonai deploy doctor --provider gcppraisonai deploy destroy
Destroy/delete deployment.
praisonai deploy destroy --file agents.yaml
praisonai deploy destroy --file agents.yaml --yes # Skip confirmationCLI Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--file, -f | string | agents.yaml | Path to agents.yaml |
--type | choice | – | api, docker, or cloud |
--provider | choice | – | aws, gcp, azure (for cloud type) |
--background | flag | false | Run in background |
--json | flag | false | Output as JSON |
--yes | flag | false | Skip confirmation prompts |
agents.yaml Deploy Section
Add a deploy section to your agents.yaml:
framework: praisonai
topic: helpful assistant
roles:
assistant:
role: Assistant
goal: Help users
backstory: You are helpful
tasks:
help_task:
description: Answer questions
expected_output: Helpful response
deploy:
type: api
api:
host: "127.0.0.1"
port: 8005
workers: 1
cors_enabled: true
auth_enabled: false
reload: falseDeploy Configuration Options
API Config
| Field | Type | Default | Description |
|---|---|---|---|
host | string | 127.0.0.1 | Server host |
port | int | 8005 | Server port |
workers | int | 1 | Worker processes |
cors_enabled | bool | true | Enable CORS |
auth_enabled | bool | false | Enable auth |
auth_token | string | null | Auth token |
reload | bool | false | Auto-reload (dev) |
Docker Config
| Field | Type | Default | Description |
|---|---|---|---|
image_name | string | praisonai-app | Image name |
tag | string | latest | Image tag |
base_image | string | python:3.11-slim | Base image |
expose | list[int] | [8005] | Ports to expose |
registry | string | null | Registry URL |
push | bool | false | Push to registry |
Cloud Config
| Field | Type | Default | Description |
|---|---|---|---|
provider | enum | – | aws, gcp, azure |
region | string | – | Deployment region |
service_name | string | – | Service name |
cpu | string | 256 | CPU allocation |
memory | string | 512 | Memory (MB) |
min_instances | int | 1 | Min instances |
max_instances | int | 10 | Max instances |
env_vars | dict | null | Environment vars |
SDK Deploy Class
Deploy programmatically using Python:
from praisonai.deploy import Deploy, DeployConfig, DeployType
from praisonai.deploy.models import APIConfig
config = DeployConfig(
type=DeployType.API,
api=APIConfig(host="127.0.0.1", port=8005, workers=1)
)
deploy = Deploy(config, "agents.yaml")
result = deploy.deploy()
print(f"URL: {result.url}")Deploy Methods
| Method | Description |
|---|---|
deploy(background=False) | Execute deployment |
plan() | Generate deployment plan without executing |
status() | Get current deployment status |
doctor() | Run health checks |
destroy(force=False) | Destroy/delete deployment |
Troubleshooting
| Issue | Fix |
|---|---|
| No deploy section | Run praisonai deploy init |
| Invalid config | Run praisonai deploy validate |
| Missing deps | Run praisonai deploy doctor |
| Deploy failed | Check praisonai deploy status |
| Port in use | Change port in agents.yaml |
| Missing API key | export OPENAI_API_KEY="your-key" |
| Docker not running | Start Docker daemon |
| AWS credentials | export AWS_ACCESS_KEY_ID=... |
| GCP credentials | gcloud auth login |
Related
- API Deploy – Deploy as local API server
- Docker Deploy – Deploy to Docker
- AWS Deploy – Deploy to AWS ECS/Fargate
- GCP Deploy – Deploy to Google Cloud Run