Subscribe to a model on AWS Marketplace, deploy it as a SageMaker endpoint, and run inference either with the bioptimus SDK (recommended) or the raw SageMaker runtime API.
1. Subscribe and deploy
Subscribe on AWS Marketplace
Subscribe to the model and copy the Model Package ARN for your region.
Deploy an endpoint
import sagemaker
from sagemaker import ModelPackage
session = sagemaker.Session()
role = "<YOUR_SAGEMAKER_EXECUTION_ROLE_ARN>"
model = ModelPackage(role=role,
model_package_arn="<MODEL_PACKAGE_ARN>",
sagemaker_session=session)
predictor = model.deploy(initial_instance_count=1,
instance_type="ml.g5.xlarge",
endpoint_name="bioptimus-prod")
2. Run inference with the SDK (recommended)
The SDK’s AWS backend routes through the SageMaker /invocations endpoint and adds the model_name dispatch field for you.
from bioptimus.models.backbones import Backbone, Models
model = Backbone(
Models.M_OPTIMUS, # or Models.H1, Models.TISSUE_SEG
backend="aws",
endpoint_name="bioptimus-prod",
region_name="us-east-1",
)
For whole-slide inference (tiling, tissue masking, bulk RNA, output formats), see the SDK guide.
3. Or call the runtime API directly
A SageMaker request is a ModelRequest plus model_name and mode fields. See the API reference for the full schema.
4. Clean up
Endpoints incur charges while running. Delete the endpoint when finished.
predictor.delete_endpoint()