* test: bootstrap mypy + pytest + coverage CI gates Wire up the tooling the upcoming test/annotation/refactor work depends on: - Add mypy>=1.13 to [dev] and a lenient [tool.mypy] config scoped to src/foundry + src/foundry_cli (ignore_missing_imports, no disallow_untyped_defs). The 14 modules with pre-existing type errors are pinned via [[tool.mypy.overrides]] ignore_errors=true and listed as the ratchet target — fix and remove, never add. - Add [tool.pytest.ini_options] (testpaths=["tests"], --strict-markers --strict-config) and [tool.coverage.*] (source = src/foundry + src/foundry_cli, branch = true) for opt-in gap finding. - Add .github/workflows/test.yaml with mypy and pytest jobs running on the same triggers as lint_production.yaml. Top-level tests/ only; per-model tests under models/*/tests/ may require GPU and checkpoints and stay out of CI for now. Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu> * test(mypy): extend ignore list with 4 modules CI surfaced Local sanity-check ran mypy without foundry installed, so torch / lightning resolved to `Any` and errors that depend on knowing those types stayed invisible. First CI run installed the full deps and surfaced 6 errors in 4 additional modules: foundry.model.layers.blocks foundry.training.schedulers foundry.utils.logging foundry.utils.xpu.xpu_accelerator Same ratchet contract as the original 14: do not add, only remove (after fixing the errors and removing `ignore_errors = true`). Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu> * style: ruff format 2 pre-existing files unrelated to bootstrap These files have been failing `ruff format --check` on production HEAD (merged via #275 and #281 without a pre-commit run). They block the existing `lint_production` workflow on every PR, including this bootstrap. Strictly out of scope for 0001 — kept in a separate commit so it can be cherry-picked or reverted cleanly. models/rfd3/src/rfd3/inference/input_parsing.py models/rfd3/tests/test_partial_diffusion.py No semantic changes — `ruff format` output only. Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu> * ci: run test workflow on all pull requests Drop the base-branch filter on the pull_request trigger so PRs targeting stacked task branches are gated too, not only PRs into the mainline branches. Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu> * Update test.yaml to remove pull_request_target Removed pull_request_target event from workflow. --------- Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu> Co-authored-by: Sergey Lyskov <3302736+lyskov@users.noreply.github.com>
Protein design with Foundry
Foundry provides tooling and infrastructure for using and training all classes of models for protein design, including design (RFD3), inverse folding (ProteinMPNN) and protein folding (RF3).
All models within Foundry rely on AtomWorks - a unified framework for manipulating and processing biomolecular structures - for both training and inference.
Note
We have a slack now! Join for updates and to get your questions answered here.
Getting Started
Quickstart guide
Installation
pip install "rc-foundry[all]"
Intel XPU Installation
For Intel XPU devices, install PyTorch with XPU support first, then install Foundry.
pip install torch --index-url https://download.pytorch.org/whl/xpu
pip install "rc-foundry[all]"
Note
Use
pip(notuv) for XPU installs since UV re-resolves dependencies and may replace your XPU torch with the standard PyPI version.
macOS (Apple Silicon) Installation
MPS support is available via a community fork. Install PyTorch first, then install directly from the fork:
pip install torch
pip install "rc-foundry[all] @ git+https://github.com/fnachon/foundry.git"
All three models — RFD3, RF3, and ProteinMPNN/LigandMPNN — run on Apple Silicon MPS.
Note
- The
rf3extra (cuEquivariance) is Linux-only and is automatically skipped on macOS.- Use
float32precision —bfloat16is not supported on MPS. The MPS accelerator is selected and float32 precision is enforced automatically.- Inference only; multi-GPU training is not supported on MPS.
- For
rf3 fold, pass an absolute path to the input CIF file.
Downloading weights Models can be downloaded to a target folder with:
foundry install base-models --checkpoint-dir <path/to/ckpt/dir>
where checkpoint-dir will be ~/.foundry/checkpoints by default. Foundry always searches ~/.foundry/checkpoints plus any colon-separated entries in $FOUNDRY_CHECKPOINT_DIRS during inference or subsequent commands to find checkpoints. base-models installs the latest RFD3, RF3 and MPNN variants - you can also download all of the models supported (including multiple checkpoints of RF3) with all, or by listing the models sequentially (e.g. foundry install rfd3 rf3 ...).
To list the registry of available checkpoints:
foundry list-available
To check what you already have downloaded (searches ~/.foundry/checkpoints plus $FOUNDRY_CHECKPOINT_DIRS if set):
foundry list-installed
See
examples/all.ipynbfor how to run each model and design proteins end-to-end in a notebook.
Docker Image
There is an official Foundry image maintained by the Rosetta Commons. The default image comes with the model weights for the available models, but you can use the slim tag to either use pre-exiting model weights or use the image to download the available model weights.
For more information and example syntax, see the Overview on DockerHub.
The recipe to create the Docker image can be found in foundry/examples/docker and can be used as a "blue-print" for creating your own images.
Google Colab
For an interactive Google Colab notebook walking through a basic design pipeline with RFD3, MPNN, and RF3, please see the IPD Design Pipeline Tutorial.
RFdiffusion3 (RFD3)
RFdiffusion3 is an all-atom generative model capable of designing protein structures under complex constraints.
See models/rfd3/README.md for complete documentation.
RFdiffusion3NA (RFD3NA)
RFdiffusion3NA is an extension of RFDiffusion3 capable of designing also nucleic acid structures under complex constraints.
See models/rfd3na/README.md for complete documentation.
RosettaFold3 (RF3)
RF3 is a structure prediction neural network that narrows the gap between closed-source AF-3 and open-source alternatives.
See models/rf3/README.md for complete documentation.
ProteinMPNN
ProteinMPNN and LigandMPNN are lightweight inverse-folding models which can be use to design diverse sequences for backbones under constrained conditions.
See models/mpnn/README.md for complete documentation.
Development
Code Organization
Strict dependency flow: foundry → atomworks
- atomworks: Structure I/O, preprocessing, featurization
- foundry: Model architectures, training, inference endpoints
- models/<model>: Released models.
For Core Developers (Multiple Packages)
Install both foundry and models in editable mode for development:
uv pip install -e '.[all,dev]'
This approach allows you to:
- Modify
foundryshared utilities and see changes immediately - Work on specific models without installing all models
- Add new models as independent packages in
models/
Note
Running tests is not currently supported, test files may be missing.
Adding New Models
To add a new model:
- Create
models/<model_name>/directory with its ownpyproject.toml - Add
foundryas a dependency - Implement model-specific code in
models/<model_name>/src/ - Users can install with:
uv pip install -e ./models/<model_name>
Pre-commit Formatting
We ship a .pre-commit-config.yaml that runs make format (via ruff format) before each commit. Enable it once per clone:
pip install pre-commit # if not already installed
pre-commit install
After installation the hook automatically formats the repo whenever you git commit. Use pre-commit run --all-files to apply it manually.
Citation
If you use this repository code or data in your work, please cite the relavant work as below:
@article{corley2025accelerating,
title={Accelerating biomolecular modeling with atomworks and rf3},
author={Corley, Nathaniel and Mathis, Simon and Krishna, Rohith and Bauer, Magnus S and Thompson, Tuscan R and Ahern, Woody and Kazman, Maxwell W and Brent, Rafael I and Didi, Kieran and Kubaney, Andrew and others},
journal={bioRxiv},
year={2025}
}
@article {butcher2025_rfdiffusion3,
author = {Butcher, Jasper and Krishna, Rohith and Mitra, Raktim and Brent, Rafael Isaac and Li, Yanjing and Corley, Nathaniel and Kim, Paul T and Funk, Jonathan and Mathis, Simon Valentin and Salike, Saman and Muraishi, Aiko and Eisenach, Helen and Thompson, Tuscan Rock and Chen, Jie and Politanska, Yuliya and Sehgal, Enisha and Coventry, Brian and Zhang, Odin and Qiang, Bo and Didi, Kieran and Kazman, Maxwell and DiMaio, Frank and Baker, David},
title = {De novo Design of All-atom Biomolecular Interactions with RFdiffusion3},
elocation-id = {2025.09.18.676967},
year = {2025},
doi = {10.1101/2025.09.18.676967},
publisher = {Cold Spring Harbor Laboratory},
URL = {https://www.biorxiv.org/content/early/2025/11/19/2025.09.18.676967},
eprint = {https://www.biorxiv.org/content/early/2025/11/19/2025.09.18.676967.full.pdf},
journal = {bioRxiv}
}
@article{dauparas2022robust,
title={Robust deep learning--based protein sequence design using ProteinMPNN},
author={Dauparas, Justas and Anishchenko, Ivan and Bennett, Nathaniel and Bai, Hua and Ragotte, Robert J and Milles, Lukas F and Wicky, Basile IM and Courbet, Alexis and de Haas, Rob J and Bethel, Neville and others},
journal={Science},
volume={378},
number={6615},
pages={49--56},
year={2022},
publisher={American Association for the Advancement of Science}
}
@article{dauparas2025atomic,
title={Atomic context-conditioned protein sequence design using LigandMPNN},
author={Dauparas, Justas and Lee, Gyu Rie and Pecoraro, Robert and An, Linna and Anishchenko, Ivan and Glasscock, Cameron and Baker, David},
journal={Nature Methods},
pages={1--7},
year={2025},
publisher={Nature Publishing Group US New York}
}
Acknowledgments
We thank Rachel Clune and Hope Woods from the RosettaCommons for their collaboration on the codebase, documentation, tutorials and examples.


