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

# bioptimus.models.clients

Client protocol for model endpoint communication.

Defines the [`Client`](/sdk-reference/models/clients#client) protocol that all client backends (HTTP, AWS SageMaker, GCP Vertex AI, Azure ML, …) must satisfy. Each client encapsulates connection details and knows how to send a JSON request body and return the JSON response body.

## Client

```python theme={null}
@runtime_checkable
class Client(Protocol)
```

Protocol for model endpoint communication.

Implementations are fully configured at construction time (URL, endpoint name, credentials, etc.) so that `predict` / `embed` only need the serialized body.

***

#### predict

```python theme={null}
def predict(body: str) -> str
```

Sends a prediction request synchronously.

***

#### embed

```python theme={null}
def embed(body: str) -> str
```

Sends an embedding request synchronously.

***

#### predict\_with\_embedding

```python theme={null}
def predict_with_embedding(body: str) -> str
```

Send a combined prediction+embedding request synchronously.

Returns both the prediction and the embedding from a single forward pass. Backends that cannot produce both (e.g. embedding-only models) may raise `NotImplementedError`.

***

#### metadata

```python theme={null}
def metadata() -> str
```

Fetches model metadata synchronously.

***

#### predict\_async

```python theme={null}
async def predict_async(body: str, session: Any = None) -> str
```

Sends a prediction request asynchronously.

***

#### embed\_async

```python theme={null}
async def embed_async(body: str, session: Any = None) -> str
```

Sends an embedding request asynchronously.

***

#### predict\_with\_embedding\_async

```python theme={null}
async def predict_with_embedding_async(body: str, session: Any = None) -> str
```

Send a combined prediction+embedding request asynchronously.
