boltz-community 2.10.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. boltz_community-2.10.8/LICENSE +21 -0
  2. boltz_community-2.10.8/PKG-INFO +305 -0
  3. boltz_community-2.10.8/README.md +245 -0
  4. boltz_community-2.10.8/pyproject.toml +132 -0
  5. boltz_community-2.10.8/setup.cfg +4 -0
  6. boltz_community-2.10.8/src/boltz/__init__.py +9 -0
  7. boltz_community-2.10.8/src/boltz/data/__init__.py +0 -0
  8. boltz_community-2.10.8/src/boltz/data/const.py +1184 -0
  9. boltz_community-2.10.8/src/boltz/data/crop/__init__.py +0 -0
  10. boltz_community-2.10.8/src/boltz/data/crop/affinity.py +164 -0
  11. boltz_community-2.10.8/src/boltz/data/crop/boltz.py +296 -0
  12. boltz_community-2.10.8/src/boltz/data/crop/cropper.py +45 -0
  13. boltz_community-2.10.8/src/boltz/data/feature/__init__.py +0 -0
  14. boltz_community-2.10.8/src/boltz/data/feature/featurizer.py +1372 -0
  15. boltz_community-2.10.8/src/boltz/data/feature/featurizerv2.py +2475 -0
  16. boltz_community-2.10.8/src/boltz/data/feature/symmetry.py +602 -0
  17. boltz_community-2.10.8/src/boltz/data/filter/__init__.py +0 -0
  18. boltz_community-2.10.8/src/boltz/data/filter/dynamic/__init__.py +0 -0
  19. boltz_community-2.10.8/src/boltz/data/filter/dynamic/date.py +76 -0
  20. boltz_community-2.10.8/src/boltz/data/filter/dynamic/filter.py +24 -0
  21. boltz_community-2.10.8/src/boltz/data/filter/dynamic/max_residues.py +37 -0
  22. boltz_community-2.10.8/src/boltz/data/filter/dynamic/resolution.py +34 -0
  23. boltz_community-2.10.8/src/boltz/data/filter/dynamic/size.py +38 -0
  24. boltz_community-2.10.8/src/boltz/data/filter/dynamic/subset.py +42 -0
  25. boltz_community-2.10.8/src/boltz/data/filter/static/__init__.py +0 -0
  26. boltz_community-2.10.8/src/boltz/data/filter/static/filter.py +26 -0
  27. boltz_community-2.10.8/src/boltz/data/filter/static/ligand.py +37 -0
  28. boltz_community-2.10.8/src/boltz/data/filter/static/polymer.py +300 -0
  29. boltz_community-2.10.8/src/boltz/data/module/__init__.py +0 -0
  30. boltz_community-2.10.8/src/boltz/data/module/inference.py +307 -0
  31. boltz_community-2.10.8/src/boltz/data/module/inferencev2.py +433 -0
  32. boltz_community-2.10.8/src/boltz/data/module/training.py +693 -0
  33. boltz_community-2.10.8/src/boltz/data/module/trainingv2.py +670 -0
  34. boltz_community-2.10.8/src/boltz/data/mol.py +916 -0
  35. boltz_community-2.10.8/src/boltz/data/msa/__init__.py +0 -0
  36. boltz_community-2.10.8/src/boltz/data/msa/mmseqs2.py +286 -0
  37. boltz_community-2.10.8/src/boltz/data/pad.py +84 -0
  38. boltz_community-2.10.8/src/boltz/data/parse/__init__.py +0 -0
  39. boltz_community-2.10.8/src/boltz/data/parse/a3m.py +144 -0
  40. boltz_community-2.10.8/src/boltz/data/parse/csv.py +101 -0
  41. boltz_community-2.10.8/src/boltz/data/parse/fasta.py +137 -0
  42. boltz_community-2.10.8/src/boltz/data/parse/mmcif.py +1272 -0
  43. boltz_community-2.10.8/src/boltz/data/parse/mmcif_with_constraints.py +1617 -0
  44. boltz_community-2.10.8/src/boltz/data/parse/pdb.py +39 -0
  45. boltz_community-2.10.8/src/boltz/data/parse/schema.py +1999 -0
  46. boltz_community-2.10.8/src/boltz/data/parse/yaml.py +67 -0
  47. boltz_community-2.10.8/src/boltz/data/sample/__init__.py +0 -0
  48. boltz_community-2.10.8/src/boltz/data/sample/cluster.py +283 -0
  49. boltz_community-2.10.8/src/boltz/data/sample/distillation.py +57 -0
  50. boltz_community-2.10.8/src/boltz/data/sample/random.py +39 -0
  51. boltz_community-2.10.8/src/boltz/data/sample/sampler.py +49 -0
  52. boltz_community-2.10.8/src/boltz/data/tokenize/__init__.py +0 -0
  53. boltz_community-2.10.8/src/boltz/data/tokenize/boltz.py +217 -0
  54. boltz_community-2.10.8/src/boltz/data/tokenize/boltz2.py +426 -0
  55. boltz_community-2.10.8/src/boltz/data/tokenize/tokenizer.py +24 -0
  56. boltz_community-2.10.8/src/boltz/data/types.py +822 -0
  57. boltz_community-2.10.8/src/boltz/data/write/__init__.py +0 -0
  58. boltz_community-2.10.8/src/boltz/data/write/mmcif.py +526 -0
  59. boltz_community-2.10.8/src/boltz/data/write/pdb.py +161 -0
  60. boltz_community-2.10.8/src/boltz/data/write/utils.py +23 -0
  61. boltz_community-2.10.8/src/boltz/data/write/writer.py +448 -0
  62. boltz_community-2.10.8/src/boltz/main.py +1843 -0
  63. boltz_community-2.10.8/src/boltz/model/__init__.py +0 -0
  64. boltz_community-2.10.8/src/boltz/model/layers/__init__.py +0 -0
  65. boltz_community-2.10.8/src/boltz/model/layers/attention.py +133 -0
  66. boltz_community-2.10.8/src/boltz/model/layers/attentionv2.py +130 -0
  67. boltz_community-2.10.8/src/boltz/model/layers/confidence_utils.py +302 -0
  68. boltz_community-2.10.8/src/boltz/model/layers/dropout.py +34 -0
  69. boltz_community-2.10.8/src/boltz/model/layers/initialize.py +100 -0
  70. boltz_community-2.10.8/src/boltz/model/layers/outer_product_mean.py +98 -0
  71. boltz_community-2.10.8/src/boltz/model/layers/pair_averaging.py +135 -0
  72. boltz_community-2.10.8/src/boltz/model/layers/pairformer.py +361 -0
  73. boltz_community-2.10.8/src/boltz/model/layers/relative.py +58 -0
  74. boltz_community-2.10.8/src/boltz/model/layers/transition.py +78 -0
  75. boltz_community-2.10.8/src/boltz/model/layers/triangular_attention/__init__.py +0 -0
  76. boltz_community-2.10.8/src/boltz/model/layers/triangular_attention/attention.py +201 -0
  77. boltz_community-2.10.8/src/boltz/model/layers/triangular_attention/primitives.py +501 -0
  78. boltz_community-2.10.8/src/boltz/model/layers/triangular_attention/utils.py +380 -0
  79. boltz_community-2.10.8/src/boltz/model/layers/triangular_mult.py +256 -0
  80. boltz_community-2.10.8/src/boltz/model/loss/__init__.py +0 -0
  81. boltz_community-2.10.8/src/boltz/model/loss/bfactor.py +51 -0
  82. boltz_community-2.10.8/src/boltz/model/loss/confidence.py +590 -0
  83. boltz_community-2.10.8/src/boltz/model/loss/confidencev2.py +622 -0
  84. boltz_community-2.10.8/src/boltz/model/loss/diffusion.py +172 -0
  85. boltz_community-2.10.8/src/boltz/model/loss/diffusionv2.py +140 -0
  86. boltz_community-2.10.8/src/boltz/model/loss/distogram.py +48 -0
  87. boltz_community-2.10.8/src/boltz/model/loss/distogramv2.py +107 -0
  88. boltz_community-2.10.8/src/boltz/model/loss/validation.py +1021 -0
  89. boltz_community-2.10.8/src/boltz/model/models/__init__.py +0 -0
  90. boltz_community-2.10.8/src/boltz/model/models/boltz1.py +1306 -0
  91. boltz_community-2.10.8/src/boltz/model/models/boltz2.py +1280 -0
  92. boltz_community-2.10.8/src/boltz/model/modules/__init__.py +0 -0
  93. boltz_community-2.10.8/src/boltz/model/modules/affinity.py +223 -0
  94. boltz_community-2.10.8/src/boltz/model/modules/confidence.py +488 -0
  95. boltz_community-2.10.8/src/boltz/model/modules/confidence_utils.py +181 -0
  96. boltz_community-2.10.8/src/boltz/model/modules/confidencev2.py +501 -0
  97. boltz_community-2.10.8/src/boltz/model/modules/diffusion.py +863 -0
  98. boltz_community-2.10.8/src/boltz/model/modules/diffusion_conditioning.py +116 -0
  99. boltz_community-2.10.8/src/boltz/model/modules/diffusionv2.py +743 -0
  100. boltz_community-2.10.8/src/boltz/model/modules/encoders.py +639 -0
  101. boltz_community-2.10.8/src/boltz/model/modules/encodersv2.py +565 -0
  102. boltz_community-2.10.8/src/boltz/model/modules/transformers.py +321 -0
  103. boltz_community-2.10.8/src/boltz/model/modules/transformersv2.py +262 -0
  104. boltz_community-2.10.8/src/boltz/model/modules/trunk.py +680 -0
  105. boltz_community-2.10.8/src/boltz/model/modules/trunkv2.py +850 -0
  106. boltz_community-2.10.8/src/boltz/model/modules/utils.py +316 -0
  107. boltz_community-2.10.8/src/boltz/model/optim/__init__.py +0 -0
  108. boltz_community-2.10.8/src/boltz/model/optim/ema.py +389 -0
  109. boltz_community-2.10.8/src/boltz/model/optim/scheduler.py +99 -0
  110. boltz_community-2.10.8/src/boltz/model/potentials/__init__.py +0 -0
  111. boltz_community-2.10.8/src/boltz/model/potentials/potentials.py +817 -0
  112. boltz_community-2.10.8/src/boltz/model/potentials/schedules.py +37 -0
  113. boltz_community-2.10.8/src/boltz_community.egg-info/PKG-INFO +305 -0
  114. boltz_community-2.10.8/src/boltz_community.egg-info/SOURCES.txt +126 -0
  115. boltz_community-2.10.8/src/boltz_community.egg-info/dependency_links.txt +1 -0
  116. boltz_community-2.10.8/src/boltz_community.egg-info/entry_points.txt +2 -0
  117. boltz_community-2.10.8/src/boltz_community.egg-info/requires.txt +34 -0
  118. boltz_community-2.10.8/src/boltz_community.egg-info/top_level.txt +1 -0
  119. boltz_community-2.10.8/tests/test_a3m.py +129 -0
  120. boltz_community-2.10.8/tests/test_affinity.py +131 -0
  121. boltz_community-2.10.8/tests/test_cli.py +403 -0
  122. boltz_community-2.10.8/tests/test_determinism.py +119 -0
  123. boltz_community-2.10.8/tests/test_inference_smoke.py +248 -0
  124. boltz_community-2.10.8/tests/test_mps.py +161 -0
  125. boltz_community-2.10.8/tests/test_regression.py +128 -0
  126. boltz_community-2.10.8/tests/test_regression_v2.py +279 -0
  127. boltz_community-2.10.8/tests/test_utils.py +22 -0
  128. boltz_community-2.10.8/tests/test_writer.py +308 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Jeremy Wohlwend, Gabriele Corso, Saro Passaro
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,305 @@
1
+ Metadata-Version: 2.4
2
+ Name: boltz-community
3
+ Version: 2.10.8
4
+ Summary: Community-maintained fork of Boltz with bug fixes, broader compatibility, and CI
5
+ Author: Jeremy Wohlwend, Gabriele Corso, Saro Passaro
6
+ Maintainer: boltz-community contributors
7
+ Maintainer-email: Andrei Volgin <a.volgin@noveltherapeutics.ai>
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/Novel-Therapeutics/boltz-community
10
+ Project-URL: Source, https://github.com/Novel-Therapeutics/boltz-community
11
+ Project-URL: Issues, https://github.com/Novel-Therapeutics/boltz-community/issues
12
+ Project-URL: Changelog, https://github.com/Novel-Therapeutics/boltz-community/releases
13
+ Project-URL: Upstream, https://github.com/jwohlwend/boltz
14
+ Keywords: protein-structure-prediction,molecular-modeling,alphafold,biology,drug-discovery,deep-learning
15
+ Classifier: Development Status :: 5 - Production/Stable
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Classifier: Operating System :: OS Independent
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: torch>=2.2
29
+ Requires-Dist: numpy>=1.26
30
+ Requires-Dist: hydra-core>=1.3.2
31
+ Requires-Dist: pytorch-lightning>=2.5.0
32
+ Requires-Dist: rdkit>=2024.3.2
33
+ Requires-Dist: dm-tree>=0.1.8
34
+ Requires-Dist: requests>=2.32.3
35
+ Requires-Dist: pandas>=2.2.2
36
+ Requires-Dist: types-requests
37
+ Requires-Dist: einops>=0.8.0
38
+ Requires-Dist: einx>=0.3.0
39
+ Requires-Dist: mashumaro>=3.14
40
+ Requires-Dist: modelcif>=1.2
41
+ Requires-Dist: wandb>=0.18.7
42
+ Requires-Dist: click>=8.1.7
43
+ Requires-Dist: pyyaml>=6.0.2
44
+ Requires-Dist: biopython>=1.84
45
+ Requires-Dist: scipy>=1.13.1
46
+ Requires-Dist: numba>=0.61.0
47
+ Requires-Dist: gemmi>=0.6.5
48
+ Requires-Dist: scikit-learn>=1.6.1
49
+ Requires-Dist: chembl_structure_pipeline>=1.2.2
50
+ Provides-Extra: lint
51
+ Requires-Dist: ruff; extra == "lint"
52
+ Provides-Extra: test
53
+ Requires-Dist: pytest; extra == "test"
54
+ Requires-Dist: requests; extra == "test"
55
+ Provides-Extra: cuda
56
+ Requires-Dist: cuequivariance_ops_cu12>=0.5.0; extra == "cuda"
57
+ Requires-Dist: cuequivariance_ops_torch_cu12>=0.5.0; extra == "cuda"
58
+ Requires-Dist: cuequivariance_torch>=0.5.0; extra == "cuda"
59
+ Dynamic: license-file
60
+
61
+ # boltz-community
62
+
63
+ Community-maintained fork of [Boltz](https://github.com/jwohlwend/boltz) with bug fixes, broader compatibility, and CI.
64
+
65
+ ## What's different from upstream?
66
+
67
+ **Compatibility:**
68
+ - Apple Silicon (MPS) support: `boltz predict --accelerator mps`
69
+ - Dependency pins relaxed from `==` to `>=`
70
+ - `fairscale` dependency removed — replaced with PyTorch built-in `torch.utils.checkpoint`
71
+ - `numpy<2.0` cap removed
72
+ - `requires-python` widened to `>=3.10` (removed `<3.13` cap)
73
+ - Compatible with PyTorch 2.6+ and Lightning 2.6+
74
+
75
+ **Bug fixes:**
76
+ - Fixed ROCm DDP crashes by allocating tensors directly on the target device instead of CPU-then-move ([#654](https://github.com/jwohlwend/boltz/pull/654))
77
+ - Fixed `--write_full_pae` and `--write_full_pde` being ignored, and added matching `--no_write_full_pae` and `--no_write_full_pde` flags ([#602](https://github.com/jwohlwend/boltz/pull/602))
78
+ - Fixed MSA CSV parsing removing paired duplicate sequences across different taxa ([#584](https://github.com/jwohlwend/boltz/pull/584))
79
+ - Fixed MSA feature construction incorrectly including paired sequences as unpaired ([#582](https://github.com/jwohlwend/boltz/pull/582))
80
+ - Fixed consecutive CA filter rejecting valid protein chains containing metal ions ([#576](https://github.com/jwohlwend/boltz/pull/576))
81
+ - Fixed template alignment forcing gapless matches, breaking templates with indels ([#538](https://github.com/jwohlwend/boltz/pull/538))
82
+ - Fixed relative MSA paths resolved from CWD instead of input file directory ([#500](https://github.com/jwohlwend/boltz/pull/500))
83
+ - Fixed MSA authentication headers forcing `Content-Type`, which breaks some MSA servers ([#488](https://github.com/jwohlwend/boltz/pull/488))
84
+ - Fixed CLI help/default mismatches and added option validation for MSA pairing strategy ([#463](https://github.com/jwohlwend/boltz/pull/463))
85
+ - Fixed sign error in binding energy calculation documentation ([#363](https://github.com/jwohlwend/boltz/pull/363))
86
+ - Fixed broken v1 attention code path in `PairformerLayer` ([#602](https://github.com/jwohlwend/boltz/pull/602))
87
+ - Fixed SIGSEGV crash on ligands with invalid implicit valence ([#649](https://github.com/jwohlwend/boltz/issues/649))
88
+ - Fixed `--subsample_msa` defaulting to False instead of True ([#628](https://github.com/jwohlwend/boltz/issues/628))
89
+ - Fixed 2-char elements (Ca, Fe, Br, Cl) misidentified in PDB/mmCIF output ([#458](https://github.com/jwohlwend/boltz/issues/458))
90
+ - Fixed atom name overflow (>4 chars) crashing large molecule processing ([#494](https://github.com/jwohlwend/boltz/issues/494))
91
+ - Fixed null bytes in A3M files crashing MSA parsing ([#509](https://github.com/jwohlwend/boltz/issues/509))
92
+ - Fixed bfloat16 dtype mismatch in potentials ([#625](https://github.com/jwohlwend/boltz/issues/625))
93
+ - Fixed CCD tar re-download on every run when `mols/` already exists ([#633](https://github.com/jwohlwend/boltz/issues/633))
94
+ - Fixed empty CIF files causing cryptic errors ([#641](https://github.com/jwohlwend/boltz/issues/641))
95
+ - Fixed hardcoded "LIG" residue name in PDB HETATM records ([#630](https://github.com/jwohlwend/boltz/issues/630))
96
+ - Fixed mmCIF entity deduplication for chemically distinct ligands ([#630](https://github.com/jwohlwend/boltz/issues/630))
97
+ - Fixed chirality constraint computation missing stereo assignment ([#589](https://github.com/jwohlwend/boltz/issues/589))
98
+ - Fixed multi-CCD ligands not dropping leaving atoms ([#631](https://github.com/jwohlwend/boltz/issues/631))
99
+ - Fixed `--preprocessing-threads` overcommitting CPUs ([#564](https://github.com/jwohlwend/boltz/issues/564))
100
+ - Fixed silent wrong-answer bug: inference `__getitem__` no longer substitutes a different record on failure — errors now propagate
101
+ - Fixed potential stack overflow in training/validation data loading via bounded retry (max 10 attempts)
102
+ - Fixed `boltz predict` exiting silently with code 0 when all inputs fail validation (e.g. requesting affinity for a protein chain)
103
+ - Fixed MSA pairing keys lost when loading cached A3M files ([#627](https://github.com/jwohlwend/boltz/issues/627))
104
+ - Fixed affinity prediction crashing when structure prediction fails (e.g. covalent ligands, OOM) — now skips affected records with a warning ([#620](https://github.com/jwohlwend/boltz/issues/620), [#624](https://github.com/jwohlwend/boltz/issues/624))
105
+ - Fixed affinity prediction for repeated ligand binders: inputs that request affinity for one copy of a repeated ligand entity no longer fail, and affinity is now reported per binder copy as `affinity_<record>_<chain>.json` ([#647](https://github.com/jwohlwend/boltz/issues/647))
106
+ - Fixed Boltz-2 checkpoint loading crash due to extra `mse_rotational_alignment` kwarg ([#644](https://github.com/jwohlwend/boltz/issues/644))
107
+ - Fixed direct Boltz-2 model use from checkpoint hyperparameters crashing during sampling when `steering_args` is missing ([#680](https://github.com/jwohlwend/boltz/issues/680))
108
+ - Fixed empty checkpoint files causing cryptic `load_from_checkpoint` aborts — now re-downloads empty cached weights and raises a clear error before model load ([#664](https://github.com/jwohlwend/boltz/issues/664))
109
+ - Fixed CPU inference producing distorted structures with wrong bond lengths — Boltz-2 was incorrectly using `bf16-mixed` precision on CPU; now forces float32 ([#653](https://github.com/jwohlwend/boltz/issues/653))
110
+ - Fixed missing PAE summaries in `confidence_*.json` — aggregated `complex_pae`, `complex_ipae`, `chains_pae`, and `pair_chains_pae` are now included, remain available with `--no_write_full_pae`, use contact-weighted aggregation like PDE, and write undefined values as `null` ([#607](https://github.com/jwohlwend/boltz/issues/607))
111
+ - Fixed cuequivariance triangle multiplication kernel crashes by falling back to PyTorch when kernels are unavailable or unsupported ([#485](https://github.com/jwohlwend/boltz/issues/485), with thanks to [#682](https://github.com/jwohlwend/boltz/pull/682))
112
+ - Fixed cuequivariance triangle attention kernel crashes by falling back to PyTorch when kernels are unavailable or unsupported — extends the v2.10.3 fix to the triangle attention path that was missed ([#485](https://github.com/jwohlwend/boltz/issues/485))
113
+ - Fixed forced contact restraints losing all signal when union weighting underflowed for large distance violations ([#621](https://github.com/jwohlwend/boltz/issues/621), with thanks to [#682](https://github.com/jwohlwend/boltz/pull/682))
114
+ - Fixed incorrect contact-union gradient sign so soft-OR contact restraints apply gradient pressure with the correct magnitude across union members
115
+ - Fixed diffusion sampling ignoring `--max_parallel_samples` in divisible cases (for example `10` samples with a parallel limit of `5`), which could batch everything into one large chunk and trigger avoidable OOMs
116
+ - Fixed MSA discarded as "does not match input sequence" when pre-computed MSAs are aligned to a full UniProt sequence but the input uses a shorter PDB construct — Boltz now finds the construct as a contiguous subsequence within the MSA query and trims all MSA rows accordingly, instead of falling back to a dummy single-sequence MSA. Tolerates up to 5% mismatches (selenomethionine substitutions, expression tags, minor construct mutations). Applies to both Boltz-1 and Boltz-2.
117
+ - Fixed PDB templates crashing with `IndexError: list index out of range` when Gemmi drops entity sequence metadata during PDB→mmCIF conversion — template parsing now falls back to the observed polymer residues, and relative template `pdb`/`cif` paths are resolved from the YAML file directory instead of the current working directory ([#669](https://github.com/jwohlwend/boltz/issues/669))
118
+ - Fixed YAML `bond` constraints for custom cross-residue covalent bonds (for example ACE-CY3 cyclization) missing atom-level bond-length bounds for physical guidance and `_struct_conn` records in mmCIF output ([#675](https://github.com/jwohlwend/boltz/issues/675))
119
+ - Fixed Boltz-2 fine-tuning/validation crashes when downstream methods read `self.validate_structure`; the constructor now stores the `validate_structure` argument on the model ([novel-therapeutics/boltz-community#11](https://github.com/Novel-Therapeutics/boltz-community/issues/11))
120
+ - Fixed training-data preprocessing: `scripts/process/rcsb.py` was looking up clusters by `pdb_id_entity_id` while `scripts/process/cluster.py` keys its output by `hash_sequence(seq)` (proteins/RNA/short polymers) or by CCD code (ligands), so every chain silently got `cluster_id=-1` and `ClusterSampler` weighted everything uniformly. Records also had `msa_id=""` for protein chains, so training silently ran with no MSA features. Both fields are now populated correctly, and `entity_id` is propagated through to the record ([#686](https://github.com/jwohlwend/boltz/issues/686)). Does not affect inference; users who trained or fine-tuned with the documented pipeline need to re-preprocess and re-train.
121
+ - Fixed affinity prediction running 5× slower than necessary: upstream hardcoded `max_parallel_samples=1` for the affinity diffusion path, which was silently masked by upstream's buggy `chunk(multiplicity % max + 1)` math (the divisible case collapsed to `chunk(1)`, batching all samples in one pass). When our earlier diffusion fix replaced that with the correct `split(max_parallel_samples)`, the hardcoded `1` started to actually take effect, forcing N sequential single-sample forward passes per affinity record. The affinity path now honors the user's `--max_parallel_samples`, capped at `--diffusion_samples_affinity` so it doesn't claim more parallelism than diffusion will run.
122
+
123
+ **Improvements:**
124
+ - Published to PyPI as [`boltz-community`](https://pypi.org/project/boltz-community/) — `pip install boltz-community` and `uv add boltz-community` now work without the git URL ([#12](https://github.com/Novel-Therapeutics/boltz-community/issues/12)). Releases are tag-driven via GitHub Actions + PyPI Trusted Publisher (OIDC, no long-lived tokens).
125
+ - Added `--skip_bad_inputs` flag: by default `boltz predict` now aborts when any input fails processing; pass `--skip_bad_inputs` to skip bad inputs and continue with the rest
126
+ - Deferred heavy imports (torch, rdkit, pytorch-lightning) so `boltz.main` loads instantly for CLI help and input validation
127
+ - `--devices` now accepts a comma-separated list of specific GPU device IDs in addition to a device count (e.g. `--devices 0,1` targets GPUs 0 and 1; use `CUDA_VISIBLE_DEVICES=1 boltz predict ...` to target a single GPU by index)
128
+ - Added `--batch_size` for Boltz-2 structure inference so multiple inputs can be processed per prediction batch. Current limits: affinity prediction remains single-record (`batch_size=1`), and guided inference (`--use_potentials` / contact guidance) is only supported with `--batch_size 1`
129
+
130
+ **Performance improvements:**
131
+ - Added optional FlashAttention-2 / PyTorch SDPA acceleration for triangle attention and pair-biased attention via `--flash_attn` (off by default). Reduces attention memory footprint and speeds up inference on Ampere+ GPUs while remaining numerically equivalent to the manual einsum path within float-precision tolerance (verified by parity tests)
132
+ - Model weights now load directly to GPU instead of CPU-then-transfer
133
+ - Cached molecule file reads and symmetry deserialization across samples
134
+ - Removed dead O(n_tokens × n_chains) loop in pocket distance computation
135
+ - Tensors across model modules now allocated directly on device instead of CPU-then-transfer ([#654](https://github.com/jwohlwend/boltz/pull/654))
136
+ - Featurizer MSA pairing fill rewritten with vectorized numpy indexing (eliminates per-row Python loop)
137
+ - `process_atom_features` pre-allocates output arrays and fills `atom_to_token` in one slice per token (eliminates per-atom appends)
138
+
139
+ **Tests & CI:**
140
+ - 283 tests in this fork vs. 5 tests in current upstream `jwohlwend/boltz`: unit tests (CPU), smoke tests (end-to-end inference), regression tests (golden output verification for Boltz-1 and Boltz-2), determinism tests, MSA trim subsequence matching (8 cases), diffusion chunking regression tests, Boltz-2 validation constructor coverage, and featurizer pre-allocation correctness
141
+ - GitHub Actions CI with CPU runners (every push/PR) and GPU T4 runners (push to main)
142
+
143
+ ## Contributing
144
+
145
+ Pull requests are welcome! If you have a bug fix, test improvement, or compatibility enhancement, please open a PR.
146
+
147
+ ## Installation
148
+
149
+ Install from PyPI:
150
+
151
+ ```
152
+ pip install boltz-community
153
+ ```
154
+
155
+ With CUDA kernels:
156
+
157
+ ```
158
+ pip install "boltz-community[cuda]"
159
+ ```
160
+
161
+ `uv` works the same way:
162
+
163
+ ```
164
+ uv add boltz-community # or: uv add "boltz-community[cuda]"
165
+ ```
166
+
167
+ If you are installing on CPU-only or non-CUDA GPU hardware, omit `[cuda]`. Note that the CPU version is significantly slower than the GPU version.
168
+
169
+ ### Installing the bleeding-edge `main` branch
170
+
171
+ ```
172
+ pip install "boltz-community @ git+https://github.com/Novel-Therapeutics/boltz-community.git"
173
+ ```
174
+
175
+ ### Apple Silicon (MPS)
176
+
177
+ On Macs with Apple Silicon, you can run inference on the GPU via MPS:
178
+
179
+ ```
180
+ boltz predict input.yaml --accelerator mps --use_msa_server
181
+ ```
182
+
183
+ MPS mode automatically uses float32 precision and single-device execution. Performance is slower than CUDA but significantly faster than CPU.
184
+
185
+ ## Releasing
186
+
187
+ Releases are tag-driven. Pushing a `v*.*.*` tag triggers [.github/workflows/release.yml](.github/workflows/release.yml), which builds the sdist + wheel, validates them with `twine check`, and publishes to PyPI via [PyPI Trusted Publisher](https://docs.pypi.org/trusted-publishers/) (OIDC) — no long-lived API token is stored in this repo.
188
+
189
+ ### One-time setup (PyPI side)
190
+
191
+ 1. Register the `boltz-community` package on PyPI (create as a new project; the name is currently available).
192
+ 2. Open the project's *Publishing* settings and add a Trusted Publisher with:
193
+ - **Owner:** `Novel-Therapeutics`
194
+ - **Repository:** `boltz-community`
195
+ - **Workflow filename:** `release.yml`
196
+ - **Environment:** `pypi`
197
+ 3. In the GitHub repo Settings → Environments, create an environment named `pypi`. Optionally add a required-reviewer rule so a publish has to be approved by a maintainer before the OIDC exchange runs.
198
+
199
+ ### Per-release flow
200
+
201
+ 1. Land all changes on `main`.
202
+ 2. Bump `version` in [pyproject.toml](pyproject.toml).
203
+ 3. Add a bullet under *Bug fixes* / *Improvements* / *Performance improvements* in this README. Update the test count if new tests landed.
204
+ 4. Commit as `Release X.Y.Z` and push `main`.
205
+ 5. Tag the release commit: `git tag -a vX.Y.Z -m "Release X.Y.Z" && git push origin vX.Y.Z`.
206
+ 6. The release workflow builds, checks, and publishes the artifacts to PyPI. Watch the run under the *Actions* tab.
207
+ 7. Create the GitHub release with the release notes (see prior releases for the *Highlights / Details / Commits since* structure).
208
+
209
+ ### Recovering from a failed publish
210
+
211
+ PyPI rejects re-uploading the same version. If the build succeeded but the publish step failed (e.g. environment approval timed out), you can re-run the *Publish to PyPI* job from the Actions tab without re-tagging. If a version is published but broken, **bump the patch and ship a new release** — never delete or yank without a follow-up that supersedes it.
212
+
213
+ ---
214
+
215
+ *Everything below is from the upstream Boltz README.*
216
+
217
+ ---
218
+
219
+ <div align="center">
220
+ <div>&nbsp;</div>
221
+ <img src="docs/boltz2_title.png" width="300"/>
222
+
223
+ [Boltz-1](https://doi.org/10.1101/2024.11.19.624167) | [Boltz-2](https://doi.org/10.1101/2025.06.14.659707) |
224
+ [Slack](https://boltz.bio/join-slack) <br> <br>
225
+ </div>
226
+
227
+
228
+
229
+ ![](docs/boltz1_pred_figure.png)
230
+
231
+
232
+ ## Introduction
233
+
234
+ Boltz is a family of models for biomolecular interaction prediction. Boltz-1 was the first fully open source model to approach AlphaFold3 accuracy. Our latest work Boltz-2 is a new biomolecular foundation model that goes beyond AlphaFold3 and Boltz-1 by jointly modeling complex structures and binding affinities, a critical component towards accurate molecular design. Boltz-2 is the first deep learning model to approach the accuracy of physics-based free-energy perturbation (FEP) methods, while running 1000x faster — making accurate in silico screening practical for early-stage drug discovery.
235
+
236
+ All the code and weights are provided under MIT license, making them freely available for both academic and commercial uses. For more information about the model, see the [Boltz-1](https://doi.org/10.1101/2024.11.19.624167) and [Boltz-2](https://doi.org/10.1101/2025.06.14.659707) technical reports. To discuss updates, tools and applications join our [Slack channel](https://boltz.bio/join-slack).
237
+
238
+ ## Inference
239
+
240
+ You can run inference using Boltz with:
241
+
242
+ ```
243
+ boltz predict input_path --use_msa_server
244
+ ```
245
+
246
+ `input_path` should point to a YAML file, or a directory of YAML files for batched processing, describing the biomolecules you want to model and the properties you want to predict (e.g. affinity). To see all available options: `boltz predict --help` and for more information on these input formats, see our [prediction instructions](docs/prediction.md). By default, the `boltz` command will run the latest version of the model.
247
+
248
+
249
+ ### Binding Affinity Prediction
250
+ There are two main predictions in the affinity output: `affinity_pred_value` and `affinity_probability_binary`. They are trained on largely different datasets, with different supervisions, and should be used in different contexts. The `affinity_probability_binary` field should be used to detect binders from decoys, for example in a hit-discovery stage. Its value ranges from 0 to 1 and represents the predicted probability that the ligand is a binder. The `affinity_pred_value` aims to measure the specific affinity of different binders and how this changes with small modifications of the molecule. This should be used in ligand optimization stages such as hit-to-lead and lead-optimization. It reports a binding affinity value as `log10(IC50)`, derived from an `IC50` measured in `μM`. More details on how to run affinity predictions and parse the output can be found in our [prediction instructions](docs/prediction.md).
251
+
252
+ ## Authentication to MSA Server
253
+
254
+ When using the `--use_msa_server` option with a server that requires authentication, you can provide credentials in one of two ways. More information is available in our [prediction instructions](docs/prediction.md#authentication-to-msa-server).
255
+
256
+ ## Training
257
+
258
+ ⚠️ **Coming soon: updated training code for Boltz-2!**
259
+
260
+ If you're interested in retraining the model, currently for Boltz-1 but soon for Boltz-2, see our [training instructions](docs/training.md).
261
+
262
+
263
+ ## Contributing
264
+
265
+ We welcome external contributions and are eager to engage with the community. Connect with us on our [Slack channel](https://boltz.bio/join-slack) to discuss advancements, share insights, and foster collaboration around Boltz-2.
266
+
267
+ On recent NVIDIA GPUs, Boltz leverages the acceleration provided by [NVIDIA cuEquivariance](https://developer.nvidia.com/cuequivariance) kernels. Boltz also runs on Tenstorrent hardware thanks to a [fork](https://github.com/moritztng/tt-boltz) by Moritz Thüning.
268
+
269
+ ## License
270
+
271
+ Our model and code are released under MIT License, and can be freely used for both academic and commercial purposes.
272
+
273
+
274
+ ## Cite
275
+
276
+ If you use this code or the models in your research, please cite the following papers:
277
+
278
+ ```bibtex
279
+ @article{passaro2025boltz2,
280
+ author = {Passaro, Saro and Corso, Gabriele and Wohlwend, Jeremy and Reveiz, Mateo and Thaler, Stephan and Somnath, Vignesh Ram and Getz, Noah and Portnoi, Tally and Roy, Julien and Stark, Hannes and Kwabi-Addo, David and Beaini, Dominique and Jaakkola, Tommi and Barzilay, Regina},
281
+ title = {Boltz-2: Towards Accurate and Efficient Binding Affinity Prediction},
282
+ year = {2025},
283
+ doi = {10.1101/2025.06.14.659707},
284
+ journal = {bioRxiv}
285
+ }
286
+
287
+ @article{wohlwend2024boltz1,
288
+ author = {Wohlwend, Jeremy and Corso, Gabriele and Passaro, Saro and Getz, Noah and Reveiz, Mateo and Leidal, Ken and Swiderski, Wojtek and Atkinson, Liam and Portnoi, Tally and Chinn, Itamar and Silterra, Jacob and Jaakkola, Tommi and Barzilay, Regina},
289
+ title = {Boltz-1: Democratizing Biomolecular Interaction Modeling},
290
+ year = {2024},
291
+ doi = {10.1101/2024.11.19.624167},
292
+ journal = {bioRxiv}
293
+ }
294
+ ```
295
+
296
+ In addition if you use the automatic MSA generation, please cite:
297
+
298
+ ```bibtex
299
+ @article{mirdita2022colabfold,
300
+ title={ColabFold: making protein folding accessible to all},
301
+ author={Mirdita, Milot and Sch{\"u}tze, Konstantin and Moriwaki, Yoshitaka and Heo, Lim and Ovchinnikov, Sergey and Steinegger, Martin},
302
+ journal={Nature methods},
303
+ year={2022},
304
+ }
305
+ ```
@@ -0,0 +1,245 @@
1
+ # boltz-community
2
+
3
+ Community-maintained fork of [Boltz](https://github.com/jwohlwend/boltz) with bug fixes, broader compatibility, and CI.
4
+
5
+ ## What's different from upstream?
6
+
7
+ **Compatibility:**
8
+ - Apple Silicon (MPS) support: `boltz predict --accelerator mps`
9
+ - Dependency pins relaxed from `==` to `>=`
10
+ - `fairscale` dependency removed — replaced with PyTorch built-in `torch.utils.checkpoint`
11
+ - `numpy<2.0` cap removed
12
+ - `requires-python` widened to `>=3.10` (removed `<3.13` cap)
13
+ - Compatible with PyTorch 2.6+ and Lightning 2.6+
14
+
15
+ **Bug fixes:**
16
+ - Fixed ROCm DDP crashes by allocating tensors directly on the target device instead of CPU-then-move ([#654](https://github.com/jwohlwend/boltz/pull/654))
17
+ - Fixed `--write_full_pae` and `--write_full_pde` being ignored, and added matching `--no_write_full_pae` and `--no_write_full_pde` flags ([#602](https://github.com/jwohlwend/boltz/pull/602))
18
+ - Fixed MSA CSV parsing removing paired duplicate sequences across different taxa ([#584](https://github.com/jwohlwend/boltz/pull/584))
19
+ - Fixed MSA feature construction incorrectly including paired sequences as unpaired ([#582](https://github.com/jwohlwend/boltz/pull/582))
20
+ - Fixed consecutive CA filter rejecting valid protein chains containing metal ions ([#576](https://github.com/jwohlwend/boltz/pull/576))
21
+ - Fixed template alignment forcing gapless matches, breaking templates with indels ([#538](https://github.com/jwohlwend/boltz/pull/538))
22
+ - Fixed relative MSA paths resolved from CWD instead of input file directory ([#500](https://github.com/jwohlwend/boltz/pull/500))
23
+ - Fixed MSA authentication headers forcing `Content-Type`, which breaks some MSA servers ([#488](https://github.com/jwohlwend/boltz/pull/488))
24
+ - Fixed CLI help/default mismatches and added option validation for MSA pairing strategy ([#463](https://github.com/jwohlwend/boltz/pull/463))
25
+ - Fixed sign error in binding energy calculation documentation ([#363](https://github.com/jwohlwend/boltz/pull/363))
26
+ - Fixed broken v1 attention code path in `PairformerLayer` ([#602](https://github.com/jwohlwend/boltz/pull/602))
27
+ - Fixed SIGSEGV crash on ligands with invalid implicit valence ([#649](https://github.com/jwohlwend/boltz/issues/649))
28
+ - Fixed `--subsample_msa` defaulting to False instead of True ([#628](https://github.com/jwohlwend/boltz/issues/628))
29
+ - Fixed 2-char elements (Ca, Fe, Br, Cl) misidentified in PDB/mmCIF output ([#458](https://github.com/jwohlwend/boltz/issues/458))
30
+ - Fixed atom name overflow (>4 chars) crashing large molecule processing ([#494](https://github.com/jwohlwend/boltz/issues/494))
31
+ - Fixed null bytes in A3M files crashing MSA parsing ([#509](https://github.com/jwohlwend/boltz/issues/509))
32
+ - Fixed bfloat16 dtype mismatch in potentials ([#625](https://github.com/jwohlwend/boltz/issues/625))
33
+ - Fixed CCD tar re-download on every run when `mols/` already exists ([#633](https://github.com/jwohlwend/boltz/issues/633))
34
+ - Fixed empty CIF files causing cryptic errors ([#641](https://github.com/jwohlwend/boltz/issues/641))
35
+ - Fixed hardcoded "LIG" residue name in PDB HETATM records ([#630](https://github.com/jwohlwend/boltz/issues/630))
36
+ - Fixed mmCIF entity deduplication for chemically distinct ligands ([#630](https://github.com/jwohlwend/boltz/issues/630))
37
+ - Fixed chirality constraint computation missing stereo assignment ([#589](https://github.com/jwohlwend/boltz/issues/589))
38
+ - Fixed multi-CCD ligands not dropping leaving atoms ([#631](https://github.com/jwohlwend/boltz/issues/631))
39
+ - Fixed `--preprocessing-threads` overcommitting CPUs ([#564](https://github.com/jwohlwend/boltz/issues/564))
40
+ - Fixed silent wrong-answer bug: inference `__getitem__` no longer substitutes a different record on failure — errors now propagate
41
+ - Fixed potential stack overflow in training/validation data loading via bounded retry (max 10 attempts)
42
+ - Fixed `boltz predict` exiting silently with code 0 when all inputs fail validation (e.g. requesting affinity for a protein chain)
43
+ - Fixed MSA pairing keys lost when loading cached A3M files ([#627](https://github.com/jwohlwend/boltz/issues/627))
44
+ - Fixed affinity prediction crashing when structure prediction fails (e.g. covalent ligands, OOM) — now skips affected records with a warning ([#620](https://github.com/jwohlwend/boltz/issues/620), [#624](https://github.com/jwohlwend/boltz/issues/624))
45
+ - Fixed affinity prediction for repeated ligand binders: inputs that request affinity for one copy of a repeated ligand entity no longer fail, and affinity is now reported per binder copy as `affinity_<record>_<chain>.json` ([#647](https://github.com/jwohlwend/boltz/issues/647))
46
+ - Fixed Boltz-2 checkpoint loading crash due to extra `mse_rotational_alignment` kwarg ([#644](https://github.com/jwohlwend/boltz/issues/644))
47
+ - Fixed direct Boltz-2 model use from checkpoint hyperparameters crashing during sampling when `steering_args` is missing ([#680](https://github.com/jwohlwend/boltz/issues/680))
48
+ - Fixed empty checkpoint files causing cryptic `load_from_checkpoint` aborts — now re-downloads empty cached weights and raises a clear error before model load ([#664](https://github.com/jwohlwend/boltz/issues/664))
49
+ - Fixed CPU inference producing distorted structures with wrong bond lengths — Boltz-2 was incorrectly using `bf16-mixed` precision on CPU; now forces float32 ([#653](https://github.com/jwohlwend/boltz/issues/653))
50
+ - Fixed missing PAE summaries in `confidence_*.json` — aggregated `complex_pae`, `complex_ipae`, `chains_pae`, and `pair_chains_pae` are now included, remain available with `--no_write_full_pae`, use contact-weighted aggregation like PDE, and write undefined values as `null` ([#607](https://github.com/jwohlwend/boltz/issues/607))
51
+ - Fixed cuequivariance triangle multiplication kernel crashes by falling back to PyTorch when kernels are unavailable or unsupported ([#485](https://github.com/jwohlwend/boltz/issues/485), with thanks to [#682](https://github.com/jwohlwend/boltz/pull/682))
52
+ - Fixed cuequivariance triangle attention kernel crashes by falling back to PyTorch when kernels are unavailable or unsupported — extends the v2.10.3 fix to the triangle attention path that was missed ([#485](https://github.com/jwohlwend/boltz/issues/485))
53
+ - Fixed forced contact restraints losing all signal when union weighting underflowed for large distance violations ([#621](https://github.com/jwohlwend/boltz/issues/621), with thanks to [#682](https://github.com/jwohlwend/boltz/pull/682))
54
+ - Fixed incorrect contact-union gradient sign so soft-OR contact restraints apply gradient pressure with the correct magnitude across union members
55
+ - Fixed diffusion sampling ignoring `--max_parallel_samples` in divisible cases (for example `10` samples with a parallel limit of `5`), which could batch everything into one large chunk and trigger avoidable OOMs
56
+ - Fixed MSA discarded as "does not match input sequence" when pre-computed MSAs are aligned to a full UniProt sequence but the input uses a shorter PDB construct — Boltz now finds the construct as a contiguous subsequence within the MSA query and trims all MSA rows accordingly, instead of falling back to a dummy single-sequence MSA. Tolerates up to 5% mismatches (selenomethionine substitutions, expression tags, minor construct mutations). Applies to both Boltz-1 and Boltz-2.
57
+ - Fixed PDB templates crashing with `IndexError: list index out of range` when Gemmi drops entity sequence metadata during PDB→mmCIF conversion — template parsing now falls back to the observed polymer residues, and relative template `pdb`/`cif` paths are resolved from the YAML file directory instead of the current working directory ([#669](https://github.com/jwohlwend/boltz/issues/669))
58
+ - Fixed YAML `bond` constraints for custom cross-residue covalent bonds (for example ACE-CY3 cyclization) missing atom-level bond-length bounds for physical guidance and `_struct_conn` records in mmCIF output ([#675](https://github.com/jwohlwend/boltz/issues/675))
59
+ - Fixed Boltz-2 fine-tuning/validation crashes when downstream methods read `self.validate_structure`; the constructor now stores the `validate_structure` argument on the model ([novel-therapeutics/boltz-community#11](https://github.com/Novel-Therapeutics/boltz-community/issues/11))
60
+ - Fixed training-data preprocessing: `scripts/process/rcsb.py` was looking up clusters by `pdb_id_entity_id` while `scripts/process/cluster.py` keys its output by `hash_sequence(seq)` (proteins/RNA/short polymers) or by CCD code (ligands), so every chain silently got `cluster_id=-1` and `ClusterSampler` weighted everything uniformly. Records also had `msa_id=""` for protein chains, so training silently ran with no MSA features. Both fields are now populated correctly, and `entity_id` is propagated through to the record ([#686](https://github.com/jwohlwend/boltz/issues/686)). Does not affect inference; users who trained or fine-tuned with the documented pipeline need to re-preprocess and re-train.
61
+ - Fixed affinity prediction running 5× slower than necessary: upstream hardcoded `max_parallel_samples=1` for the affinity diffusion path, which was silently masked by upstream's buggy `chunk(multiplicity % max + 1)` math (the divisible case collapsed to `chunk(1)`, batching all samples in one pass). When our earlier diffusion fix replaced that with the correct `split(max_parallel_samples)`, the hardcoded `1` started to actually take effect, forcing N sequential single-sample forward passes per affinity record. The affinity path now honors the user's `--max_parallel_samples`, capped at `--diffusion_samples_affinity` so it doesn't claim more parallelism than diffusion will run.
62
+
63
+ **Improvements:**
64
+ - Published to PyPI as [`boltz-community`](https://pypi.org/project/boltz-community/) — `pip install boltz-community` and `uv add boltz-community` now work without the git URL ([#12](https://github.com/Novel-Therapeutics/boltz-community/issues/12)). Releases are tag-driven via GitHub Actions + PyPI Trusted Publisher (OIDC, no long-lived tokens).
65
+ - Added `--skip_bad_inputs` flag: by default `boltz predict` now aborts when any input fails processing; pass `--skip_bad_inputs` to skip bad inputs and continue with the rest
66
+ - Deferred heavy imports (torch, rdkit, pytorch-lightning) so `boltz.main` loads instantly for CLI help and input validation
67
+ - `--devices` now accepts a comma-separated list of specific GPU device IDs in addition to a device count (e.g. `--devices 0,1` targets GPUs 0 and 1; use `CUDA_VISIBLE_DEVICES=1 boltz predict ...` to target a single GPU by index)
68
+ - Added `--batch_size` for Boltz-2 structure inference so multiple inputs can be processed per prediction batch. Current limits: affinity prediction remains single-record (`batch_size=1`), and guided inference (`--use_potentials` / contact guidance) is only supported with `--batch_size 1`
69
+
70
+ **Performance improvements:**
71
+ - Added optional FlashAttention-2 / PyTorch SDPA acceleration for triangle attention and pair-biased attention via `--flash_attn` (off by default). Reduces attention memory footprint and speeds up inference on Ampere+ GPUs while remaining numerically equivalent to the manual einsum path within float-precision tolerance (verified by parity tests)
72
+ - Model weights now load directly to GPU instead of CPU-then-transfer
73
+ - Cached molecule file reads and symmetry deserialization across samples
74
+ - Removed dead O(n_tokens × n_chains) loop in pocket distance computation
75
+ - Tensors across model modules now allocated directly on device instead of CPU-then-transfer ([#654](https://github.com/jwohlwend/boltz/pull/654))
76
+ - Featurizer MSA pairing fill rewritten with vectorized numpy indexing (eliminates per-row Python loop)
77
+ - `process_atom_features` pre-allocates output arrays and fills `atom_to_token` in one slice per token (eliminates per-atom appends)
78
+
79
+ **Tests & CI:**
80
+ - 283 tests in this fork vs. 5 tests in current upstream `jwohlwend/boltz`: unit tests (CPU), smoke tests (end-to-end inference), regression tests (golden output verification for Boltz-1 and Boltz-2), determinism tests, MSA trim subsequence matching (8 cases), diffusion chunking regression tests, Boltz-2 validation constructor coverage, and featurizer pre-allocation correctness
81
+ - GitHub Actions CI with CPU runners (every push/PR) and GPU T4 runners (push to main)
82
+
83
+ ## Contributing
84
+
85
+ Pull requests are welcome! If you have a bug fix, test improvement, or compatibility enhancement, please open a PR.
86
+
87
+ ## Installation
88
+
89
+ Install from PyPI:
90
+
91
+ ```
92
+ pip install boltz-community
93
+ ```
94
+
95
+ With CUDA kernels:
96
+
97
+ ```
98
+ pip install "boltz-community[cuda]"
99
+ ```
100
+
101
+ `uv` works the same way:
102
+
103
+ ```
104
+ uv add boltz-community # or: uv add "boltz-community[cuda]"
105
+ ```
106
+
107
+ If you are installing on CPU-only or non-CUDA GPU hardware, omit `[cuda]`. Note that the CPU version is significantly slower than the GPU version.
108
+
109
+ ### Installing the bleeding-edge `main` branch
110
+
111
+ ```
112
+ pip install "boltz-community @ git+https://github.com/Novel-Therapeutics/boltz-community.git"
113
+ ```
114
+
115
+ ### Apple Silicon (MPS)
116
+
117
+ On Macs with Apple Silicon, you can run inference on the GPU via MPS:
118
+
119
+ ```
120
+ boltz predict input.yaml --accelerator mps --use_msa_server
121
+ ```
122
+
123
+ MPS mode automatically uses float32 precision and single-device execution. Performance is slower than CUDA but significantly faster than CPU.
124
+
125
+ ## Releasing
126
+
127
+ Releases are tag-driven. Pushing a `v*.*.*` tag triggers [.github/workflows/release.yml](.github/workflows/release.yml), which builds the sdist + wheel, validates them with `twine check`, and publishes to PyPI via [PyPI Trusted Publisher](https://docs.pypi.org/trusted-publishers/) (OIDC) — no long-lived API token is stored in this repo.
128
+
129
+ ### One-time setup (PyPI side)
130
+
131
+ 1. Register the `boltz-community` package on PyPI (create as a new project; the name is currently available).
132
+ 2. Open the project's *Publishing* settings and add a Trusted Publisher with:
133
+ - **Owner:** `Novel-Therapeutics`
134
+ - **Repository:** `boltz-community`
135
+ - **Workflow filename:** `release.yml`
136
+ - **Environment:** `pypi`
137
+ 3. In the GitHub repo Settings → Environments, create an environment named `pypi`. Optionally add a required-reviewer rule so a publish has to be approved by a maintainer before the OIDC exchange runs.
138
+
139
+ ### Per-release flow
140
+
141
+ 1. Land all changes on `main`.
142
+ 2. Bump `version` in [pyproject.toml](pyproject.toml).
143
+ 3. Add a bullet under *Bug fixes* / *Improvements* / *Performance improvements* in this README. Update the test count if new tests landed.
144
+ 4. Commit as `Release X.Y.Z` and push `main`.
145
+ 5. Tag the release commit: `git tag -a vX.Y.Z -m "Release X.Y.Z" && git push origin vX.Y.Z`.
146
+ 6. The release workflow builds, checks, and publishes the artifacts to PyPI. Watch the run under the *Actions* tab.
147
+ 7. Create the GitHub release with the release notes (see prior releases for the *Highlights / Details / Commits since* structure).
148
+
149
+ ### Recovering from a failed publish
150
+
151
+ PyPI rejects re-uploading the same version. If the build succeeded but the publish step failed (e.g. environment approval timed out), you can re-run the *Publish to PyPI* job from the Actions tab without re-tagging. If a version is published but broken, **bump the patch and ship a new release** — never delete or yank without a follow-up that supersedes it.
152
+
153
+ ---
154
+
155
+ *Everything below is from the upstream Boltz README.*
156
+
157
+ ---
158
+
159
+ <div align="center">
160
+ <div>&nbsp;</div>
161
+ <img src="docs/boltz2_title.png" width="300"/>
162
+
163
+ [Boltz-1](https://doi.org/10.1101/2024.11.19.624167) | [Boltz-2](https://doi.org/10.1101/2025.06.14.659707) |
164
+ [Slack](https://boltz.bio/join-slack) <br> <br>
165
+ </div>
166
+
167
+
168
+
169
+ ![](docs/boltz1_pred_figure.png)
170
+
171
+
172
+ ## Introduction
173
+
174
+ Boltz is a family of models for biomolecular interaction prediction. Boltz-1 was the first fully open source model to approach AlphaFold3 accuracy. Our latest work Boltz-2 is a new biomolecular foundation model that goes beyond AlphaFold3 and Boltz-1 by jointly modeling complex structures and binding affinities, a critical component towards accurate molecular design. Boltz-2 is the first deep learning model to approach the accuracy of physics-based free-energy perturbation (FEP) methods, while running 1000x faster — making accurate in silico screening practical for early-stage drug discovery.
175
+
176
+ All the code and weights are provided under MIT license, making them freely available for both academic and commercial uses. For more information about the model, see the [Boltz-1](https://doi.org/10.1101/2024.11.19.624167) and [Boltz-2](https://doi.org/10.1101/2025.06.14.659707) technical reports. To discuss updates, tools and applications join our [Slack channel](https://boltz.bio/join-slack).
177
+
178
+ ## Inference
179
+
180
+ You can run inference using Boltz with:
181
+
182
+ ```
183
+ boltz predict input_path --use_msa_server
184
+ ```
185
+
186
+ `input_path` should point to a YAML file, or a directory of YAML files for batched processing, describing the biomolecules you want to model and the properties you want to predict (e.g. affinity). To see all available options: `boltz predict --help` and for more information on these input formats, see our [prediction instructions](docs/prediction.md). By default, the `boltz` command will run the latest version of the model.
187
+
188
+
189
+ ### Binding Affinity Prediction
190
+ There are two main predictions in the affinity output: `affinity_pred_value` and `affinity_probability_binary`. They are trained on largely different datasets, with different supervisions, and should be used in different contexts. The `affinity_probability_binary` field should be used to detect binders from decoys, for example in a hit-discovery stage. Its value ranges from 0 to 1 and represents the predicted probability that the ligand is a binder. The `affinity_pred_value` aims to measure the specific affinity of different binders and how this changes with small modifications of the molecule. This should be used in ligand optimization stages such as hit-to-lead and lead-optimization. It reports a binding affinity value as `log10(IC50)`, derived from an `IC50` measured in `μM`. More details on how to run affinity predictions and parse the output can be found in our [prediction instructions](docs/prediction.md).
191
+
192
+ ## Authentication to MSA Server
193
+
194
+ When using the `--use_msa_server` option with a server that requires authentication, you can provide credentials in one of two ways. More information is available in our [prediction instructions](docs/prediction.md#authentication-to-msa-server).
195
+
196
+ ## Training
197
+
198
+ ⚠️ **Coming soon: updated training code for Boltz-2!**
199
+
200
+ If you're interested in retraining the model, currently for Boltz-1 but soon for Boltz-2, see our [training instructions](docs/training.md).
201
+
202
+
203
+ ## Contributing
204
+
205
+ We welcome external contributions and are eager to engage with the community. Connect with us on our [Slack channel](https://boltz.bio/join-slack) to discuss advancements, share insights, and foster collaboration around Boltz-2.
206
+
207
+ On recent NVIDIA GPUs, Boltz leverages the acceleration provided by [NVIDIA cuEquivariance](https://developer.nvidia.com/cuequivariance) kernels. Boltz also runs on Tenstorrent hardware thanks to a [fork](https://github.com/moritztng/tt-boltz) by Moritz Thüning.
208
+
209
+ ## License
210
+
211
+ Our model and code are released under MIT License, and can be freely used for both academic and commercial purposes.
212
+
213
+
214
+ ## Cite
215
+
216
+ If you use this code or the models in your research, please cite the following papers:
217
+
218
+ ```bibtex
219
+ @article{passaro2025boltz2,
220
+ author = {Passaro, Saro and Corso, Gabriele and Wohlwend, Jeremy and Reveiz, Mateo and Thaler, Stephan and Somnath, Vignesh Ram and Getz, Noah and Portnoi, Tally and Roy, Julien and Stark, Hannes and Kwabi-Addo, David and Beaini, Dominique and Jaakkola, Tommi and Barzilay, Regina},
221
+ title = {Boltz-2: Towards Accurate and Efficient Binding Affinity Prediction},
222
+ year = {2025},
223
+ doi = {10.1101/2025.06.14.659707},
224
+ journal = {bioRxiv}
225
+ }
226
+
227
+ @article{wohlwend2024boltz1,
228
+ author = {Wohlwend, Jeremy and Corso, Gabriele and Passaro, Saro and Getz, Noah and Reveiz, Mateo and Leidal, Ken and Swiderski, Wojtek and Atkinson, Liam and Portnoi, Tally and Chinn, Itamar and Silterra, Jacob and Jaakkola, Tommi and Barzilay, Regina},
229
+ title = {Boltz-1: Democratizing Biomolecular Interaction Modeling},
230
+ year = {2024},
231
+ doi = {10.1101/2024.11.19.624167},
232
+ journal = {bioRxiv}
233
+ }
234
+ ```
235
+
236
+ In addition if you use the automatic MSA generation, please cite:
237
+
238
+ ```bibtex
239
+ @article{mirdita2022colabfold,
240
+ title={ColabFold: making protein folding accessible to all},
241
+ author={Mirdita, Milot and Sch{\"u}tze, Konstantin and Moriwaki, Yoshitaka and Heo, Lim and Ovchinnikov, Sergey and Steinegger, Martin},
242
+ journal={Nature methods},
243
+ year={2022},
244
+ }
245
+ ```