Calculator and enumerated in MLIPEnum for easy iteration across benchmarks.
MLIPEnum
MLIPEnum is a Python Enum built dynamically at import time from registry.yaml. Each member’s name is the model’s display name and its value is the calculator class.
MLIPEnum only contains models whose packages are installed in the current environment. If a model’s dependency is missing, it is silently skipped with a warning rather than raising an import error.The MLIP base class
HuggingFace-hosted models inherit fromMLIP, defined in mlip_arena/models/__init__.py:
PyTorchModelHubMixin inheritance means any MLIP subclass can be uploaded to and downloaded from HuggingFace Hub with push_to_hub() and from_pretrained().
MLIPCalculator
MLIPCalculator combines MLIP (the neural network) with ASE’s Calculator interface:
get_freer_device() picks the CUDA GPU with the most free memory, falls back to MPS on Apple Silicon, and finally to CPU.
External ASE calculators vs HuggingFace models
- External ASE calculators
- HuggingFace models
Most models in the registry are implemented as external ASE calculators under
mlip_arena/models/externals/. They wrap third-party packages and set module: externals in the registry.When to use this approach:- The model already ships its own inference code (e.g.,
mace-torch,chgnet,matgl). - You want to add a model quickly without implementing a custom graph network.
The model registry.yaml structure
Each entry inmlip_arena/models/registry.yaml has the following fields:
Dynamic loading at import time
When youimport mlip_arena.models, the __init__.py reads registry.yaml and dynamically imports each model class:
MLIPEnum. This allows you to install only a subset of models and still use the library.
Available models
Prediction types:
E = energy, F = forces, S = stress, M = magnetic moments.
Using get_calculator()
get_calculator() from mlip_arena.tasks.utils is the recommended way to instantiate a calculator. It handles device selection, optional dispersion correction via TorchDFTD3Calculator, and accepts multiple input types:
get_calculator() returns a BaseCalculator instance, so it is compatible with all MLIP Arena tasks.