Skip to main content

Metatensor logo

tests status documentation coverage

metatrain is a command line interface (CLI) to train and evaluate atomistic models of various architectures. It features a common yaml option inputs to configure training and evaluation. Trained models are exported as standalone files that can be used directly in various molecular dynamics (MD) engines (e.g. ASE, LAMMPS, i-PI, TorchSim, ESPResSo,...) using the metatomic interface.

The idea behind metatrain is to have a general training hub that provides a homogeneous environment and user interface, transforming every ML architecture into an end-to-end model that can be connected to MD engines. Any custom architecture compatible with TorchScript can be integrated into metatrain, gaining automatic access to a training and evaluation interface, as well as compatibility with various MD engines.

List of Implemented Architectures

Currently metatrain supports the following architectures for building an atomistic model:

Name Description
PET Point Edge Transformer (PET), interatomic machine learning potential
SOAP-BPNN A Behler-Parrinello neural network with SOAP features
MACE A higher order equivariant message passing neural network.
SPACE SO(3)-equivariant message-passing model with physical radial functions and fast tensor products.
GAP Sparse Gaussian Approximation Potential (GAP) using Smooth Overlap of Atomic Positions (SOAP).
FlashMD An architecture for the direct prediction of molecular dynamics
DPA3 An invariant graph neural network based on line graph series representations
Symplectic FlashMD A symplectic variant of FlashMD for the direct prediction of molecular dynamics.

It also contains architectures meant to simplify tasks or augment the capabilities of the models:

Name Description
Composition Per-species linear fit to training targets
Scaler Per-species, target and property scales for training targets.
LLPR Cheap uncertainty quantification via the last-layer prediction rigidity (LLPR) approach

Documentation

For details, tutorials, and examples, please visit our documentation.

Installation

Install metatrain with pip:

pip install metatrain

Install specific models by specifying the model name. For example, to install the SOAP-BPNN model:

pip install metatrain[soap-bpnn]

We also offer a conda installation:

conda install -c conda-forge metatrain

⚠️ The conda installation does not install model-specific dependencies and will only work for architectures without optional dependencies such as PET.

After installation, you can use mtt from the command line to train your models!

Quickstart

To train a model, use the following command:

mtt train options.yaml

Where options.yaml is a configuration file specifying training options. For example, the following configuration trains a SOAP-BPNN model on the QM9 dataset:

# architecture used to train the model
architecture:
  name: soap_bpnn
  training:
    num_epochs: 5  # a very short training run

# Mandatory section defining the parameters for system and target data of the training set
training_set:
  systems: "qm9_reduced_100.xyz"  # file where the positions are stored
  targets:
    energy:
      key: "U0"      # name of the target value
      unit: "eV"     # unit of the target value

test_set: 0.1        # 10% of the training_set are randomly split for test
validation_set: 0.1  # 10% of the training_set are randomly split for validation

Shell Completion

metatrain comes with completion definitions for its commands for bash and zsh. You must manually configure your shell to enable completion support.

To make the completions available, source the definitions in your shell’s startup file (e.g., ~/.bash_profile, ~/.zshrc, or ~/.profile):

source $(mtt --shell-completion)

Having problems or ideas?

Having a problem with metatrain? Please let us know by submitting an issue.

Submit new features or bug fixes through a pull request.

Contributors

Thanks goes to all people who make metatrain possible:

Contributors

The overall metatrain project is maintained by @pfebrer and @PicoCentauri who will reply to issues and pull requests opened on this repository as soon as possible. You can mention them directly if you did not receive an answer after a couple of days. It was previously maintained by @frostedoyster (2023 to 2026), many thanks to them for their work making metatrain awesome!

Additionally, different architectures are maintained by separate maintainers, you can find their names in the corresponding documentation

Citing metatrain

If you found metatrain useful for your work, please cite the corresponding article:

F. Bigi, J.W. Abbott, P. Loche et. al.
Metatensor and metatomic: foundational libraries for interoperable atomistic machine learning, (2026).
https://doi.org/10.1063/5.0304911

@article{bigi_metatensor_2026,
  title = {Metatensor and Metatomic: {{Foundational}} Libraries for Interoperable Atomistic Machine Learning},
  shorttitle = {Metatensor and Metatomic},
  author = {Bigi, Filippo and Abbott, Joseph W. and Loche, Philip and Mazitov, Arslan and Tisi, Davide and Langer, Marcel F. and Goscinski, Alexander and Pegolo, Paolo and Chong, Sanggyu and Goswami, Rohit and Febrer, Pol and Chorna, Sofiia and Kellner, Matthias and Ceriotti, Michele and Fraux, Guillaume},
  year = 2026,
  month = feb,
  journal = {J. Chem. Phys.},
  volume = {164},
  number = {6},
  pages = {064113},
  issn = {0021-9606},
  doi = {10.1063/5.0304911},
}

Release files for metatrain 2026.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metatrain 2026.4.1
File Size Uploaded
metatrain-2026.4.1.tar.gz 2.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for metatrain 2026.4.1
File Interpreter ABI Platform
metatrain-2026.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.9 MB

Release files / metatrain-2026.4.1.tar.gz

Download URL metatrain-2026.4.1.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
76f5d772d32042cffa4b1c145d4654f799fa0a3334da91eef47ae77fdeae51ca
BLAKE2b-256 checksum
How to use checksums
d7c811535075265e5716c55051663d979c11a4df86c4bad41555755b6a046142
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / metatrain-2026.4.1-py3-none-any.whl

Download URL metatrain-2026.4.1-py3-none-any.whl
Size 3.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c26aa6bc13ecf727f369e84b49e5032a0da420cf582caa86032c142a543e0f8f
BLAKE2b-256 checksum
How to use checksums
12b8fe5b7308cad35e97139a0e9881eb4de4e53d3ef568d4b710f7afb76bb5d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page