medmlx-core
Shared MLX building blocks for MedMLX medical imaging models on Apple Silicon.
- Metal runtime checks and memory reporting
- 3D convolutions, resampling and sliding-window inference
- Tensor layouts, precision helpers and checkpoint conversion
PyPI · Releases · Technical reference
Requirements
Apple Silicon Mac, macOS, Python 3.12 or 3.13, and Metal GPU access. NumPy and MLX install automatically. Inference raises an error when Metal is unavailable.
Install
pip install medmlx-core
For optional PyTorch checkpoint conversion:
pip install "medmlx-core[conversion]"
Python
Run a small synthetic volume through overlapping patches:
import numpy as np
from medmlx_core import sliding_window_inference
volume = np.ones((1, 1, 32, 32, 32), dtype=np.float32)
output = sliding_window_inference(
volume,
roi_size=(16, 16, 16),
sw_batch_size=1,
predictor=lambda patch: patch * 2,
)
print(output.shape) # (1, 1, 32, 32, 32)
Arrays use batch, channel, depth, height and width axes. Replace the example predictor with your model; the result is a NumPy array.
MedMLX model packages provide the architectures, weights and image workflows. This library supplies their shared runtime operations.
Technical details
API contracts, numerical references and development commands are in the technical reference. See the decoder note for the Metal transpose-convolution fix.
License
Apache-2.0. Includes third-party notices and the upstream MONAI license.
Metadata
Release files for medmlx-core 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| medmlx_core-0.1.3.tar.gz | 228.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| medmlx_core-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 266.2 kB
Release files / medmlx_core-0.1.3.tar.gz
| Download URL | medmlx_core-0.1.3.tar.gz |
|---|---|
| Size | 228.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f05f28df08fe348f03d3eb29697f3b2af3103b5991b3ee9050de2bf85b45c7df
|
|
BLAKE2b-256 checksum How to use checksums |
61e13c75fc5a47c1db19920d3b12b3c78e005f0109d3d591ed3985dec6b3c277
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / medmlx_core-0.1.3-py3-none-any.whl
| Download URL | medmlx_core-0.1.3-py3-none-any.whl |
|---|---|
| Size | 37.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4aa5d109bcfb1b7f58ee4c9e310466e44bde54687c0aa15bc365aa58b751474b
|
|
BLAKE2b-256 checksum How to use checksums |
5a78fa7bb889b6db3f0d2411bf8b566c699ff06dc78179d5041c9b03aaadf127
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|