Prepare Python and CUDA PyTorch
Install Python 3.11 or newer and a CUDA-capable PyTorch build so that torch.cuda is available.
Install the NV-Reason-CT Transformers runtime, load the nvidia/NV-Reason-CT model, and run deterministic 3D CT question answering on a .nii.gz volume. Then inspect the generated answer to confirm the model responded to a question about a visible detail before trusting the pipeline.
Install the NV-Reason-CT Transformers runtime, load the nvidia/NV-Reason-CT model, and run deterministic 3D CT question answering on a .nii.gz volume. Then inspect the generated answer to confirm the model responded to a question about a visible detail before trusting the pipeline.
This setup uses the package documented for this task. Review its source and supported platforms before starting.
The publisher has not provided a complete memory target for this task. Check its hardware guidance before starting.
This setup uses Transformers. The exact checkpoint format, context, and runtime overhead determine its memory need; a weight-file size alone is not a GPU recommendation.
Pick your operating system. Every command below is for the selected package and runtime.
The publisher supplies Python code but does not specify an operating system. Linux is a practical starting environment, not a publisher-tested machine. Run the Python snippets in one session, in order.
Install Python 3.11 or newer and a CUDA-capable PyTorch build so that torch.cuda is available.
From your working directory, install the model's requirements file using the publisher's documented command. This command pulls the pinned dependencies used by the NV-Reason-CT runtime, including the Transformers build needed to load the custom image processor.
python -m pip install -r https://huggingface.co/nvidia/NV-Reason-CT/resolve/main/requirements.txtCreate a Python script that loads nvidia/NV-Reason-CT onto the CUDA device in bfloat16 and attaches the matching processor. The remote-code flag is required for the 3D image processor, and SDPA provides the documented attention implementation.
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
model_id = "nvidia/NV-Reason-CT"
ct_path = "path/to/volume.nii.gz"
model = AutoModelForImageTextToText.from_pretrained(
model_id,
trust_remote_code=True,
dtype=torch.bfloat16,
attn_implementation="sdpa",
).eval().to("cuda")
processor = AutoProcessor.from_pretrained(
model_id,
trust_remote_code=True,
)Define the reusable generate_response helper. It accepts a .nii.gz path, the question text, a region selector, a thinking flag, and a max token count. This matches the publisher's Quick Start so the model sees the volume as a chat message and decodes the newly generated tokens only.
def generate_response(
ct_path,
prompt_text,
anatomy_region="chest",
enable_thinking=True,
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,
images3d=[ct_path],
anatomy_region=anatomy_region,
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]
Point ct_path at a de-identified .nii.gz CT volume, choose anatomy_region="chest", and print the answer to a question about a specific finding so the answer can later be checked against the image. The example asks for a structured chest CT report.
print(generate_response(ct_path, "Write a structured chest CT report.", anatomy_region="chest"))Run the script and read the printed response. Compare each statement against the visible anatomy in the same .nii.gz volume you passed in. If the answer ignores or contradicts an obvious structure you can see in the volume, the vision path or the region crop is not behaving as intended for that case, so adjust the region or the question text and regenerate.
Ask about a visible detail in a local test image and compare the answer to the image yourself.
This is a source-linked setup, not a YouRunAI hardware test. Confirm your exact runtime version, package, and output before relying on it.
Confirm torch.cuda.is_available() returns True and that your GPU is adequate for a bfloat16 3D VLM (publisher-tested hardware includes H100 and L40S). If the GPU is smaller, keep the model on CPU for a quick structural check but expect generation to be impractically slow.
Re-run `python -m pip install -r https://huggingface.co/nvidia/NV-Reason-CT/resolve/main/requirements.txt` in the same environment as the interpreter running the script, and keep trust_remote_code=True on both from_pretrained calls so the NV-Reason-CT custom processor and configuration are fetched.
Inspect the crop the model actually received by loading the same ct_path with `processor.image_processor_3d.load_image(ct_path, normalize_mode=0, anatomy_region=anatomy_region)` and saving the resulting tensor as a NIfTI for review. If the anatomy heuristic has selected the wrong region, manually crop the input and pass anatomy_region=None so the processor takes a centered crop.
Original instructions, model files, and compatibility notes behind this setup.
Save your machine to see a personalized rating and its reasoning.
Add my hardwareInstall a local runtime, run Qwen3.5 9B, confirm responses, and know when to choose the smaller 4B package.
Connect an open coding-capable model in Ollama to Cline, run a small repository task, and review the result locally.
Use the official FLUX.2 Klein 4B ComfyUI template with exact model files, a first prompt, and an output check.