Skip to main content
Client protocol for model endpoint communication. Defines the 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

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

Sends a prediction request synchronously.

embed

Sends an embedding request synchronously.

predict_with_embedding

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

Fetches model metadata synchronously.

predict_async

Sends a prediction request asynchronously.

embed_async

Sends an embedding request asynchronously.

predict_with_embedding_async

Send a combined prediction+embedding request asynchronously.