# cloudera-ai-inference

Python client for [Cloudera AI Inference service](https://docs.cloudera.com/machine-learning/cloud/ai-inference/topics/ml-caii-use-caii.html).

## Installation

```
pip install cloudera-ai-inference
```

## Quick Start

```python
from cloudera.ai.inference import create_client, ServingListEndpointsRequest

client = create_client(
    host="https://<your-inference-service-domain>",
    token="<CDP_TOKEN>",
)

# List endpoints
response = client.serving_list_endpoints(
    ServingListEndpointsRequest(namespace="serving-default")
)
for ep in response.endpoints:
    print(ep.name, ep.state)
```

## Authentication

Generate a CDP workload auth token:

```bash
CDP_TOKEN=$(cdp iam generate-workload-auth-token --workload-name DE | jq -r '.token')
```

Then pass it to `create_client`:

```python
client = create_client(host="https://...", token=CDP_TOKEN)
```

## SSL

To disable SSL verification (development/self-signed certs only):

```python
client = create_client(host="https://...", token="...", verify_ssl=False)
```

## API Reference

Full API documentation: https://docs.cloudera.com/machine-learning/cloud/ai-inference/topics/ml-caii-use-caii.html
