Skip to main content
Client-agnostic endpoint model. Provides a single EndpointModel that pairs a ModelSpec with any Client implementation (HTTP, AWS SageMaker, GCP, Azure, …). This eliminates the need for per-backend model subclasses.

EndpointModel

Model endpoint backed by a pluggable client. Combines a ModelSpec (what the model expects and produces) with a Client (how to reach it). Supports both synchronous (predict / embed) and asynchronous (predict_async / embed_async) dispatch.
Model specification describing input requirements and output shape.
A configured Client instance (e.g. HTTPClient, AWSClient).
Optional ordered Ensembl IDs expected as bulk RNA input (M-Optimus ).
Optional ordered Ensembl IDs of predicted output genes (M-Optimus).
Example:

model_spec

Model specification including tile and output config.

input_gene_names

Ordered Ensembl IDs expected as bulk RNA input.

output_gene_names

Ordered Ensembl IDs of predicted output genes.

predict

Send a prediction request to the endpoint.
ModelRequest
required
Tile request payload to send.
ModelResponse
Parsed model response with predictions.

embed

Send an embedding request to the endpoint.
ModelRequest
required
Tile request payload to send.
ModelResponse
Parsed model response with embeddings.

predict_async

Send a prediction request asynchronously.
ModelRequest
required
Tile request payload to send.
Any
An ClientSession for connection pooling.
ModelResponse
Parsed model response with predictions.

embed_async

Send an embedding request asynchronously.
ModelRequest
required
Tile request payload to send.
Any
An ClientSession for connection pooling.
ModelResponse
Parsed model response with embeddings.