Instructions to use nvidia/NV-Reason-PathWSI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/NV-Reason-PathWSI with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="nvidia/NV-Reason-PathWSI") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("nvidia/NV-Reason-PathWSI") model = AutoModelForMultimodalLM.from_pretrained("nvidia/NV-Reason-PathWSI", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nvidia/NV-Reason-PathWSI with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nvidia/NV-Reason-PathWSI" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/NV-Reason-PathWSI", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/nvidia/NV-Reason-PathWSI
- SGLang
How to use nvidia/NV-Reason-PathWSI with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "nvidia/NV-Reason-PathWSI" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/NV-Reason-PathWSI", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "nvidia/NV-Reason-PathWSI" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/NV-Reason-PathWSI", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use nvidia/NV-Reason-PathWSI with Docker Model Runner:
docker model run hf.co/nvidia/NV-Reason-PathWSI
NV-Reason-PathWSI
NV-Reason-PathWSI is a 2D vision-language model (VLM) for pathology whole-slide image (WSI) analysis. It combines a 2D vision encoder (Vision Transformer (ViT)) with a language model and is designed for pathology report generation, general question answering, and multi-step reasoning across digitized histopathology slides.
Whole-slide images encode clinically important morphology across gigapixel-scale tissue regions, yet most vision-language systems either operate on isolated tiles without slide-level context or compress slide-level features before language decoding. The 2D vision encoder converts tiled histopathology image regions into visual tokens. All tokens and their corresponding 2D positions are passed to the language model without spatial downsampling, while 2D positional encoding preserves their spatial relationships within the large language model (LLM). Input whole-slide images are tiled into image regions before processing.
The model was trained end-to-end using Supervised Fine-Tuning (SFT) and Group Relative Policy Optimization (GRPO) on a curated dataset of structured question-answering (QA) examples derived from whole-slide images. The training corpus integrates standardized pathology reports, abnormality-focused QA, multi-turn interactions, and pathologist-authored reasoning collected from expert whole-slide image interpretations. These expert annotations also guide the generation of report-grounded synthetic reasoning data for SFT, while GRPO uses verifiable rewards over pathology finding sets.
This model is ready for commercial or non-commercial use.
Note: Model weights are not included in this repository pending publication of the accompanying paper. This page provides the model card, configuration, and tokenizer; the weights will be released upon paper publication.
Installation
Python 3.11+ and a CUDA-capable PyTorch installation are recommended.
python -m pip install -r https://huggingface.co/nvidia/NV-Reason-PathWSI/resolve/main/requirements.txt
Quick Start
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
model_id = "nvidia/NV-Reason-PathWSI"
image_path = "path/to/patch.jpg"
model = AutoModelForImageTextToText.from_pretrained(
model_id,
dtype=torch.bfloat16,
).eval().to("cuda")
processor = AutoProcessor.from_pretrained(model_id)
def generate_response(image_path, prompt_text, enable_thinking=False, max_new_tokens=2048):
messages = [
{
"role": "user",
"content": [
{"type": "image"},
{"type": "text", "text": prompt_text},
],
}
]
prompt = processor.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=enable_thinking,
)
inputs = processor(
text=prompt, images=[image_path], return_tensors="pt"
).to(model.device)
with torch.inference_mode():
generated_ids = model.generate(
**inputs,
max_new_tokens=max_new_tokens,
do_sample=False,
use_cache=True,
)
new_tokens = generated_ids[:, inputs.input_ids.shape[1]:]
return processor.batch_decode(
new_tokens, skip_special_tokens=True, clean_up_tokenization_spaces=False
)[0]
# Open-ended description
print(generate_response(image_path, "Describe the histopathological features visible in this image."))
# Multiple-choice with a concise answer (thinking off)
print(generate_response(image_path, "Which feature is present? A) ... B) ... C) ... D) ...", enable_thinking=False))
# Reasoning mode
print(generate_response(image_path, "Reason step by step about the likely diagnosis.", enable_thinking=True))
The model loads with stock Transformers as standard Qwen3_5ForConditionalGeneration weights; trust_remote_code is not required. The chat template supports enable_thinking.
License/Terms of Use
Use of this model is governed by the OpenMDW-1.1 License.
Deployment Geography
Global
Use Case
Pathologists, medical students, and medical researchers would be expected to use this model for histopathology slide report generation, question answering, and reviewable AI-generated reasoning analyses in research and educational settings.
Important Medical AI Considerations: This model is designed for research and educational purposes only and should not be used for clinical diagnosis or treatment decisions. All outputs should be reviewed by qualified medical professionals. The model is intended to support medical education and research, not replace clinical judgment.
Release Date
Huggingface 11/28/2026 via https://huggingface.co/nvidia/NV-Reason-PathWSI
Reference(s)
[1] Wang S, Wu R, Herndon C, et al. "Pathology-CoT: Learning Visual Chain-of-Thought Agent from Expert Whole Slide Image Diagnosis Behavior." arXiv:2510.04587, 2025. https://arxiv.org/abs/2510.04587
[2] Sun Y, Zhang Y, Si Y, et al. "PathGen-1.6M: 1.6 Million Pathology Image-text Pairs Generation through Multi-agent Collaboration." arXiv:2407.00203, 2024. https://arxiv.org/abs/2407.00203
Model Architecture
Architecture Type: Transformer (Vision-Language Model)
Network Architecture: 2D vision encoder (ViT) coupled to a Qwen3.5-4B language model, with 2D positional encoding
Task: Vision-Language (report generation, question answering, and reasoning)
Base Model: Qwen3.5-4B
Number of model parameters: 4.54B total (4,539,265,536 parameters, bf16)
This model was developed by training end-to-end with Supervised Fine-Tuning (SFT) and Group Relative Policy Optimization (GRPO).
Hugging Face integration:
AutoModelForImageTextToText+AutoProcessor, no remote code- Chat template supports
enable_thinking
Input
Input Type(s): Image, Text
Input Format(s): Whole-slide images (.svs, .tif/.tiff, .ndpi) or extracted histopathology tiles (.png, .jpg), Text prompts (string)
Input Parameters: Image: Two-Dimensional (2D); Text: One-Dimensional (1D)
Other Properties Related to Input: Accepts digitized histopathology slides (routine hematoxylin and eosin (H&E) and/or special stains). Whole-slide images are tiled into 2D image regions before encoding. Input image sizes are flexible, from 224 x 224 pixels up to 4K resolution. Text length limits follow the NV-Reason-CT configuration: generation is capped at 2,048 new tokens, with prompt length bounded by the Qwen3.5-4B context window. Accepts natural language prompts for medical queries, follow-up questions, and reasoning requests.
Input Specifications
- Medical Images: Digitized whole-slide histopathology images and extracted image tiles (flexible input size from 224 x 224 pixels up to 4K resolution)
- Text Prompts: Natural language requests for pathology reports, answers to questions, or detailed reasoning analyses
- Interactive Dialogue: Support for follow-up questions and clarification requests
Output
Output Type(s): Text
Output Format: String
Output Parameters: One-Dimensional (1D) natural language reports, answers, and reasoning analyses
Other Properties Related to Output: Outputs contain structured reasoning showing step-by-step medical analysis, followed by a concise answer. This format enables transparency in the model's reasoning process and supports educational use cases. Reasoning output can be disabled for concise answers.
Our AI models are designed and/or optimized to run on NVIDIA GPU-accelerated systems. By leveraging NVIDIA's hardware (e.g. GPU cores) and software frameworks (e.g., CUDA libraries), the model achieves faster training and inference times compared to CPU-only solutions.
Software Integration
Runtime Engine(s):
- PyTorch
- Transformers
Supported Hardware Microarchitecture Compatibility:
- NVIDIA Ampere
- NVIDIA Hopper
- NVIDIA Lovelace
Supported Operating System(s):
- Linux
The integration of foundation and fine-tuned models into AI systems requires additional testing using use-case-specific data to ensure safe and effective deployment. Following the V-model methodology, iterative testing and validation at both unit and system levels are essential to mitigate risks, meet technical and functional requirements, and ensure compliance with safety and ethical standards before deployment.
Model Version(s)
0.1 - Initial release version for pathology WSI reasoning and interpretation with structured thinking output
This model can be integrated into AI systems through the PyTorch and Transformers runtimes on NVIDIA GPU-accelerated systems. Integration requires additional use-case-specific testing and validation, following the V-model methodology described under Software Integration, before the model is deployed in any AI system.
Training and Evaluation Datasets
Dataset Overview
The model was trained on a curated dataset of structured question answering (QA) examples derived from whole-slide images, integrating public pathology datasets with paired reports, abnormality labels, and expert-authored reasoning.
Total Size: Hundreds of thousands of structured QA examples derived from tens of thousands of whole-slide images; less than a million images and less than a billion text tokens in total.
Total Number of Datasets: 32 (31 public TCGA datasets used for training and validation, plus 1 independent external test set used for testing).
Partition Percentages: Training and validation partitions are derived from the 31 TCGA datasets (the majority of the data); testing is performed on an independent external test set that is fully disjoint from all training and validation data.
Time Period: 2000-2025.
Data Processing: Whole-slide images are tiled into image regions; standardized pathology reports, abnormality-focused QA, multi-turn interactions, and pathologist-authored reasoning are converted into structured QA examples; de-identification is applied to all source data before use.
Harmful Data Mitigation: All TCGA source data is de-identified by the data provider; additional Protected Health Information (PHI) scrubbing and review are applied before use. Data is limited to de-identified histopathology images and accompanying medical text for research use. Users are responsible for ensuring that whole-slide images and associated patient data are properly de-identified and handled in accordance with applicable privacy requirements.
Public Datasets
- The Cancer Genome Atlas (TCGA): 31 TCGA cancer-type datasets (identified by TCGA project codes), providing whole-slide histopathology images with paired pathology annotations. Link: https://portal.gdc.cancer.gov/projects/TCGA. Period of collection: 2000-2025. All TCGA source data is de-identified.
Private Datasets
- Independent external test set (clinical evaluation benchmark): 579 whole-slide histopathology images with accompanying text, used for evaluation and testing only; fully disjoint from all TCGA training and validation data.
- Providing parties: external clinical collaborating institutions; not distributed by NVIDIA.
- Number of data points / size per modality: 579 whole-slide images (image modality) with paired natural-language text.
- Nature of content: de-identified patient histopathology data.
- Unique identifiers/links: not publicly available (held-out test collection).
- Period of collection: 2000-2025.
Self-Sourced Synthetic Data
Report-grounded synthetic reasoning examples generated for supervised fine-tuning, derived from expert pathologist annotations of TCGA whole-slide images. Data points: included within the hundreds of thousands of structured QA training examples. Size per modality: synthetic text (reasoning chains and QA) paired with source histopathology image regions. Generation methods: expert-guided generation grounded in paired pathology reports, with review under expert guidance. AI models/systems used: internal data-generation pipelines guided by expert-authored reasoning.
Training Dataset
Data Modality:
- Image
- Text
Image Training Data Size:
- Less than a Million Images
Text Training Data Size:
- Less than a Billion Tokens
Data Collection Method by dataset:
- Hybrid: Manually-Collected, Automatic/Sensors
Labeling Method by dataset:
- Hybrid: Manually-Labeled, Synthetic
Properties: Data count: hundreds of thousands of structured QA examples derived from tens of thousands of whole-slide images across the 31 TCGA datasets. Modalities: histopathology whole-slide images (image) and natural-language text (reports, question answering, and reasoning). Nature of content: de-identified public (TCGA) patient data with human-authored and synthetic annotations. Linguistic characteristics: English-language medical text. Time period: 2000-2025.
Testing Dataset
Data Modality:
- Image
- Text
Data Collection Method by dataset:
- Hybrid: Manually-Collected, Automatic/Sensors
Labeling Method by dataset:
- Hybrid: Manually-Labeled, Synthetic
Properties: Data count: 579 whole-slide images (independent external test set), fully disjoint from the 31 TCGA training datasets. Modalities: histopathology whole-slide images (image) and natural-language text. Nature of content: held-out, de-identified patient data with human and synthetic annotations. Linguistic characteristics: English-language medical text. Time period: 2000-2025.
Evaluation Dataset
Data Modality:
- Image
- Text
Data Collection Method by dataset:
- Hybrid: Manually-Collected, Automatic/Sensors
Labeling Method by dataset:
- Hybrid: Manually-Labeled, Synthetic
Properties: Data count: 579 whole-slide images from the independent external test set (clinical evaluation benchmark), fully disjoint from the 31 TCGA training datasets. Modalities: histopathology whole-slide images (image) and natural-language text. Nature of content: held-out, de-identified patient data with human and synthetic annotations. Linguistic characteristics: English-language medical text. Time period: 2000-2025.
Inference
Acceleration Engine: PyTorch, Transformers
Test Hardware:
- NVIDIA Hopper H100
- NVIDIA Lovelace L40S
Ethical Considerations
NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. Developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
Please make sure you have proper rights and permissions for all input image and video content; if image or video includes people, personal health information, or intellectual property, the image or video generated will not blur or maintain proportions of image subjects included.
For more detailed information on ethical considerations for this model, please see the Model Card++ Bias, Explainability, Safety & Security, and Privacy Subcards.
Please report model quality, risk, security vulnerabilities or NVIDIA AI Concerns here.
- Downloads last month
- 23
Install from pip and serve model
# Install vLLM from pip: pip install vllm# Start the vLLM server: vllm serve "nvidia/NV-Reason-PathWSI"# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/NV-Reason-PathWSI", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'