Metadata-Version: 2.5
Name: medmlx
Version: 0.4.2
Summary: MedMLX Python API, CLI, and MCP for independent medical imaging runtimes
Author: Joseph Sandoval, Alfredo Sandoval Jr.
License-Expression: Apache-2.0
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
Classifier: Operating System :: MacOS :: MacOS X
Requires-Python: <3.14,>=3.13
Requires-Dist: medmlx-core==0.2.6
Requires-Dist: packaging>=24
Requires-Dist: uv<1,>=0.8
Provides-Extra: all
Requires-Dist: biomedparse-mlx==0.1.5; extra == 'all'
Requires-Dist: fdg-pet-ct-mlx==0.2.6; extra == 'all'
Requires-Dist: flexible-unet-mlx==0.2.6; extra == 'all'
Requires-Dist: flexray-mlx==0.2.6; extra == 'all'
Requires-Dist: lesiondiffusion-mlx==0.2.6; extra == 'all'
Requires-Dist: lung-nodule-mlx==0.2.6; extra == 'all'
Requires-Dist: medsam2-mlx==0.2.8; extra == 'all'
Requires-Dist: mlx-generate-ctmr==0.5.2; extra == 'all'
Requires-Dist: mlx-reason-ct[tools]==0.3.6; extra == 'all'
Requires-Dist: mlx-segment-ct==0.3.5; extra == 'all'
Requires-Dist: mlxradiomics[io]==0.1.0.dev9; extra == 'all'
Requires-Dist: nibabel<6,>=5.4.2; extra == 'all'
Requires-Dist: nnunet-mlx==0.6.4; extra == 'all'
Requires-Dist: numpy<3,>=2.3; extra == 'all'
Requires-Dist: pillow<14,>=13; extra == 'all'
Requires-Dist: pydantic<3,>=2.14; extra == 'all'
Requires-Dist: radimagenet-mlx==0.3.3; extra == 'all'
Requires-Dist: sam3-mlx[video]==0.2.4; extra == 'all'
Requires-Dist: scipy<2,>=1.18; extra == 'all'
Requires-Dist: segresnet-mlx==0.3.3; extra == 'all'
Requires-Dist: simpleitk<3,>=2.5; extra == 'all'
Requires-Dist: swin-unetr-mlx==0.2.6; extra == 'all'
Requires-Dist: synthseg-mlx==0.3.4; extra == 'all'
Requires-Dist: totalsegmentator-mlx==0.1.6; extra == 'all'
Requires-Dist: unest-mlx==0.2.7; extra == 'all'
Provides-Extra: dicom
Requires-Dist: simpleitk<3,>=2.5; extra == 'dicom'
Provides-Extra: generate
Requires-Dist: fdg-pet-ct-mlx==0.2.6; extra == 'generate'
Requires-Dist: lesiondiffusion-mlx==0.2.6; extra == 'generate'
Requires-Dist: mlx-generate-ctmr==0.5.2; extra == 'generate'
Requires-Dist: mlx-reason-ct==0.3.6; extra == 'generate'
Requires-Dist: nibabel<6,>=5.4.2; extra == 'generate'
Provides-Extra: mcp
Requires-Dist: mcp<3,>=2.2; extra == 'mcp'
Provides-Extra: reason-tools
Requires-Dist: lung-nodule-mlx==0.2.6; extra == 'reason-tools'
Requires-Dist: medsam2-mlx==0.2.8; extra == 'reason-tools'
Requires-Dist: mlx-reason-ct[tools]==0.3.6; extra == 'reason-tools'
Requires-Dist: nibabel<6,>=5.4.2; extra == 'reason-tools'
Requires-Dist: numpy<3,>=2.3; extra == 'reason-tools'
Requires-Dist: pillow<14,>=13; extra == 'reason-tools'
Requires-Dist: pydantic<3,>=2.14; extra == 'reason-tools'
Requires-Dist: scipy<2,>=1.18; extra == 'reason-tools'
Provides-Extra: segment
Requires-Dist: biomedparse-mlx==0.1.5; extra == 'segment'
Requires-Dist: flexible-unet-mlx==0.2.6; extra == 'segment'
Requires-Dist: flexray-mlx==0.2.6; extra == 'segment'
Requires-Dist: medsam2-mlx==0.2.8; extra == 'segment'
Requires-Dist: mlx-segment-ct==0.3.5; extra == 'segment'
Requires-Dist: nnunet-mlx==0.6.4; extra == 'segment'
Requires-Dist: sam3-mlx[video]==0.2.4; extra == 'segment'
Requires-Dist: segresnet-mlx==0.3.3; extra == 'segment'
Requires-Dist: swin-unetr-mlx==0.2.6; extra == 'segment'
Requires-Dist: synthseg-mlx==0.3.4; extra == 'segment'
Requires-Dist: totalsegmentator-mlx==0.1.6; extra == 'segment'
Requires-Dist: unest-mlx==0.2.7; extra == 'segment'
Provides-Extra: setup
Provides-Extra: vision
Requires-Dist: lung-nodule-mlx==0.2.6; extra == 'vision'
Requires-Dist: mlxradiomics[io]==0.1.0.dev9; extra == 'vision'
Requires-Dist: radimagenet-mlx==0.3.3; extra == 'vision'
Description-Content-Type: text/markdown

# MedMLX

One Python API, command line and MCP server for native medical imaging on Apple Silicon.
Run TotalSegmentator, nnU-Net, MedSAM2, SynthSeg and more through their independent MLX runtimes.

[Models](https://github.com/MedMLX) · [Docs](https://github.com/MedMLX/medmlx/blob/main/docs/declaring-models.md) · [Website](https://medmlx.org)

![Outputs across CT, PET/CT, radiographs, endoscopy and MRI](https://raw.githubusercontent.com/MedMLX/medmlx/main/docs/gallery.jpg)

**Apple Silicon · Metal · Python 3.13** · [uv](https://docs.astral.sh/uv/)

This README describes the **0.4.2 release**. The
[PyPI documentation](https://pypi.org/project/medmlx/) describes the same release;
source-only features are tracked in the [release notes](https://github.com/MedMLX/medmlx/blob/main/docs/release-notes.md).

## Install

Install the latest published CLI and MCP server with all model families:

```sh
uv tool install --python 3.13 "medmlx[all,mcp]"
```

For a Python project, use `uv add "medmlx[all,mcp]"` instead.

Choose `segment`, `generate` or `vision` instead of `all` for a smaller install.
The segment extra includes SAM 3 image and video support; generate includes
NV-Reason-CT and the weight-free FDG PET adapter. Model weights download
automatically on first use and keep their own terms. MedGemma uses a provisional bridge to a
separate MedVLM environment; checkpoint inference and numerical accuracy are
unqualified. See the
[bridge setup and limits](https://github.com/MedMLX/medmlx/blob/main/docs/medvlm-bridge.md).

For unreleased runtime changes, use the locked source workspace described in
the [MCP setup guide](https://github.com/MedMLX/medmlx/blob/main/docs/mcp.md). The [dependency definitions](https://github.com/MedMLX/medmlx/blob/main/pyproject.toml)
record the runtime versions used by that workspace.

## Run a model

```sh
medmlx describe mlx-segment-ct
medmlx readiness mlx-segment-ct --arguments arguments.json --root /path/to/work
medmlx run mlx-segment-ct --arguments arguments.json --root /path/to/work
```

For models with automatic assets, omit `weights_path`: the runner downloads its
configured Hub repository or model files, reuses the cached folder afterwards,
and records its revision in the run details. For your own weights, pass a local
folder as `weights_path`. MedGemma and MRSegmentator currently require local
weights; multi-model workflows can require separate asset paths.

`describe` shows each model's arguments. `readiness` checks the runtime and Metal
without downloading weights. Optionally pre-download installed model assets for
offline use with `medmlx setup --all --progress`; workflows with multiple assets
require manual setup.
See [automatic weights and readiness](https://github.com/MedMLX/medmlx/blob/main/docs/setup.md).

```python
import json
from pathlib import Path
import medmlx

arguments = json.loads(Path("arguments.json").read_text())
result = medmlx.run("mlx-segment-ct", arguments=arguments, root="/path/to/work")
```

For an MCP client, use `medmlx serve --root /path/to/work` as its stdio command.
Disconnecting the client cancels its running jobs. See the
[MCP guide](https://github.com/MedMLX/medmlx/blob/main/docs/mcp.md) for client
setup, tools and a complete job workflow. For checkpoint conversion and
development, see [conversion](https://github.com/MedMLX/medmlx/blob/main/conversion/README.md)
and [core](https://github.com/MedMLX/medmlx/blob/main/packages/core/docs/technical.md).

The package also includes
[Reason-CT with nodule tools](https://github.com/MedMLX/medmlx/blob/main/docs/reason-ct-tools.md):
model-selected detector and MedSAM2 calls, spatially grounded masks and a local
CT review page. It requires the `reason-tools` extra and model assets.

## License

[Apache-2.0](https://github.com/MedMLX/medmlx/blob/main/LICENSE). See [third-party notices](https://github.com/MedMLX/medmlx/blob/main/THIRD_PARTY_NOTICES.md).
Runtimes and model weights retain their own terms.

For research and education. Outputs require human review.
