fairchem is the FAIR Chemistry’s centralized repository of all its data, models,
demos, and application efforts for materials science and quantum chemistry.
FAIRChem version 2 is a breaking change from version 1 and is not compatible with our previous pretrained models and code.
If you want to use an older model or code from version 1 you will need to install version 1,
as detailed here.
Some of the docs and new features in FAIRChem version 2 are still being updated so you may see some changes over the next few weeks. Check back here for the latest instructions. Thank you for your patience!
If you want to explore model capabilities check out our
educational demo
Installation
Although not required, we highly recommend installing using a package manager and virtualenv such as uv, it is much faster and better at resolving dependencies than standalone pip.
Install fairchem-core using pip
pip install fairchem-core
If you want to contribute or make modifications to the code, clone the repo and install in edit mode
The easiest way to use pretrained models is via the ASEFAIRChemCalculator.
A single uma model can be used for a wide range of applications in chemistry and materials science by picking the
appropriate task name for domain specific prediction.
Instantiate a calculator from a pretrained model
Make sure you have a Hugging Face account, have already applied for model access to the
UMA model repository, and have logged in to Hugging Face using an access token.
You can use the following to save an auth token,
huggingface-cli login
Models are referenced by their name, below are the currently supported models:
Model Name
Description
uma-s-1p1
Latest version of the UMA small model, fastest of the UMA models while still SOTA on most benchmarks (6.6M/150M active/total params)
uma-m-1p1
Best in class UMA model across all metrics, but slower and more memory intensive than uma-s (50M/1.4B active/total params)
Set the task for your application and calculate
oc20: use this for catalysis
omat: use this for inorganic materials
omol: use this for molecules
odac: use this for MOFs
omc: use this for molecular crystals
Relax an adsorbate on a catalytic surface,
from ase.build import fcc100, add_adsorbate, molecule
from ase.optimize import LBFGS
from fairchem.core import pretrained_mlip, FAIRChemCalculator
predictor = pretrained_mlip.get_predict_unit("uma-s-1p1", device="cuda")
calc = FAIRChemCalculator(predictor, task_name="oc20")
# Set up your system as an ASE atoms object
slab = fcc100("Cu", (3, 3, 3), vacuum=8, periodic=True)
adsorbate = molecule("CO")
add_adsorbate(slab, adsorbate, 2.0, "bridge")
slab.calc = calc
# Set up LBFGS dynamics object
opt = LBFGS(slab)
opt.run(0.05, 100)
Relax an inorganic crystal,
from ase.build import bulk
from ase.optimize import FIRE
from ase.filters import FrechetCellFilter
from fairchem.core import pretrained_mlip, FAIRChemCalculator
predictor = pretrained_mlip.get_predict_unit("uma-s-1p1", device="cuda")
calc = FAIRChemCalculator(predictor, task_name="omat")
atoms = bulk("Fe")
atoms.calc = calc
opt = LBFGS(FrechetCellFilter(atoms))
opt.run(0.05, 100)
Run molecular MD,
from ase import units
from ase.io import Trajectory
from ase.md.langevin import Langevin
from ase.build import molecule
from fairchem.core import pretrained_mlip, FAIRChemCalculator
predictor = pretrained_mlip.get_predict_unit("uma-s-1p1", device="cuda")
calc = FAIRChemCalculator(predictor, task_name="omol")
atoms = molecule("H2O")
atoms.calc = calc
dyn = Langevin(
atoms,
timestep=0.1 * units.fs,
temperature_K=400,
friction=0.001 / units.fs,
)
trajectory = Trajectory("my_md.traj", "w", atoms)
dyn.attach(trajectory.write, interval=1)
dyn.run(steps=1000)
fairchemby the FAIR Chemistry teamfairchemis the FAIR Chemistry’s centralized repository of all its data, models, demos, and application efforts for materials science and quantum chemistry.Read our latest release post!
Read about the UMA model and OMol25 dataset release.
Try the demo!
If you want to explore model capabilities check out our educational demo
Installation
Although not required, we highly recommend installing using a package manager and virtualenv such as uv, it is much faster and better at resolving dependencies than standalone pip.
Install fairchem-core using pip
If you want to contribute or make modifications to the code, clone the repo and install in edit mode
Quick Start
The easiest way to use pretrained models is via the ASE
FAIRChemCalculator. A single uma model can be used for a wide range of applications in chemistry and materials science by picking the appropriate task name for domain specific prediction.Instantiate a calculator from a pretrained model
Make sure you have a Hugging Face account, have already applied for model access to the UMA model repository, and have logged in to Hugging Face using an access token. You can use the following to save an auth token,
Models are referenced by their name, below are the currently supported models:
Set the task for your application and calculate
Relax an adsorbate on a catalytic surface,
Relax an inorganic crystal,
Run molecular MD,
Calculate a spin gap,
LICENSE
fairchemis available under a MIT License. Models/checkpoint licenses vary by application area.