Image-Text-to-Text
MLX
English
qwen3_5
native-mlx
apple-silicon
fp32
ct
medical-imaging
nv-reason-ct
3d-vlm
vision-language
radiology
report-generation
conversational
custom_code
Instructions to use MedMLX/MLX-Reason-CT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use MedMLX/MLX-Reason-CT with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("MedMLX/MLX-Reason-CT") config = load_config("MedMLX/MLX-Reason-CT") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use MedMLX/MLX-Reason-CT with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "MedMLX/MLX-Reason-CT"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "MedMLX/MLX-Reason-CT" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use MedMLX/MLX-Reason-CT with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "MedMLX/MLX-Reason-CT"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default MedMLX/MLX-Reason-CT
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use MedMLX/MLX-Reason-CT with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "MedMLX/MLX-Reason-CT"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "MedMLX/MLX-Reason-CT" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Clean model card and use MLX-Reason-CT naming
Browse files
README.md
CHANGED
|
@@ -1,116 +1,156 @@
|
|
| 1 |
---
|
| 2 |
license: openmdw-1.1
|
|
|
|
|
|
|
| 3 |
library_name: mlx
|
|
|
|
|
|
|
|
|
|
| 4 |
tags:
|
| 5 |
-
-
|
|
|
|
| 6 |
- apple-silicon
|
| 7 |
-
-
|
| 8 |
-
|
| 9 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
-
# NV-Reason-CT 386b93e0, FP32, chest structured report, greedy, max_new_tokens 512, thinking off
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
##
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
Original checkpoint: https://huggingface.co/nvidia/NV-Reason-CT/resolve/386b93e034983f6c1fc841a43833a1b6a0cd9c13/model.safetensors
|
| 24 |
|
| 25 |
-
|
| 26 |
-
Conversion changes tensor layout or storage as specified by the native package; it does not retrain the model.
|
| 27 |
|
| 28 |
-
|
|
|
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
-
```
|
| 33 |
-
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
-
kwargs = {
|
| 37 |
-
"image_path": "luna-case.nii.gz",
|
| 38 |
-
"weights_path": "nv-reason-ct",
|
| 39 |
-
"output_dir": "out",
|
| 40 |
-
"anatomy_region": "chest",
|
| 41 |
-
"overwrite": True
|
| 42 |
-
}
|
| 43 |
-
result = run(**kwargs)
|
| 44 |
-
print(result["outputs"])
|
| 45 |
```
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
- `
|
| 91 |
-
- `
|
| 92 |
-
- `
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
-
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: openmdw-1.1
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
library_name: mlx
|
| 6 |
+
base_model: nvidia/NV-Reason-CT
|
| 7 |
+
pipeline_tag: image-text-to-text
|
| 8 |
+
inference: false
|
| 9 |
tags:
|
| 10 |
+
- mlx
|
| 11 |
+
- native-mlx
|
| 12 |
- apple-silicon
|
| 13 |
+
- fp32
|
| 14 |
+
- ct
|
| 15 |
+
- medical-imaging
|
| 16 |
+
- nv-reason-ct
|
| 17 |
+
- 3d-vlm
|
| 18 |
+
- vision-language
|
| 19 |
+
- radiology
|
| 20 |
+
- report-generation
|
| 21 |
---
|
|
|
|
| 22 |
|
| 23 |
+
# MLX-Reason-CT
|
| 24 |
+
|
| 25 |
+
Native MLX port of [NVIDIA NV-Reason-CT](https://huggingface.co/nvidia/NV-Reason-CT)
|
| 26 |
+
for Apple Silicon. Run 3D CT reasoning and report generation locally on Mac.
|
| 27 |
+
|
| 28 |
+
- Chest and abdomen CT
|
| 29 |
+
- Structured reports and CT question answering
|
| 30 |
+
- Local NIfTI input with Apple Silicon GPU acceleration
|
| 31 |
+
- FP32 by default, with explicit BF16 arithmetic profiles on Metal
|
| 32 |
+
|
| 33 |
+
MLX port by **Joseph Sandoval**.
|
| 34 |
+
[GitHub releases](https://github.com/MedMLX/MLX-Reason-CT/releases) ·
|
| 35 |
+
[Usage](https://github.com/MedMLX/MLX-Reason-CT/blob/v0.2.4/docs/usage.md) ·
|
| 36 |
+
[Paper](https://arxiv.org/abs/2609.27511) ·
|
| 37 |
+
[Public reference card](https://huggingface.co/josand/MLX-Reason-CT)
|
| 38 |
|
| 39 |
+
**Requires the companion `mlx-reason-ct` runtime.** Follow the quick start below.
|
| 40 |
+
Hugging Face's generated "Use this model" snippet uses `mlx-vlm`, which does not
|
| 41 |
+
support this 3D CT architecture; generic `mlx-lm` loaders are also incompatible.
|
| 42 |
|
| 43 |
+
## Requirements
|
| 44 |
|
| 45 |
+
Supported platform: macOS arm64 on an Apple Silicon Mac with Metal GPU access,
|
| 46 |
+
Python 3.12 and [uv](https://docs.astral.sh/uv/). Inference fails explicitly when
|
| 47 |
+
Metal is unavailable.
|
|
|
|
| 48 |
|
| 49 |
+
`v0.2.4` uses the public Apache-2.0 `medmlx-core==0.1.2` runtime from PyPI.
|
|
|
|
| 50 |
|
| 51 |
+
Weights occupy 17.4 GB. Measured peak MLX memory use is about 22.7 GB;
|
| 52 |
+
allow additional unified memory for preprocessing, macOS and other apps.
|
| 53 |
|
| 54 |
+
## Quick start
|
| 55 |
|
| 56 |
+
```bash
|
| 57 |
+
uv tool install --python 3.12 \
|
| 58 |
+
https://github.com/MedMLX/MLX-Reason-CT/releases/download/v0.2.4/mlx_reason_ct-0.2.4-py3-none-any.whl
|
| 59 |
|
| 60 |
+
uvx --from huggingface_hub hf download MedMLX/MLX-Reason-CT --local-dir models
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
```
|
| 62 |
|
| 63 |
+
Authenticate with `hf auth login` if repository access is required.
|
| 64 |
+
|
| 65 |
+
Generate a chest CT report:
|
| 66 |
+
|
| 67 |
+
```bash
|
| 68 |
+
mlx-reason-ct report \
|
| 69 |
+
--input ct.nii.gz --model-dir models --output-dir outputs
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
For abdomen CT:
|
| 73 |
+
|
| 74 |
+
```bash
|
| 75 |
+
mlx-reason-ct report \
|
| 76 |
+
--input ct.nii.gz --model-dir models --output-dir outputs \
|
| 77 |
+
--anatomy-region abdomen
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
To ask a question about the CT, set `--prompt` to your question.
|
| 81 |
+
|
| 82 |
+
For an existing Python 3.12 environment, use `pip install` with the same release-wheel URL.
|
| 83 |
+
Wheel and source archives are also available in the
|
| 84 |
+
[GitHub release](https://github.com/MedMLX/MLX-Reason-CT/releases/tag/v0.2.4).
|
| 85 |
+
For source development, clone [the repository](https://github.com/MedMLX/MLX-Reason-CT)
|
| 86 |
+
and run `make env`; use `uv run mlx-reason-ct` for the commands above.
|
| 87 |
+
The source checkout additionally supports plain centered cropping and follow-up
|
| 88 |
+
history, which are not in 0.2.4; see the
|
| 89 |
+
[source usage guide](https://github.com/MedMLX/MLX-Reason-CT/blob/main/docs/usage.md).
|
| 90 |
+
|
| 91 |
+
For a generated input with no patient data, follow the
|
| 92 |
+
[synthetic CT walkthrough](https://github.com/MedMLX/MLX-Reason-CT/blob/v0.2.4/docs/synthetic-walkthrough.md).
|
| 93 |
+
It covers installation, bundle verification, input generation and completion checks.
|
| 94 |
+
|
| 95 |
+
## Input and output
|
| 96 |
+
|
| 97 |
+
Input is one 3D CT volume in NIfTI format (`.nii` or `.nii.gz`) with Hounsfield
|
| 98 |
+
Unit values and valid spatial geometry. DICOM and 2D images are unsupported.
|
| 99 |
+
|
| 100 |
+
The upstream crop locates the chest from enclosed air. On whole-body scans,
|
| 101 |
+
especially with arms raised, it can select the head and neck instead; crop such
|
| 102 |
+
volumes to the chest or abdomen before running.
|
| 103 |
+
|
| 104 |
+
Each run writes:
|
| 105 |
+
|
| 106 |
+
- `report.txt` — generated response
|
| 107 |
+
- `model_response.json` — response, reasoning (with `--enable-thinking`) and generation metadata
|
| 108 |
+
- `run.json` — execution metadata
|
| 109 |
+
|
| 110 |
+
Version 0.2.4 removes a trailing empty `<answer></answer>` element from the saved
|
| 111 |
+
report in both text and JSON, while preserving reasoning and nonempty answer elements.
|
| 112 |
+
|
| 113 |
+
## Technical details
|
| 114 |
+
|
| 115 |
+
This repository contains the converted organization bundle sourced from NVIDIA
|
| 116 |
+
revision `386b93e034983f6c1fc841a43833a1b6a0cd9c13`, using lossless BF16-to-FP32
|
| 117 |
+
expansion and the `nv_reason_ct_mlx.fp32.v1` format. No retraining was performed.
|
| 118 |
+
|
| 119 |
+
The retained LUNA16 chest comparison used greedy generation, 512 maximum new
|
| 120 |
+
tokens and thinking disabled. It completed successfully and reproduced the
|
| 121 |
+
reference CPU FP32 output tokens. This does not establish equivalence to the
|
| 122 |
+
original CUDA BF16 profile or estimate diagnostic accuracy.
|
| 123 |
+
|
| 124 |
+
[Native run](https://huggingface.co/MedMLX/MLX-Reason-CT/blob/main/native-run.json) ·
|
| 125 |
+
[Original-code comparison](https://huggingface.co/MedMLX/MLX-Reason-CT/blob/main/reference-comparison.json).
|
| 126 |
+
Evaluated package revision: `eb2c10baf688b32eee082dbb8973e88b4555db7a`.
|
| 127 |
+
|
| 128 |
+
Inference defaults to FP32 with weights converted directly from the
|
| 129 |
+
original BF16 checkpoint, without retraining.
|
| 130 |
+
[Implementation and verification details](https://github.com/MedMLX/MLX-Reason-CT/blob/v0.2.4/docs/usage.md),
|
| 131 |
+
and the limits of its darwin-arm64 component references are in the companion repository.
|
| 132 |
+
[Upstream model card and limitations](https://huggingface.co/nvidia/NV-Reason-CT).
|
| 133 |
+
|
| 134 |
+
Version 0.2.3 includes faster source-BF16 projection and attention kernels.
|
| 135 |
+
On one M1 Max synthetic case, cached full-model time fell from 17:54 in the
|
| 136 |
+
preceding source build to 14:49, with bitwise-unchanged recorded outputs.
|
| 137 |
+
Full BF16 qualification remains incomplete; see the
|
| 138 |
+
[benchmark and limits](https://github.com/MedMLX/MLX-Reason-CT/blob/v0.2.3/docs/verification.md#source-bf16-optimization-measurement-2026-10-09).
|
| 139 |
+
|
| 140 |
+
## Intended use
|
| 141 |
+
|
| 142 |
+
Intended for research and education, not clinical diagnosis or treatment decisions.
|
| 143 |
+
Outputs require human review.
|
| 144 |
+
|
| 145 |
+
## License
|
| 146 |
+
|
| 147 |
+
Weights: [OpenMDW-1.1](https://huggingface.co/MedMLX/MLX-Reason-CT/blob/main/LICENSE),
|
| 148 |
+
Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES.
|
| 149 |
+
Underlying Qwen3.5 terms: [Apache-2.0](https://huggingface.co/josand/MLX-Reason-CT/blob/main/APACHE-2.0.txt).
|
| 150 |
+
|
| 151 |
+
Port code: [Apache-2.0](https://github.com/MedMLX/MLX-Reason-CT/blob/main/LICENSE),
|
| 152 |
+
Copyright (c) 2026 Joseph Sandoval.
|
| 153 |
+
[Third-party notices](https://github.com/MedMLX/MLX-Reason-CT/blob/main/THIRD_PARTY_NOTICES.md).
|
| 154 |
+
|
| 155 |
+
The hosted bundle retains [attribution](https://huggingface.co/MedMLX/MLX-Reason-CT/blob/main/NOTICE)
|
| 156 |
+
and [component notices](https://huggingface.co/MedMLX/MLX-Reason-CT/blob/main/THIRD_PARTY_NOTICES.md).
|