Skip to main content
MLIP Arena supports two approaches for registering a model. Choose the one that best matches your model’s codebase.

External ASE Calculator

This approach is recommended when your model already ships an ASE Calculator class, or when you want to wrap an existing third-party package quickly.
1

Implement your calculator class

Create a new Python file in mlip_arena/models/externals/. Name the file after your model family (e.g., mymodel.py).Subclass the upstream ASE calculator for your model and override __init__ and calculate as needed. The following is the complete CHGNet implementation as a reference:
chgnet.py
from __future__ import annotations

from typing import Literal

from ase import Atoms
from chgnet.model.dynamics import CHGNetCalculator
from chgnet.model.model import CHGNet as CHGNetModel

from mlip_arena.models.utils import get_freer_device


class CHGNet(CHGNetCalculator):
    def __init__(
        self,
        checkpoint: CHGNetModel | None = None,
        device: str | None = None,
        stress_weight: float | None = 1 / 160.21766208,
        on_isolated_atoms: Literal["ignore", "warn", "error"] = "warn",
        **kwargs,
    ) -> None:
        use_device = str(device or get_freer_device())
        super().__init__(
            model=checkpoint,
            use_device=use_device,
            stress_weight=stress_weight,
            on_isolated_atoms=on_isolated_atoms,
            **kwargs,
        )

    def calculate(
        self,
        atoms: Atoms | None = None,
        properties: list | None = None,
        system_changes: list | None = None,
    ) -> None:
        super().calculate(atoms, properties, system_changes)

        # for ase.io.write compatibility
        self.results.pop("crystal_fea", None)
Remove any unnecessary keys from self.results inside your calculate method. Extra keys that are not standard ASE properties (such as crystal_fea above) cause errors during molecular dynamics simulations and trajectory writes. Use self.results.pop("key", None) to strip them after calling super().calculate().
Use get_freer_device() from mlip_arena.models.utils to automatically select the least-loaded GPU, or fall back to CPU when no GPU is available. Pass device as a constructor argument so callers can override it.
2

Add your model to registry.yaml

Open mlip_arena/models/registry.yaml and add an entry for your model. Use the class name as the top-level key:
CHGNet:
  module: externals
  class: CHGNet
  family: chgnet
  package: chgnet==0.3.8
  checkpoint: v0.3.0
  username: cyrusyc
  last-update: 2024-07-08T00:00:00
  datetime: 2024-07-08T00:00:00
  datasets:
    - MPTrj
  gpu-tasks:
    - homonuclear-diatomics
    - stability
    - combustion
    - eos_bulk
    - wbm_ev
  github: https://github.com/CederGroupHub/chgnet
  doi: https://doi.org/10.1038/s42256-023-00716-3
  date: 2023-02-28
  prediction: EFSM
  nvt: true
  npt: true
  license: BSD-3-Clause
See the registry fields reference below for a description of every field.
3

Test your calculator

Run the external calculator test suite to confirm your model loads and produces valid outputs:
pytest -vra tests/test_external_calculators.py
The test instantiates every registered model, creates a two-atom Atoms object, and asserts that get_potential_energy(), get_forces(), and get_stress() return arrays of the correct shape and dtype.
4

Open a pull request

Commit your new file and the registry entry, then open a PR against main. The CI pipeline will run the full test suite and perform a trial sync to the Hugging Face Space.

registry.yaml fields

Every entry in mlip_arena/models/registry.yaml supports the following fields:
FieldRequiredDescription
moduleYesPython submodule under mlip_arena/models/. Use externals for all external calculators.
classYesExact Python class name of the calculator. Must match the class defined in the module.
familyYesModel family name (e.g., mace-mp, chgnet). Used for grouping on the leaderboard.
packageYesPyPI package name and pinned version to install (e.g., chgnet==0.3.8).
checkpointYesDefault checkpoint identifier — a version string, filename, or HF repo ID.
usernameNoHuggingFace username of the model’s contributor or upstream author.
datasetsYesList of training datasets (e.g., MPTrj, Alexandria, OMat).
gpu-tasksNoList of benchmark task IDs that run on GPU.
cpu-tasksNoList of benchmark task IDs that run on CPU.
predictionYesOutput properties: E (energy), F (forces), S (stress), M (magnetic moments). Combine as EFS, EFSM, etc.
nvtYestrue if the model supports NVT molecular dynamics.
nptYestrue if the model supports NPT molecular dynamics.
licenseYesSPDX license identifier (e.g., MIT, Apache-2.0, BSD-3-Clause).
doiNoDOI or arXiv URL of the paper describing the model.
githubNoURL of the model’s source code repository.
dateYesRelease date of the model in YYYY-MM-DD format.
datetimeYesFull ISO 8601 timestamp of the last update.
The gpu-tasks and cpu-tasks lists control which benchmarks will be run for your model on the Hugging Face Space. Add only the tasks your model has been validated on. You can expand this list in future PRs.