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

# Models Overview

> Scientific AI models available in Relay.

# Models

Relay ships with prebuilt scientific models and lets you add any model from a GitHub repository.

## Add a model from GitHub

Any public GitHub repository containing a model can be added to Relay. On the **Models** tab, click the **GitHub** button, paste the repository URL, and Relay will build and configure it automatically. This lets you bring your own models — or any model you find on GitHub — without writing adapter code.

## Prebuilt models

These models come ready to use out of the box:

<CardGroup cols={3}>
  <Card title="SAM3" icon="scissors" href="/models/sam">
    Segment Anything Model 3 — universal segmentation with point, box, and text prompts.
  </Card>

  <Card title="Cellpose" icon="circle-nodes" href="/models/cellpose">
    GPU-accelerated cell and nuclei segmentation with automatic diameter detection.
  </Card>

  <Card title="DeepLabCut" icon="paw" href="/models/deeplabcut">
    Markerless pose estimation for animal tracking in videos.
  </Card>

  <Card title="Suite2p" icon="brain" href="/models/suite2p">
    Calcium imaging — motion correction, ROI detection, spike deconvolution.
  </Card>

  <Card title="SpikeInterface" icon="bolt" href="/models/spikeinterface">
    Spike sorting with 7 sorter backends including Kilosort4.
  </Card>

  <Card title="PlantCV" icon="leaf" href="/models/plantcv">
    Automated plant phenotyping — morphology, shape, and color analysis.
  </Card>

  <Card title="SExtractor" icon="star" href="/models/sextractor">
    Astronomical source extraction — detect stars, galaxies, and measure fluxes.
  </Card>
</CardGroup>

## How models run

Models execute through a two-tier adapter pattern:

1. **Model Adapters** define *what* a model does — parameter validation, input preprocessing, output parsing
2. **Provider Adapters** define *where/how* to execute — cloud GPU, local Docker, HPC cluster, etc.

### Execution flow

```
Your file → Job created in database
         → ModelAdapter.processInput() preprocesses the file
         → ProviderAdapter.execute() runs the model
         → ModelAdapter.parseOutput() parses results
         → Artifacts stored to S3 + database
         → Results displayed in your viewer
```

## Running a model

There are several ways to run a model:

1. **AI Agent** — describe what you want in natural language (e.g., *"segment all cells"*)
2. **Suggested actions** — when you drop a file, Relay suggests compatible models
3. **Model panel** — open the models panel, select a model, configure parameters, and run
4. **Pipeline builder** — add model steps to a multi-step pipeline
5. **GitHub import** — paste a GitHub URL on the Models tab to add and run any model

## Job management

Each model run creates a job that you can track:

* **Status** — queued, running, completed, failed, cancelled
* **Progress** — real-time progress updates and log streaming
* **Artifacts** — output files (masks, tracks, statistics) are stored and downloadable
* **Cost** — estimated compute cost displayed before execution

### Job limits (per user)

| Limit                | Default      |
| -------------------- | ------------ |
| Concurrent jobs      | 2            |
| Queued jobs          | 5            |
| Max input size       | 500 MB       |
| Max job runtime      | 3600 seconds |
| Daily compute cost   | \$5/day      |
| Monthly compute cost | \$25/month   |
