Skip to main content

Foundation models for computational chemistry.

Project description

Orbital Materials


Pretrained models for atomic simulations

example workflow PyPI version

Install

pip install orb-models

Orb models are expected to work on MacOS and Linux. Windows support is not guaranteed.

For large system (≳5k atoms PBC, or ≳30k atoms non-PBC) simulations we recommend installing cuML (requires CUDA), which can significantly reduce graph creation time (2-10x) and improve GPU memory efficiency (2-100x):

pip install --extra-index-url=https://pypi.nvidia.com "cuml-cu11==25.2.*"  # For cuda versions >=11.4, <11.8
pip install --extra-index-url=https://pypi.nvidia.com "cuml-cu12==25.2.*"  # For cuda versions >=12.0, <13.0

Alternatively, you can use Docker to run orb-models; see instructions below.

Updates

August 2025: Release of the OrbMol potentials (blog post forthcoming).

  • Trained on the Open Molecules 2025 (OMol25) dataset—over 100M high-accuracy DFT calculations (ωB97M-V/def2-TZVPD) on diverse molecular systems including metal complexes, biomolecules, and electrolytes.
  • Architecturally similar to the highly-performant Orb-v3 models, but now explicit total charges and spins can be passed as input.
  • To get started with these models, see: How to specify total charge and spin for OrbMol.

April 2025: Release of the Orb-v3 set of potentials.

Oct 2024: Release of the Orb-v2 set of potentials.

Sept 2024: Release of v1 models - state of the art performance on the matbench discovery dataset.

Available models

See MODELS.md for a full list of available models along with guidance.

Usage

Note: These examples are designed to run on the main branch of orb-models. If you are using a pip installed version of orb-models, you may want to look at the corresponding README.md from that tag.

Direct usage

import ase
from ase.build import bulk

from orb_models.forcefield import atomic_system, pretrained
from orb_models.forcefield.base import batch_graphs

device = "cpu"  # or device="cuda"
orbff = pretrained.orb_v3_conservative_inf_omat(
  device=device,
  precision="float32-high",   # or "float32-highest" / "float64
)
atoms = bulk('Cu', 'fcc', a=3.58, cubic=True)
graph = atomic_system.ase_atoms_to_atom_graphs(atoms, orbff.system_config, device=device)

# If you have several graphs, batch them like so:
# graph = batch_graphs([graph1, graph2, ...])

result = orbff.predict(graph, split=False)

# Convert to ASE atoms (unbatches the results and transfers to cpu if necessary)
atoms = atomic_system.atom_graphs_to_ase_atoms(
    graph,
    energy=result["energy"],
    forces=result["grad_forces"],
    stress=result["grad_stress"]
)

Usage with ASE calculator

import ase
from ase.build import bulk

from orb_models.forcefield import pretrained
from orb_models.forcefield.calculator import ORBCalculator

device="cpu" # or device="cuda"
# or choose another model using ORB_PRETRAINED_MODELS[model_name]()
orbff = pretrained.orb_v3_conservative_inf_omat(
  device=device,
  precision="float32-high",   # or "float32-highest" / "float64
)
calc = ORBCalculator(orbff, device=device)
atoms = bulk('Cu', 'fcc', a=3.58, cubic=True)

atoms.calc = calc
atoms.get_potential_energy()

You can use this calculator with any ASE calculator-compatible code. For example, you can use it to perform a geometry optimization:

from ase.optimize import BFGS

# Rattle the atoms to get them out of the minimum energy configuration
atoms.rattle(0.5)
print("Rattled Energy:", atoms.get_potential_energy())

calc = ORBCalculator(orbff, device="cpu") # or device="cuda"
dyn = BFGS(atoms)
dyn.run(fmax=0.01)
print("Optimized Energy:", atoms.get_potential_energy())

Or you can use it to run MD simulations. The script, an example input xyz file and a Colab notebook demonstration are available in the examples directory. This should work with any input, simply modify the input_file and cell_size parameters. We recommend using constant volume simulations.

How to specify total charge and spin for OrbMol

The OrbMol models require total charge and spin to be specified. This can be done by setting them in atoms.info dictionary.

import ase
from ase.build import molecule
from orb_models.forcefield import atomic_system, pretrained
from orb_models.forcefield.base import batch_graphs

device = "cpu"  # or device="cuda"
orbff = pretrained.orb_v3_conservative_omol(
  device=device,
  precision="float32-high",   # or "float32-highest" / "float64
)
atoms = molecule("C6H6")
atoms.info["charge"] = 1.0  # total charge
atoms.info["spin"] = 0.0  # total spin
graph = atomic_system.ase_atoms_to_atom_graphs(atoms, orbff.system_config, device=device)

result = orbff.predict(graph, split=False)

Confidence head (Orb-v3 Models Only)

Orb-v3 models have a confidence head which produces a per-atom discrete confidence measure based on a classifier head which learns to predict the binned MAE between predicted and true forces during training. This classifier head has 50 bins, linearly spaced between 0 and 0.4A.

import ase
from ase.build import molecule
from seaborn import heatmap # optional, for visualization only
import matplotlib.pyplot as plt # optional, for visualization only
import numpy

from orb_models.forcefield import pretrained
from orb_models.forcefield.calculator import ORBCalculator

device="cpu" # or device="cuda"
# or choose another model using ORB_PRETRAINED_MODELS[model_name]()
orbff = pretrained.orb_v3_conservative_inf_omat(
  device=device,
)
calc = ORBCalculator(orbff, device=device)
# Use a molecule (OOD for Orb, so confidence plot is
# more interesting than a bulk crystal)
atoms = molecule("CH3CH2Cl")
atoms.calc = calc

forces = atoms.get_forces()
confidences = calc.results["confidence"]
predicted_bin_per_atom = numpy.argmax(confidences, axis=-1)

print(forces.shape, confidences.shape) # (num_atoms, 3), (num_atoms, 50)
print(predicted_bin_per_atom) # List of length num_atoms
heatmap(confidences)
plt.xlabel('Confidence Bin')
plt.ylabel('Atom Index')
plt.title('Confidence Heatmap')
plt.show()

Floating Point Precision

As shown in usage snippets above, we support 3 floating point precision types: "float32-high", "float32-highest" and "float64".

The default value of "float32-high" is recommended for maximal acceleration when using A100 / H100 Nvidia GPUs. However, we have observed some performance loss for high-precision calculations involving second and third order properties of the PES. In these cases, we recommend "float32-highest".

In stark constrast to other universal forcefields, we have not found any benefit to using "float64".

Finetuning

You can finetune the model using your custom dataset. The dataset should be an ASE sqlite database.

python finetune.py --dataset=<dataset_name> --data_path=<your_data_path> --base_model=<base_model>

Where base_model is an element of orb_models.forcefield.pretrained.ORB_PRETRAINED_MODELS.keys().

After the model is finetuned, checkpoints will, by default, be saved to the ckpts folder in the directory you ran the finetuning script from. You can use the new model and load the checkpoint by:

from orb_models.forcefield import pretrained

model = getattr(pretrained, <base_model>)(
  weights_path=<path_to_ckpt>, 
  device="cpu",               # or device="cuda"
  precision="float32-high",   # or precision="float32-highest"
)

Caveats

Our finetuning script is designed for simplicity. We strongly advise users to customise it further for their use-case to get the best performance. Please be aware that:

  • The script assumes that your ASE database rows contain energy, forces, and stress data. To train on molecular data without stress, you will need to edit the code.
  • Early stopping is not implemented. However, you can use the command line argument save_every_x_epochs (default is 5), so "retrospective" early stopping can be applied by selecting a suitable checkpoint.
  • The learning rate schedule is hardcoded to be torch.optim.lr_scheduler.OneCycleLR with pct_start=0.05. The max_lr/min_lr will be 10x greater/smaller than the lr specified via the command line. To get the best performance, you may wish to try other schedulers.
  • The defaults of --num_steps=100 and --max_epochs=50 are small. This may be suitable for very small finetuning datasets (e.g. 100s of systems), but you will likely want to increase the number of steps for larger datasets (e.g. 1000s of datapoints).
  • The script only tracks a limited set of metrics (energy/force/stress MAEs) which may be insufficient for some downstream use-cases. For instance, if you wish to finetune a model for Molecular Dynamics simulations, we have found (anecdotally) that models that are just on the cusp of overfitting to force MAEs can be substantially worse for simulations. Ideally, more robust "rollout" metrics would be included in the finetuning training loop. In lieu of this, we recommend more aggressive early-stopping i.e. using models several epochs prior to any sign of overfitting.

Docker

You can run orb-models using Docker, which provides a consistent environment with all dependencies pre-installed:

  1. Build the Docker image locally:

    docker build -t orb_models .
    
  2. Run the Docker container:

    docker run --gpus all --rm --name orb_models -it orb_models /bin/bash
    

Citing

Preprints describing the models in more detail can be found at:

@misc{rhodes2025orbv3atomisticsimulationscale,
      title={Orb-v3: atomistic simulation at scale}, 
      author={Benjamin Rhodes and Sander Vandenhaute and Vaidotas Šimkus and James Gin and Jonathan Godwin and Tim Duignan and Mark Neumann},
      year={2025},
      eprint={2504.06231},
      archivePrefix={arXiv},
      primaryClass={cond-mat.mtrl-sci},
      url={https://arxiv.org/abs/2504.06231}, 
}

@misc{neumann2024orbfastscalableneural,
      title={Orb: A Fast, Scalable Neural Network Potential}, 
      author={Mark Neumann and James Gin and Benjamin Rhodes and Steven Bennett and Zhiyi Li and Hitarth Choubisa and Arthur Hussey and Jonathan Godwin},
      year={2024},
      eprint={2410.22570},
      archivePrefix={arXiv},
      primaryClass={cond-mat.mtrl-sci},
      url={https://arxiv.org/abs/2410.22570}, 
}

License

ORB models are licensed under the Apache License, Version 2.0. Please see the LICENSE file for details.

If you have an interesting use case or benchmark for an Orb model, please let us know! We are happy to work with the community to make these models useful for as many applications as possible.

Community

Please join the discussion on Discord by following this link.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orb_models-0.5.5.tar.gz (89.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orb_models-0.5.5-py3-none-any.whl (94.5 kB view details)

Uploaded Python 3

File details

Details for the file orb_models-0.5.5.tar.gz.

File metadata

  • Download URL: orb_models-0.5.5.tar.gz
  • Upload date:
  • Size: 89.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for orb_models-0.5.5.tar.gz
Algorithm Hash digest
SHA256 d62f552f3dacf1fa3f0b99705ddf6a70b839c0bcc182151998ba2a89defe86b4
MD5 0201e9a921982a2aa44d501ee8483b09
BLAKE2b-256 409ed049a6284bf04db7958f6ba0a8e8f0ce00d2b1775ea910a175c570d8a8ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for orb_models-0.5.5.tar.gz:

Publisher: publish.yml on orbital-materials/orb-models

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file orb_models-0.5.5-py3-none-any.whl.

File metadata

  • Download URL: orb_models-0.5.5-py3-none-any.whl
  • Upload date:
  • Size: 94.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for orb_models-0.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4a6a94f32bfb3e0cc84392dd68aff6ddc2bdcf7f24a590a09874584fa628ec5f
MD5 107560c53ab3f77eacfd2d342b3554b1
BLAKE2b-256 578048f0768e1d128045bca43d9c36363ba2dd13bc360acfc68052ceb2db9fe1

See more details on using hashes here.

Provenance

The following attestation bundles were made for orb_models-0.5.5-py3-none-any.whl:

Publisher: publish.yml on orbital-materials/orb-models

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page