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

# Deploy a Bunker Longevity Model Instance

> Start a Bunker Longevity model instance so it accepts inference requests. Covers the deploy endpoint, instance types, status polling, and stopping instances.

Before you can send prediction requests to a Bunker Longevity model, you deploy an instance. Deploying reserves compute for your account and returns a deployment ID you can poll for readiness.

## Deploy an instance

```http theme={null}
POST /v1/models/{model}/deploy
```

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.bunkerbio.com/v1/models/bunkerfold-3/deploy \
    -H "Authorization: Bearer $BUNKER_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"instance_type": "gpu.a100", "replicas": 1}'
  ```

  ```python Python theme={null}
  import requests, os

  r = requests.post(
      "https://api.bunkerbio.com/v1/models/bunkerfold-3/deploy",
      headers={"Authorization": f"Bearer {os.environ['BUNKER_API_KEY']}"},
      json={"instance_type": "gpu.a100", "replicas": 1},
  )
  print(r.json())
  ```
</CodeGroup>

```json Response theme={null}
{
  "deployment_id": "dep_7f3a2c",
  "model": "bunkerfold-3",
  "status": "provisioning",
  "instance_type": "gpu.a100",
  "replicas": 1
}
```

## Parameters

<ParamField path="instance_type" default="gpu.a100" type="string">
  Instance class. One of `gpu.t4`, `gpu.a10`, `gpu.a100`, `gpu.h100`.
</ParamField>

<ParamField path="replicas" default="1" type="integer">
  Number of replicas to deploy. Traffic is load-balanced across replicas.
</ParamField>

<ParamField path="auto_stop_minutes" default="30" type="integer">
  Automatically stop the instance after this many minutes of inactivity. Set `0` to disable.
</ParamField>

## Check deployment status

```http theme={null}
GET /v1/models/{model}/status
```

Poll status until it reports `ready` before sending prediction requests.

```bash theme={null}
curl https://api.bunkerbio.com/v1/models/bunkerfold-3/status \
  -H "Authorization: Bearer $BUNKER_API_KEY"
```

```json Response theme={null}
{
  "deployment_id": "dep_7f3a2c",
  "status": "ready",
  "replicas_ready": 1,
  "queue_depth": 0
}
```

<ResponseField name="status" type="string">
  Deployment status. One of `provisioning`, `warming`, `ready`, `degraded`, `stopped`.
</ResponseField>

<ResponseField name="queue_depth" type="integer">
  Number of prediction requests currently waiting in the queue.
</ResponseField>

## Stop an instance

Release compute when you are done:

```bash theme={null}
curl -X POST https://api.bunkerbio.com/v1/models/bunkerfold-3/stop \
  -H "Authorization: Bearer $BUNKER_API_KEY"
```

<Note>
  Instances are billed per second while they are in `provisioning`, `warming`, or `ready` states.
</Note>
