Skip to main content
AWS SageMaker client. Sends JSON payloads to a SageMaker endpoint via the sagemaker-runtime invoke_endpoint API. The model_name field is injected into every request body for multi-model dispatch.

AWSClient

Sends JSON payloads to an AWS SageMaker endpoint.
Name of the SageMaker endpoint.
Model identifier injected into the request body for SageMaker multi-model dispatch.
AWS region. When None, uses the default from the environment or boto_session.
Optional pre-configured Session (e.g. with explicit credentials or a custom profile). When None, a default session is created using the standard credential chain.
Read timeout in seconds.
Example:

predict

Invoke the SageMaker endpoint for prediction.
str
required
Serialized JSON request payload.
str
Response body as a JSON string.

embed

Invoke the SageMaker endpoint for embedding.
str
required
Serialized JSON request payload.
str
Response body as a JSON string.

metadata

Fetch model metadata via /invocations. Sends a minimal request with mode set to "metadata" so the server returns model metadata instead of running inference.
str
Response body as a JSON string.

predict_async

Predict asynchronously via run_in_executor. boto3 is not natively async, so the synchronous predict call is delegated to a thread pool.
str
required
Serialized JSON payload.
Any
Unused. Accepted for interface compatibility with the Client protocol.
str
Response body as a string.

embed_async

Embed asynchronously via run_in_executor.
str
required
Serialized JSON payload.
Any
Unused. Accepted for interface compatibility.
str
Response body as a string.