Overview
Themlip_arena.models module exposes three top-level objects that provide a unified interface to all registered machine learning interatomic potential (MLIP) models:
REGISTRY— raw dict loaded fromregistry.yamlMLIPMap— dict mapping model names to their Python classesMLIPEnum— anEnumbuilt fromMLIPMapfor safe, enumerable model referencesMLIP— the base class all native MLIP models inherit from
MLIPEnum
MLIPEnum is a Python Enum whose members are the successfully-imported MLIP model classes. It is built at import time from MLIPMap.
Iterating over all models
Accessing a model by name
Members
Members are populated at runtime from the registry. Any model whose package is not installed is silently skipped with a warning. The full set of registered models is:| Member name | Class | Family |
|---|---|---|
MACE-MP(M) | MACE_MP_Medium | mace-mp |
CHGNet | CHGNet | chgnet |
M3GNet | M3GNet | matgl |
MatterSim | MatterSim | mattersim |
ORBv2 | ORBv2 | orb |
SevenNet | SevenNet | sevennet |
eqV2(OMat) | eqV2 | fairchem |
MACE-MPA | MACE_MPA | mace-mp |
eSEN | eSEN | fairchem |
EquiformerV2(OC22) | EquiformerV2 | equiformer |
EquiformerV2(OC20) | EquiformerV2OC20 | equiformer |
eSCN(OC20) | eSCN | escn |
MACE-OFF(M) | MACE_OFF_Medium | mace-off |
ANI2x | ANI2x | ani |
ALIGNN | ALIGNN | alignn |
DeepMD | DeepMD | deepmd |
ORB | ORB | orb |
Only models whose Python packages are installed in the current environment will appear as members of
MLIPEnum. Missing packages produce a warning log and are skipped.MLIPMap
MLIPMap is the plain dict from which MLIPEnum is built. Keys are model name strings; values are the corresponding Python classes.
MLIPMap directly when you need a dict interface (e.g. programmatic selection, serialization).
MLIP
Inheritance
MLIP inherits from both torch.nn.Module and huggingface_hub.PyTorchModelHubMixin, and is registered with the HuggingFace Hub tags ["atomistic-simulation", "MLIP"].
Constructor
The underlying PyTorch model to wrap. Stored as
self.model.from_pretrained
Class method inherited from PyTorchModelHubMixin. Downloads and instantiates a model from the HuggingFace Hub or a local path.
HuggingFace Hub model ID (e.g.
"atomind/mace-mp") or local directory path.Re-download files even if they already exist in the cache.
Resume an incomplete download.
None uses the hub’s default behaviour.Dict of proxies for HTTP/HTTPS requests, passed to
requests.HuggingFace authentication token. Pass
True to use the cached token from huggingface-cli login.Override the default HuggingFace cache directory.
If
True, only use locally cached files and raise an error if none exist.Git revision (branch, tag, or commit hash) to pull from the Hub.
Additional keyword arguments forwarded to the model’s
__init__.An instantiated
MLIP subclass loaded from the specified source.forward
self.model(x). Subclasses override this to handle graph construction and model-specific preprocessing.
Model input. For
MLIPCalculator subclasses this is a batched graph data object created by collate_fn.Raw output from the underlying model. Subclasses typically return a dict with keys
energy, forces, and stress.