Skip to main content
The Deploy class runs, inspects, and tears down a deployment from Python.

Quick Start

1

From a YAML file

2

From a config object


Methods

For type: api, deploy() spawns the generated Flask server with sys.executable and passes env=os.environ.copy(), so the child inherits the caller’s interpreter and environment (OPENAI_API_KEY, etc.). No extra wiring is required to reach /chat.

Result Models

Each operation returns a typed model.

DeployResult

DeployStatus

DeployStatus.to_dict() returns a JSON-serialisable dictionary.

Programmatic APIs

The registry — not the CloudProvider enum — is the authority on what is deployable.

DestroyResult


Common Patterns

Read the status as JSON.
Plan before deploying.
Tear down when finished.
For type: api, destroy() finds the process on the API port with netstat -ano on Windows and lsof -ti :<port> on macOS/Linux, then terminates it with taskkill /PID <pid> /F or SIGTERM respectively. A missing discovery binary is treated as “no server running” (success=True); PIDs that can’t be killed leave success=False with the survivors in error=.

Best Practices

DeployResult.url is only set when success is True. Branch on result.success first.
DeployStatus.to_dict() returns plain JSON types, ready to serialise into logs or an HTTP response.
Use from praisonai_deploy import Deploy — the praisonai.deploy path is a compatibility shim only.

Config Reference

DeployConfig and nested config models

CLI Reference

The praisonai deploy command group

Custom Providers

Register your own cloud target