Metadata-Version: 2.4
Name: med-vlm-mlx
Version: 0.3.1
Summary: MedGemma medical vision-language inference on Apple Silicon.
Author: Alfredo Sandoval
Author-email: Prince Canuma <prince.gdt@gmail.com>
License-Expression: MIT AND Apache-2.0
Project-URL: Repository, https://github.com/MedMLX/med-vlm-mlx
Project-URL: Upstream, https://github.com/Blaizzy/mlx-vlm
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
Requires-Dist: mlx==0.32.3
Requires-Dist: transformers==5.19.0
Requires-Dist: jinja2>=3.1.6
Requires-Dist: sentencepiece>=0.2.1
Requires-Dist: tqdm>=4.66.3
Requires-Dist: Pillow<14,>=13
Requires-Dist: requests>=2.33.0
Requires-Dist: fastapi>=0.143.0
Requires-Dist: starlette>=1.3.1
Requires-Dist: uvicorn
Requires-Dist: numpy
Provides-Extra: medical
Requires-Dist: fsspec==2026.9.0; extra == "medical"
Requires-Dist: torch==2.14.1; extra == "medical"
Dynamic: license-file

# med-vlm-mlx

Run MedGemma locally on Apple Silicon. Includes Python, CLI and HTTP interfaces.

[Docs](https://github.com/MedMLX/med-vlm-mlx/blob/main/docs/index.md) · [MedMLX](https://github.com/MedMLX)

| Input | Output |
| :--- | :--- |
| Image + text prompt | Generated text |

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

## Quick start

```bash
uv venv --python 3.13
source .venv/bin/activate
uv pip install "med-vlm-mlx>=0.3.1"
```

The three checkpoint integration checks below ran at source revision
[`d9336a2`](https://github.com/MedMLX/med-vlm-mlx/commit/d9336a242b001c1e27abb4bb2d5f99ada65959bd).

Download the pinned [MedGemma 1.5 4B](https://huggingface.co/mlx-community/medgemma-1.5-4b-it-4bit) weights, then run:

```bash
uvx --from huggingface_hub hf download mlx-community/medgemma-1.5-4b-it-4bit \
  --revision 762746b7a72b0b68dd8fa3f9aea5dc3980674d23 --local-dir medgemma

python -m mlx_vlm.generate \
  --model medgemma --image image.png \
  --prompt 'Describe the image.' --max-tokens 128
```

## Supported checkpoints

| Model | MLX weights | Revision |
| :--- | :--- | :--- |
| MedGemma 1.5 4B | [`mlx-community/medgemma-1.5-4b-it-4bit`](https://huggingface.co/mlx-community/medgemma-1.5-4b-it-4bit) | `762746b7a72b0b68dd8fa3f9aea5dc3980674d23` |
| MedGemma 4B (v1) | [`mlx-community/medgemma-4b-it-4bit`](https://huggingface.co/mlx-community/medgemma-4b-it-4bit) | `db10be5ae6bd569e2063c3c74b9b9dfbcbedcad3` |
| MedGemma 27B multimodal | [`mlx-community/medgemma-27b-it-4bit`](https://huggingface.co/mlx-community/medgemma-27b-it-4bit) | `f57d2d648d28950b1bc7abd6e1b7b06aff0e183a` |

All three are Gemma3 image-text checkpoints. Other architectures are rejected.

Uses the `mlx_vlm` namespace. Install in a separate environment from upstream `mlx-vlm`.

## Documentation

[Installation](docs/installation.md) · [Python, CLI and HTTP usage](docs/usage.md) · [CLI reference](docs/cli_reference.md) · [Development](CONTRIBUTING.md)

## License

MIT, with Apache-2.0 adaptations. See [LICENSE](https://github.com/MedMLX/med-vlm-mlx/blob/main/LICENSE) and [third-party notices](https://github.com/MedMLX/med-vlm-mlx/blob/main/THIRD_PARTY_NOTICES.md). MedGemma weights are subject to the [Health AI Developer Foundations terms](https://developers.google.com/health-ai-developer-foundations/terms).

For research and education. Outputs require human review.
