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 theCloudProvider enum — is the authority on what is deployable.
DestroyResult
Common Patterns
Read the status as JSON.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
Check success before reading url
Check success before reading url
DeployResult.url is only set when success is True. Branch on result.success first.Use to_dict() for logs and APIs
Use to_dict() for logs and APIs
DeployStatus.to_dict() returns plain JSON types, ready to serialise into logs or an HTTP response.Import from praisonai_deploy
Import from praisonai_deploy
Use
from praisonai_deploy import Deploy — the praisonai.deploy path is a compatibility shim only.Related
Config Reference
DeployConfig and nested config models
CLI Reference
The praisonai deploy command group
Custom Providers
Register your own cloud target

