Skip to main content
Deploy agents to API servers, Docker containers, or cloud providers using praisonai deploy.

Quick Start

1

Install PraisonAI

pip install praisonai
2

Set API Key

export OPENAI_API_KEY="your-key"
3

Initialize Deploy Config

praisonai deploy init --file agents.yaml --type api
4

Deploy

praisonai deploy run --file agents.yaml

Deploy Types

TypeCommandDescription
API--type apiLocal FastAPI server
Docker--type dockerDocker container
AWS--type cloud --provider awsAWS ECS/Fargate
GCP--type cloud --provider gcpGoogle 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 gcp

praisonai 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 gcp

praisonai deploy validate

Validate agents.yaml deploy configuration.
praisonai deploy validate --file agents.yaml

praisonai deploy plan

Show deployment plan without executing.
praisonai deploy plan --file agents.yaml

praisonai deploy status

Show deployment status.
praisonai deploy status --file agents.yaml
Expected 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 gcp

praisonai deploy destroy

Destroy/delete deployment.
praisonai deploy destroy --file agents.yaml
praisonai deploy destroy --file agents.yaml --yes  # Skip confirmation

CLI Flags

FlagTypeDefaultDescription
--file, -fstringagents.yamlPath to agents.yaml
--typechoice-api, docker, or cloud
--providerchoice-aws, gcp, azure (for cloud type)
--backgroundflagfalseRun in background
--jsonflagfalseOutput as JSON
--yesflagfalseSkip 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: false

Deploy Configuration Options

API Config

FieldTypeDefaultDescription
hoststring127.0.0.1Server host
portint8005Server port
workersint1Worker processes
cors_enabledbooltrueEnable CORS
auth_enabledboolfalseEnable auth
auth_tokenstringnullAuth token
reloadboolfalseAuto-reload (dev)

Docker Config

FieldTypeDefaultDescription
image_namestringpraisonai-appImage name
tagstringlatestImage tag
base_imagestringpython:3.11-slimBase image
exposelist[int][8005]Ports to expose
registrystringnullRegistry URL
pushboolfalsePush to registry

Cloud Config

FieldTypeDefaultDescription
providerenum-aws, gcp, azure
regionstring-Deployment region
service_namestring-Service name
cpustring256CPU allocation
memorystring512Memory (MB)
min_instancesint1Min instances
max_instancesint10Max instances
env_varsdictnullEnvironment 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

MethodDescription
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

IssueFix
No deploy sectionRun praisonai deploy init
Invalid configRun praisonai deploy validate
Missing depsRun praisonai deploy doctor
Deploy failedCheck praisonai deploy status
Port in useChange port in agents.yaml
Missing API keyexport OPENAI_API_KEY="your-key"
Docker not runningStart Docker daemon
AWS credentialsexport AWS_ACCESS_KEY_ID=...
GCP credentialsgcloud auth login