> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/developer/python-sdk/manage-dedicated-deployments.md).

# Manage Dedicated Deployments

[Dedicated Deployments](https://docs.roboflow.com/deploy/dedicated-deployments) are managed GPU machines that run your Roboflow models with predictable latency and high throughput. The SDK manages them through the `roboflow.adapters.deploymentapi` adapter - the high-level `Workspace` class doesn't currently expose deployment methods.

Each function returns a `(status_code, body)` tuple so you can branch on the HTTP result:

```python
from roboflow.adapters import deploymentapi

status, body = deploymentapi.list_deployment("YOUR_API_KEY")
if status == 200:
    for d in body.get("deployments", []):
        print(d["deployment_name"], d["status"])
else:
    print("Failed:", body)
```

## List available machine types

```python
from roboflow.adapters import deploymentapi

status, body = deploymentapi.list_machine_types("YOUR_API_KEY")
for m in body.get("machine_types", []):
    print(m["name"], m.get("description"))
```

## Create a deployment

```python
status, body = deploymentapi.add_deployment(
    api_key="YOUR_API_KEY",
    creator_email="me@company.com",          # must be a workspace member
    machine_type="gpu-small",
    duration=8,                                # hours
    delete_on_expiration=True,
    deployment_name="my-deployment",
    inference_version=None,                    # None → latest
)
```

The deployment provisions asynchronously. Poll `get_deployment` until `status == "ready"`.

## Get deployment details

```python
status, body = deploymentapi.get_deployment("YOUR_API_KEY", "my-deployment")
print(body["status"], body.get("public_url"))
```

## Pause / resume / delete

```python
deploymentapi.pause_deployment("YOUR_API_KEY", "my-deployment")
deploymentapi.resume_deployment("YOUR_API_KEY", "my-deployment")
deploymentapi.delete_deployment("YOUR_API_KEY", "my-deployment")
```

## Logs

```python
import datetime as dt

status, body = deploymentapi.get_deployment_log(
    api_key="YOUR_API_KEY",
    deployment_name="my-deployment",
    from_timestamp=dt.datetime.utcnow() - dt.timedelta(hours=1),
    to_timestamp=dt.datetime.utcnow(),
    max_entries=200,
)
for entry in body.get("logs", []):
    print(entry["timestamp"], entry["message"])
```

## Usage

```python
status, ws_usage = deploymentapi.get_workspace_usage(
    api_key="YOUR_API_KEY",
    from_timestamp=dt.datetime(2026, 4, 1),
    to_timestamp=dt.datetime(2026, 5, 1),
)

status, dep_usage = deploymentapi.get_deployment_usage(
    api_key="YOUR_API_KEY",
    deployment_name="my-deployment",
    from_timestamp=dt.datetime(2026, 4, 1),
    to_timestamp=dt.datetime(2026, 5, 1),
)
```

## Running inference against a dedicated deployment

Once a deployment is ready, point inference SDK calls at its `public_url` (returned by `get_deployment`):

```python
from inference_sdk import InferenceHTTPClient

client = InferenceHTTPClient(api_url=body["public_url"], api_key="YOUR_API_KEY")
result = client.infer("photo.jpg", model_id="my-detector/3")
```

## REST and CLI equivalents

* REST: see [Dedicated Deployments (REST)](/developer/rest-api/dedicated-deployments.md).
* CLI: see [Manage Deployments (CLI)](/developer/command-line-interface/manage-deployments.md).
