Skip to main content

MiniFold-MLX

An Apple Silicon port of MiniFold using the MLX framework. Runs protein structure prediction entirely on Apple Silicon GPU/Neural Engine with no PyTorch dependency at inference time.

Features

  • Full ESM2 (3B) + MiniFold folding trunk in MLX
  • int8 ESM2 quantization via mlx.nn.quantize (group_size=32)
  • Custom Apple Metal SGMM gate kernel fusing LayerNorm + gating for TriangularUpdate blocks
  • mx.compile support on MiniFormer for reduced Metal dispatch overhead
  • 48-layer (full) and 12-layer (fast) MiniFold variants
  • Simple three-function public API: load_model, predict_sequence, predict_batch
  • Pre-converted weights hosted on HuggingFace for fast download-on-first-use

Installation

pip install minifold-mlx

Requires macOS with Apple Silicon (M1 or later). For Linux/Windows, use the original MiniFold. MLX >= 0.16.0 is installed automatically as a dependency.

Quick Start

minifold example.fasta --out_dir ./structures

OR

python fold.py example.fasta --out_dir ./structures

Weights (~3.8 GB) are downloaded automatically on first run. PDB files are saved to ./structures/.

Weights

Pre-converted MLX weights (finetuned ESM2 + MiniFold 48L/12L) are available on HuggingFace:

z-ardern/MiniFold_MLX_weights
├── ESM2_MiniFold_int8/  # finetuned MLX ESM2 3B, int8 quantized (~3.3 GB) ← downloaded by default
├── ESM2_MiniFold/       # finetuned MLX ESM2 3B, full precision (~11 GB)
├── minifold_48L/        # 48-layer MiniFold MLX weights (~285 MB)
└── minifold_12L/        # 12-layer MiniFold MLX weights (~259 MB)

fold.py downloads only ESM2_MiniFold_int8 by default. Pass --non-quantized-ESM2 to use the full-precision weights instead.

from huggingface_hub import snapshot_download

weights = snapshot_download("z-ardern/MiniFold_MLX_weights")
esm_path      = f"{weights}/ESM2_MiniFold_int8"
minifold_path = f"{weights}/minifold_48L"

Use in Python

from minifold_mlx import load_model, predict_sequence, predict_batch

tokenizer, model = load_model(
    mlx_esm_path      = "path/to/esm2",
    mlx_minifold_path = "path/to/minifold_48L",
)

# Single sequence
pdb_str = predict_sequence("my_protein", "MKVLILSAVLFAASSA...", model, tokenizer)

# Batch
results = predict_batch(
    [("prot1", "MKVL..."), ("prot2", "MSYL...")],
    model, tokenizer,
)
# results = {"prot1": "<PDB string>", "prot2": "<PDB string>"}

Acknowledgements

This package is a port of MiniFold by Jeremy Wohlwend et al., adapted for Apple Silicon using MLX. The original MiniFold code and weights are the foundation of this work.

The use of MLX for ESM-2 is based on MLX-ESM-2 by Vincent Amato [https://github.com/vincentamato/mlx-esm-2] (https://github.com/vincentamato/mlx-esm-2), but re-implemented for the fine-tuned ESM-2 model used by MiniFold, and with int8 quantization.

Development assistance provided by Claude Code (Anthropic). The MLX port, SGMM Metal kernel, use of RMSNorm, and int8 quantization pipeline were developed, through iterations and with careful benchmarking, with the aid of Claude Sonnet 4.6.

License

MIT License, following MiniFold. See LICENSE for details.

Metadata

Release files for minifold-mlx 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minifold-mlx 0.1.0
File Size Uploaded Provenance Actions
minifold_mlx-0.1.0.tar.gz 57.3 kB Without provenance Details for minifold_mlx-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for minifold-mlx 0.1.0
File Interpreter ABI Platform Actions
minifold_mlx-0.1.0-py3-none-any.whl Python 3 none any Details for minifold_mlx-0.1.0-py3-none-any.whl

Total release size: 120.7 kB

Release files / minifold_mlx-0.1.0.tar.gz

Download URL minifold_mlx-0.1.0.tar.gz
Size 57.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0990ba2dec73159393b0b477caecc66c97ff7345ef29e60dfc45eda6f4050114
BLAKE2b-256 checksum
How to use checksums
d9756e44e079e3a410fec5d689af13e79f05218aaa5a8413227e64b4824bc56f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release files / minifold_mlx-0.1.0-py3-none-any.whl

Download URL minifold_mlx-0.1.0-py3-none-any.whl
Size 63.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36323f279cab033b99e9523ddae964523aeb55aab2c38b0d85081d1f660bc5d7
BLAKE2b-256 checksum
How to use checksums
65e19f4b756b1414875494b79ea9f5dae0024186a6734fa0a26167eadc6ed34f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Security for minifold-mlx 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page