> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bioptimus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Pick your model and platform, then run your first inference.

Three steps: deploy a model, connect the Bioptimus SDK, and run your first inference.

<Note>
  Not sure which model? **M-Optimus-1** predicts spatial gene expression and also produces embeddings; **H-Optimus-1** is the lighter, feature-only model. See [M-Optimus](/documentation/models/m-optimus) and [H-Optimus](/documentation/models/h-optimus).
</Note>

## 1. Deploy your model

Deploy on the platform that fits your use case — each guide has the full steps:

| Platform            | Best for                                | Guide                                                |
| ------------------- | --------------------------------------- | ---------------------------------------------------- |
| **AWS & SageMaker** | Production pipelines and scale          | [Deploy →](/deployment/platforms/aws-sagemaker)      |
| **On-premise**      | Data residency, air-gapped sites        | [Deploy →](/deployment/platforms/on-premise)         |
| **Hugging Face**    | Non-commercial academic, H-Optimus only | [Load weights →](/deployment/platforms/hugging-face) |

We recommend a real-time endpoint on `ml.g5.xlarge` (or the on-premise container) — the models are compiled for that GPU architecture (NVIDIA A10G, CUDA Compute Capability 8.6).

## 2. Connect the Bioptimus SDK

Point the [Bioptimus SDK](/guides/get-started/sdk) at your deployment (use `Models.H1` or `Models.M_OPTIMUS`):

<CodeGroup>
  ```python On-premise theme={null}
  from bioptimus.models.backbones import Backbone
  from bioptimus.models.types import Models

  model = Backbone(Models.M_OPTIMUS, backend="remote", base_url="http://localhost:8080")
  ```

  ```python AWS SageMaker theme={null}
  from bioptimus.models.backbones import Backbone
  from bioptimus.models.types import Models

  model = Backbone(Models.M_OPTIMUS, backend="aws",
                   endpoint_name="m-optimus", region_name="us-east-1")
  ```
</CodeGroup>

<Note>
  **Academic (Hugging Face) users** load H-Optimus-1 directly with `timm` instead of the Bioptimus SDK — see [Hugging Face](/deployment/platforms/hugging-face).
</Note>

## 3. Get your first embedding

Send a single 224×224 tile through the connected model to confirm the full path works:

<CodeGroup>
  ```python H-Optimus theme={null}
  import numpy as np
  from PIL import Image
  from bioptimus.inference.schemas import ModelRequest

  # Replace the blank tile with a real 224×224 H&E tile at 0.5 µm/px.
  tile = Image.fromarray(np.zeros((224, 224, 3), dtype=np.uint8))
  request = ModelRequest(image_data=tile, slide_name="demo",
                         x=0, y=0, width=224, height=224, patch_idx=0)

  response = model.embed(request)
  print(len(response.output))   # 1536
  ```

  ```python M-Optimus theme={null}
  import numpy as np
  from PIL import Image
  from bioptimus.inference.schemas import ModelRequest

  # Replace the blank tile with a real 224×224 H&E tile at 0.5 µm/px.
  tile = Image.fromarray(np.zeros((224, 224, 3), dtype=np.uint8))
  request = ModelRequest(image_data=tile, slide_name="demo",
                         x=0, y=0, width=224, height=224, patch_idx=0)

  response = model.predict(request)   # spatial gene expression for the tile
  print(len(response.output))         # one value per output gene
  ```
</CodeGroup>

For whole-slide inference — tiling, tissue masking, and writing results — see the [Bioptimus SDK](/guides/get-started/sdk).

## Next steps

<CardGroup cols={2}>
  <Card title="Bioptimus SDK" href="/guides/get-started/sdk">
    Whole-slide inference: tiling, tissue masking, bulk RNA, and output formats.
  </Card>

  <Card title="Runnable notebooks" href="https://github.com/bioptimus">
    End-to-end examples: [`h1-jumpstart`](https://github.com/bioptimus/h1-jumpstart) (H-Optimus) and [`m-jumpstart`](https://github.com/bioptimus/m-jumpstart) (M-Optimus).
  </Card>
</CardGroup>
