> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy Quick Start

> Deploy an agent as an API server, Docker image, or cloud service in five lines

Add a `deploy:` section to `agents.yaml`, then deploy it with three method calls.

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai_deploy import Deploy

deploy = Deploy.from_yaml("agents.yaml")
result = deploy.deploy()
status = deploy.status()
```

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    Y[📄 agents.yaml] --> L[Deploy.from_yaml]
    L --> R[deploy]
    R --> S[status]

    classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef output fill:#10B981,stroke:#7C90A0,color:#fff

    class Y input
    class L,R process
    class S output
```

## Quick Start

**1. Write agents.yaml**

Add a `deploy:` block alongside your agent definition.

```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
name: Sample Agent
framework: praisonai

agents:
  assistant:
    role: Assistant
    goal: Help users with tasks
    backstory: Experienced assistant ready to help

deploy:
  type: api
  api:
    host: 127.0.0.1
    port: 8005
```

**2. Deploy from Python**

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai_deploy import Deploy

deploy = Deploy.from_yaml("agents.yaml")
result = deploy.deploy()
print(result.url)  # http://127.0.0.1:8005
```

**3. Or deploy from the CLI**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy run --file agents.yaml
```

***

## agents.yaml by Type

Each deployment type reads a matching block under `deploy:`.

> [tab] API
>
> ```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
> deploy:
>   type: api
>   api:
>     host: 127.0.0.1
>     port: 8005
>     workers: 1
>     cors_enabled: true
>     auth_enabled: true
> ```

> [tab] Docker
>
> ```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
> deploy:
>   type: docker
>   docker:
>     image_name: praisonai-app
>     tag: latest
>     base_image: python:3.11-slim
>     expose:
>       - 8005
>     push: false
>   # Optional — configure the generated in-container server.
>   # Omit to keep default auth on.
>   api:
>     host: 0.0.0.0
>     port: 8005
>     auth_enabled: false   # exposes /chat without a token
> ```
>
> > [!TIP]
> >
> > The sibling `api:` block under `type: docker` shipped in PR [#3609](https://github.com/MervinPraison/PraisonAI/pull/3609). Before that, `auth_enabled: false` was silently dropped and the container returned `401` on `/chat`.

> [tab] Cloud (GCP)
>
> ```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
> deploy:
>   type: cloud
>   cloud:
>     provider: gcp
>     region: us-central1
>     service_name: my-agent
>     project_id: your-project-id
>     min_instances: 1
>     max_instances: 10
> ```

***

## Generate a Sample

`generate_sample_yaml` produces a ready-to-edit config for any type.

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai_deploy import generate_sample_yaml, DeployType, CloudProvider

yaml_text = generate_sample_yaml(DeployType.CLOUD, CloudProvider.GCP)
print(yaml_text)
```

***

## Best Practices

> [accordion] Start with type: api
>
> The API type needs no cloud credentials and runs on your machine. Validate the agent locally before moving to Docker or cloud.

> [accordion] Validate before you deploy
>
> Run `praisonai deploy validate --file agents.yaml` to catch schema errors early. It fails fast on:
>
> * A `type: cloud` block without a `cloud:` section.
> * Misspelled field keys (e.g. `clustor_name` vs `cluster_name`) — no more silent defaults.
> * Misspelled section names (e.g. `dockerr:` vs `docker:`), with the allowed-keys list in the error.

> [!TIP]
>
> Need a target that isn't built in? See [Custom cloud providers](https://praison.ai/docs/docs/features/deploy/custom-providers).

***

## Related

> [card] [Config Reference](https://praison.ai/docs/docs/features/deploy/config-reference)
>
> Every field, type, and default

> [card] [Python API](https://praison.ai/docs/docs/features/deploy/python-api)
>
> Deploy class methods and results


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.