# Install the Standard Model

Two ways to get the open-weight JEPA model for longitudinal EHR running on your machine. Pick the quickstart for an end-to-end demo, or pull weights directly from Hugging Face.

There is no hosted API — the models are open weights you download and run on your own hardware.

| Requirement | Value |
|---|---|
| Python | 3.11+ |
| VRAM | 2 – 16 GB |
| Weights | ~3.7 GB |
| Wall time | ~60 s |

## Quickstart (recommended)

Installs uv, clones the [quickstart repo](https://github.com/standardmodelbio/quickstart), syncs dependencies, and runs the MIMIC-IV demo on 100 patients.

```
curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/standardmodelbio/quickstart.git
cd quickstart && uv sync
uv run python demo.py
```

- Installs uv if missing
- Clones the quickstart repo
- Pulls smb-v1-1.7b from Hugging Face
- Runs the 4-task linear probe demo

Prefer conda or pip? See `pyproject.toml` in the [quickstart repo](https://github.com/standardmodelbio/quickstart).

## Hugging Face (bring your own stack)

Load the model directly with transformers. No demo, no opinions about your environment.

```
# pip install transformers torch
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained(
    "standardmodelbio/smb-v1-1.7b",
    trust_remote_code=True,
    device_map="auto",
)
```

- All 5 SMB-v1 variants live on the same [org page](https://huggingface.co/standardmodelbio)
- Bring your own MEDS pipeline and serialization
- Works with conda, pip, poetry, anything

## What the quickstart does

The quickstart embeds 100 MIMIC-IV demo patients and reports linear-probe scores for four canonical clinical tasks:

1. **MEDS events** — 916k timestamped clinical events across 100 patients
2. **Serialize** — `smb_utils` converts events into causal token streams
3. **Embed** — smb-v1 encodes each patient into a 2048-dim vector
4. **Predict** — linear probes trained on four clinical outcomes

See the [end-to-end example](https://standardmodel.bio/example.html) for the full worked run.

## Verifying the install

A sanity check that CUDA is visible and the weights load.

```
uv run python -c "
import torch
from transformers import AutoModelForCausalLM

print(f'PyTorch: {torch.__version__}')
print(f'CUDA:    {torch.cuda.is_available()}')

model = AutoModelForCausalLM.from_pretrained(
    'standardmodelbio/smb-v1-1.7b',
    trust_remote_code=True,
    device_map='auto',
)
print('Model loaded.')
"
```

## Memory and quantization

Match the precision to your hardware. 8-bit and 4-bit require `bitsandbytes`.

| Precision | VRAM | GPU | Code |
|---|---|---|---|
| float32 | 16 GB | A100 | default |
| float16 | 8 GB | RTX 4090 | `torch_dtype=torch.float16` |
| 8-bit | 4 GB | T4 | `load_in_8bit=True` |
| 4-bit | 2 GB | RTX 3060 | `load_in_4bit=True` |

## Troubleshooting

- **CUDA not detected** — run `nvidia-smi`; update NVIDIA drivers if needed.
- **Out of memory** — use float16 or quantization from the table above.
- **Access denied** — run `huggingface-cli login` with a valid token.
- **Slow download** — weights are ~3.7 GB; ensure a stable connection.

## Next steps

- [End-to-end example](https://standardmodel.bio/example.html) — full worked run, from raw data to linear-probe evaluation
- [Use it on your data](https://standardmodel.bio/your-data.html) — MEDS schema, serialization, and swapping in your own pipeline
- [Model hub](https://standardmodel.bio/model-hub.html) — the model collection
- Integration questions: info@standardmodel.bio

© 2026 Standard Model Biomedicine · San Francisco, CA
