Model reference · open weights

CheXagent-2-srrg-impression

LLMs StanfordAIMI Image→text 1 build Open weights 1k dl/mo

CheXagent-2-srrg-impression is an open-weight language model from StanfordAIMI. CheXagent-2-3b-srrg-impression (FP32) weighs 6.3 GB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • CheXagent-2-srrg-impression is a 3.1B parameter image-to-text model developed by StanfordAIMI for generating structured radiology report impressions from chest X-ray images.
  • The model operates in English and is distributed under the MIT license.
  • It requires specific dependencies including torch 2.2.1 and transformers 4.39.0, and utilizes a custom tokenizer to process multimodal inputs for clinical text generation.

Summary of the StanfordAIMI/CheXagent-2-3b-srrg-impression model card, 2026-10-01

What it is

Released byStanfordAIMI
Released2024-08-12
Parameters3.1B
VRAM6.3 GB for the weights

What it runs on

Memory and cards for CheXagent-2-3b-srrg-impression (FP32)

6.3 GBweights, file size
762 MBruntime overhead, at least

How much memory each request adds isn't estimated yet for this architecture. The weights need at least the cards below, plus room for the context.

CardWeights alone
RTX 3060 12 GBfits
RTX 4060 Ti 16 GBfits
RTX 3090 24 GBfits
RTX 4090 24 GBfits
RTX 5090 32 GBfits
L40S 48 GBfits
A100 80 GBfits
H100 80 GBfits
RTX PRO 6000 Blackwell 96 GBfits
DGX Spark (GB10) 128 GB unifiedfits
H200 141 GBfits
B200 180 GBfits

From the model card

What StanfordAIMI says about CheXagent-2-srrg-impression

Read the model card

Requirements:

pip install opencv-python
pip install albumentations
pip install accelerate
torch==2.2.1
transformers==4.39.0 # may work with more recent version

Adapted sample script for SRRG

import io
import requests
import torch
from PIL import Image
from transformers import AutoModelForCausalLM, AutoTokenizer
import tempfile

# step 1: Setup constants
model_name = "StanfordAIMI/CheXagent-2-3b-srrg-impression"
dtype = torch.bfloat16
device = "cuda"

# step 2: Load Processor and Model
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", trust_remote_code=True)
model = model.to(dtype)
model.eval()

# step 3: Download image from URL, save to a local file, and prepare path list
url = "https://huggingface.co/IAMJB/interpret-cxr-impression-baseline/resolve/main/effusions-bibasal.jpg"
resp = requests.get(url)
resp.raise_for_status()

# Use a NamedTemporaryFile so it lives on disk
with tempfile.NamedTemporaryFile(delete=False, suffix=".jpg") as tmpfile:
    tmpfile.write(resp.content)
    local_path = tmpfile.name  # this is a real file path on disk

paths = [local_path]

prompt = "Structured Radiology Report Generation for Impression Section"
# build the multimodal input
query = tokenizer.from_list_format(
    [*([{"image": img} for img in paths]), {"text": prompt}]
)

# format as a chat conversation
conv = [
    {"from": "system", "value": "You are a helpful assistant."},
    {"from": "human", "value": query},
]

# tokenize and generate
input_ids = tokenizer.apply_chat_template(
    conv, add_generation_prompt=True, return_tensors="pt"
)
output = model.generate(
    input_ids.to(device),
    do_sample=False,
    num_beams=1,
    temperature=1.0,
    top_p=1.0,
    use_cache=True,
    max_new_tokens=512,
)[0]

# decode the “impression” text
response = tokenizer.decode(output[input_ids.size(1) : -1])
print(response)

Response:

1. Interval increase in bilateral pleural effusions.
2. Interval increase in bibasilar opacities, which may represent atelectasis or consolidation.
3. Stable position of the right upper extremity peripherally inserted central catheter (PICC line).

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

How it works

How language models work

Your prompttext / messagesTransformerattention over tokensNext-token loopgenerate + streamResponsetext · tool callsA language model reads your tokens and predicts the next one, again and again, streaming the reply back.
© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms