Machine learning models for chemistry and materials science by the FAIR Chemistry team
Project description
fairchem by the FAIR Chemistry team
fairchem is the FAIR Chemistry's centralized repository of all its data, models,
demos, and application efforts for materials science and quantum chemistry.
:warning: 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.
[!CAUTION] UMA models and legacy inorganic bulk models trained using OMat24 are trained with DFT and DFT+U total energy labels. These are not compatible with Materials Project calculations. If you are using UMA or models trained on OMat24 only for such calculations, you can find a OMat24 specific calculations of reference unary compounds and MP2020-style anion and GGA/GGA+U mixing corrections in the OMat24 Hugging Face repo. Do not use MP2020 corrections or use the MP references compounds when using OMat24 trained models. Additional care must be taken when computing energy differences, such as formation and energy above hull and comparing with calculations in the Materials Project since DFT pseudopotentials are different and magnetic ground states may differ as well.
Latest news
Oct 2025 - check out our seamless Multi-node, Multi-GPU and LAMMPs interfaces to run large scale dynamics!
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
pip install fairchem-core
If you want to contribute or make modifications to the code, clone the repo and install in edit mode
git clone git@github.com:facebookresearch/fairchem.git
pip install -e fairchem/packages/fairchem-core[dev]
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,
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 = FIRE(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)
Calculate a spin gap,
from ase.build import molecule
from fairchem.core import pretrained_mlip, FAIRChemCalculator
predictor = pretrained_mlip.get_predict_unit("uma-s-1p1", device="cuda")
# singlet CH2
singlet = molecule("CH2_s1A1d")
singlet.info.update({"spin": 1, "charge": 0})
singlet.calc = FAIRChemCalculator(predictor, task_name="omol")
# triplet CH2
triplet = molecule("CH2_s3B1d")
triplet.info.update({"spin": 3, "charge": 0})
triplet.calc = FAIRChemCalculator(predictor, task_name="omol")
triplet.get_potential_energy() - singlet.get_potential_energy()
Multi-GPU Inference and LAMMPs
If you have multiple gpus (or multiple nodes), we handle all the parallelism for you under the hood by a single flag (workers=N). For example, you can run the following 8000 atom md simulation with ~10 qps (8x H100 GPU), ~10x faster than single-gpu inference! Current benchmarks show we can run uma-s @ ~1 ns/per day with 100k+ atoms systems in real MD scenarios (more on this to come!). This is also compatible with LAMMPs to perform large scale MD. See our docs for more details. This requires the Ray package to be installed and comes with the extras bundle.
pip install fairchem-core[extras]
from ase import units
from ase.md.langevin import Langevin
from fairchem.core import pretrained_mlip, FAIRChemCalculator
import time
from fairchem.core.datasets.common_structures import get_fcc_carbon_xtal
predictor = pretrained_mlip.get_predict_unit(
"uma-s-1p1", inference_settings="turbo", device="cuda", workers=8
)
calc = FAIRChemCalculator(predictor, task_name="omat")
atoms = get_fcc_carbon_xtal(8000)
atoms.calc = calc
dyn = Langevin(
atoms,
timestep=0.1 * units.fs,
temperature_K=400,
friction=0.001 / units.fs,
)
# warmup 10 steps
dyn.run(steps=10)
start_time = time.time()
dyn.attach(
lambda: print(
f"Step: {dyn.get_number_of_steps()}, E: {atoms.get_potential_energy():.3f} eV, "
f"QPS: {dyn.get_number_of_steps()/(time.time()-start_time):.2f}"
),
interval=1,
)
dyn.run(steps=1000)
LICENSE
fairchem is available under a MIT License. Models/checkpoint licenses vary by application area.
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fairchem_core-2.13.0.tar.gz.
File metadata
- Download URL: fairchem_core-2.13.0.tar.gz
- Upload date:
- Size: 248.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8ccefcdef4ea8fc13fee63a964a5b9e0663dc1eccd5d131bb0887514f2bbb21
|
|
| MD5 |
81f0ae74a6f3e686f564477301829625
|
|
| BLAKE2b-256 |
10cf0c6e0fa2a00c1747b9e06aa280370a93dcc4bdc2cc89b7eb17d1a0e7dcc8
|
Provenance
The following attestation bundles were made for fairchem_core-2.13.0.tar.gz:
Publisher:
release.yml on facebookresearch/fairchem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fairchem_core-2.13.0.tar.gz -
Subject digest:
b8ccefcdef4ea8fc13fee63a964a5b9e0663dc1eccd5d131bb0887514f2bbb21 - Sigstore transparency entry: 760419627
- Sigstore integration time:
-
Permalink:
facebookresearch/fairchem@0c649ae3b2637cee5019efc679fb660eb054dfb6 -
Branch / Tag:
refs/tags/fairchem_core-2.13.0 - Owner: https://github.com/facebookresearch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c649ae3b2637cee5019efc679fb660eb054dfb6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fairchem_core-2.13.0-py3-none-any.whl.
File metadata
- Download URL: fairchem_core-2.13.0-py3-none-any.whl
- Upload date:
- Size: 353.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d804955a9c6d8600373214bb6b361848d3579ccf7eea1e62e2a4827e4cbd3371
|
|
| MD5 |
884561e7770b2a0545c5ab404f7733cb
|
|
| BLAKE2b-256 |
ff81454aa513417936c14d3a0b53e543ca6ec7255c0e64e947f9652f95a0846f
|
Provenance
The following attestation bundles were made for fairchem_core-2.13.0-py3-none-any.whl:
Publisher:
release.yml on facebookresearch/fairchem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fairchem_core-2.13.0-py3-none-any.whl -
Subject digest:
d804955a9c6d8600373214bb6b361848d3579ccf7eea1e62e2a4827e4cbd3371 - Sigstore transparency entry: 760419632
- Sigstore integration time:
-
Permalink:
facebookresearch/fairchem@0c649ae3b2637cee5019efc679fb660eb054dfb6 -
Branch / Tag:
refs/tags/fairchem_core-2.13.0 - Owner: https://github.com/facebookresearch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c649ae3b2637cee5019efc679fb660eb054dfb6 -
Trigger Event:
release
-
Statement type: