ModelRequest / ModelResponse schema is used everywhere; what differs is how you reach it:
- On-premise — path-based endpoints (
/api/embed/h1,/api/predict/m-optimus, …) on the container (default port 8080). Interactive Swagger UI is served at/docs, and the live schema at/openapi.json. - AWS SageMaker — a single
/invocationsendpoint that accepts aSageMakerRequest(aModelRequestplusmodel_nameandmodefor dispatch). - SDK — the Bioptimus SDK wraps both and is the recommended interface for whole-slide inference.
Authentication
The Model Server REST API requires no authentication. Deploy it on a private network and restrict access at the network layer. On AWS, the SageMaker endpoint is protected by IAM (requests are SigV4-signed); on Hugging Face, model access is gated.Errors
All endpoints return JSON. Common statuses:
A
422 body follows the FastAPI shape: {"detail": [{"loc": [...], "msg": "...", "type": "..."}]}.
