Deploy Config Reference

Every DeployConfig field, type, and default from praisonai-deploy

DeployConfig and its nested models define exactly what a deployment does.

python
from praisonai_deploy import DeployConfig, DeployType

config = DeployConfig(type=DeployType.API)
Diagram

DeployConfig

APIConfig

DockerConfig

CloudConfig

AgentConfig list

Quick Start

  1. API config
    python
    from praisonai_deploy import DeployConfig, DeployType
    
    config = DeployConfig(type=DeployType.API)  # APIConfig() defaults filled in
  2. Cloud config
    python
    from praisonai_deploy import DeployConfig, DeployType
    from praisonai_deploy import CloudProvider
    from praisonai_deploy.models import CloudConfig
    
    config = DeployConfig(
        type=DeployType.CLOUD,
        cloud=CloudConfig(
            provider=CloudProvider.GCP,
            region="us-central1",
            service_name="my-agent",
        ),
    )

DeployConfig

FieldTypeDefaultDescription
typeDeployType(required)Deployment type
apiOptional[APIConfig]auto when type="api"; optional on type="docker"API server config. On docker, configures the generated in-container server. Ignored on cloud.
dockerOptional[DockerConfig]auto when type="docker"Docker config
cloudOptional[CloudConfig]required when type="cloud"Cloud config
agentsOptional[List[AgentConfig]]NoneAgent configurations

Validation rules:

  • type="cloud" requires a cloud: section, otherwise raises ValueError("cloud config required for cloud deployment type").
  • type="api" fills in APIConfig() defaults when omitted.
  • type="docker" fills in DockerConfig() defaults when omitted.

Enums

DeployType

ValueMeaning
"api"Local / hosted Flask API server
"docker"Build (and optionally push) a Docker image
"cloud"Deploy to AWS ECS / Azure Container Apps / GCP Cloud Run

CloudProvider

"aws" · "azure" · "gcp" · "fly" · "railway" · "render"

CloudProviderLike

CloudProviderLike = Union[CloudProvider, str]

The accepted type for provider. Built-ins keep their enum identity on the way out (config.provider is CloudProvider.AWS); plugin providers come back as normalised lowercase strings.

ServiceState

running · stopped · pending · failed · not_found · unknown


APIConfig

FieldTypeDefaultDescription
hoststr"127.0.0.1"Server host
portint8005Server port
workersint1Number of worker processes
cors_enabledboolTrueEnable CORS
auth_enabledboolTrueEnable authentication
auth_tokenOptional[str]NoneAuthentication token
reloadboolFalseEnable auto-reload for development

DockerConfig

FieldTypeDefaultDescription
image_namestr"praisonai-app"Docker image name
tagstr"latest"Docker image tag
base_imagestr"python:3.11-slim"Base Docker image
exposeList[int][8005]Ports to expose
registryOptional[str]NoneDocker registry URL
pushboolFalsePush image to registry after build
build_argsOptional[Dict[str, str]]NoneDocker build arguments

Sibling api: block (Docker only)

type: docker accepts an optional sibling api: block that configures the API server the container will run. Fields are the same as APIConfig above.

FieldEffect inside the container
host / portBind the generated Flask server
cors_enabledEnable CORS
auth_enabled: falseInjects PRAISONAI_API_AUTH=disabled into the container so /chat is reachable without a bearer token
auth_tokenSets the accepted bearer token

Omitting the block runs the container with the same defaults as type: api — auth on, CORS on, port 8005.

yaml
deploy:
  type: docker
  docker:
    image_name: my-agent
    expose: [8005]
  api:
    host: 0.0.0.0
    port: 8005
    auth_enabled: false   # exposes /chat without a token

Generated Gunicorn CMD

type: docker generates a Dockerfile whose CMD starts Gunicorn with fixed worker-timeout values tuned for agent LLM workloads.

dockerfile
CMD ["gunicorn", "-b", "0.0.0.0:{port}", "-w", "1", \
     "--timeout", "120", "--graceful-timeout", "30", "api_server:app"]
FlagValueWhy
--timeout120 secondsCold import + first model round-trip routinely exceed Gunicorn’s 30 s default; keeps the worker alive for the first /chat.
--graceful-timeout30 secondsTime workers get to finish in-flight requests during a restart before being force-killed.
-w (workers)1Existing default — one worker per container, scale horizontally instead.

CloudConfig

FieldTypeDefaultDescription
provider`CloudProvider \str`(required)Cloud provider. A built-in resolves to a CloudProvider member; a plugin provider is accepted as a plain string.
regionstr(required)Deployment region
service_namestr(required)Service/application name
imageOptional[str]NoneContainer image URL
cpuOptional[str]"256"CPU allocation
memoryOptional[str]"512"Memory allocation (MB)
min_instancesint1Minimum instances
max_instancesint10Maximum instances
env_varsOptional[Dict[str, str]]NoneEnvironment variables
cluster_nameOptional[str]NoneECS cluster name (AWS)
task_definitionOptional[str]NoneTask definition (AWS)
resource_groupOptional[str]NoneResource group (Azure). Type is optional at the dataclass level, but the Azure provider requires it at deploy/status/destroy time — the call returns a failure result if unset.
subscription_idOptional[str]NoneSubscription ID (Azure). Type is optional at the dataclass level, but the Azure provider requires it at deploy/status/destroy time — the call returns a failure result if unset. Threaded onto every az command via --subscription.
project_idOptional[str]NoneProject ID (GCP). Type is optional at the dataclass level, but the GCP provider requires it at deploy/status/destroy time — the call returns a failure result if unset.

AgentConfig

FieldTypeDefaultDescription
namestr(required)Agent name/identifier
entrypointstr(required)Agent entrypoint file (e.g. agents.yaml)
envDict[str, str]{}Environment variables
secretsDict[str, str]{}Secret references
portsOptional[List[int]]NonePorts to expose
resourcesOptional[Dict[str, str]]NoneResource requirements

Best Practices

Let defaults fill themselves in

For type="api" and type="docker", omit the nested block to accept sensible defaults. Only add fields you need to change.

Always set cloud fields explicitly

provider, region, and service_name are required for cloud deployments and have no defaults.

Quote cpu and memory values

cpu and memory are strings ("256", "512"), not integers — quote them in YAML.


Related