Fine-tune MACE machine learning interatomic potentials on custom datasets.

MITAuto-check passedAI & LLM Engineering

Install ML Mace Finetune

skills CLI
$ npx skills add learningmatter-mit/AtomisticSkills --skill ml-mace-finetune -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install learningmatter-mit/AtomisticSkills ml-mace-finetune --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/learningmatter-mit/AtomisticSkills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ml-mace-finetune .claude/skills/ml-mace-finetune && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ml-mace-finetune
GitHub stars
175
Token cost
~2.6k tokens
SKILL.md length
1,051 words
Files
10 (incl. scripts)
Skills in repo
129
Repo updated
First seen
Licence
MIT

At a glance

Fine-tune MACE machine learning interatomic potentials on custom datasets.

  • Works in 8 steps: Prepare Labeled Dataset: Obtain diverse… → Custom Data Conversion: Read the source… → Benchmarking: Predict results on the new… → …
  • Tasks that involve Fine-tuning
  • SKILL.md covers Goal, Instructions, Training Configuration and Examples, plus 1 more section
  • Runs Python scripts from its folder

What it does

ML Mace Finetune is an agent skill from learningmatter-mit/AtomisticSkills. Fine-tune MACE machine learning interatomic potentials on custom datasets.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 12 other files, including scripts (for example `examples/mace-wbm-finetune/README.md`, `examples/mace-wbm-finetune/finetune_config.yaml` and `examples/mace-wbm-finetune/training_history.json`).

It sits in AI & LLM Engineering, covering Fine-tuning and Machine learning. The repository describes itself as: Integrating AtomisticSkills into Agentic IDEs (Cursor, Claude Code, Codex, Google Antigravity, Hermes Agent, etc). The licence is MIT.

When your agent uses it

  • Tasks that involve Fine-tuning
  • Tasks that involve Machine learning

Example prompts

  • “/ml-mace-finetune”

Requirements

  • Python 3

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. Prepare Labeled Dataset: Obtain diverse structures with high-fidelity labels (energy, forces, stress). See the /benchmark-finetuning…
  2. Custom Data Conversion: Read the source data format and write a customized conversion script if needed, formatting it for the subsequent…
  3. Benchmarking: Predict results on the new labels and benchmark the foundation model using ml-mlip-benchmark.
  4. Data Preparation: Execute scripts/prepare_mace_data.py to convert JSON structures to .xyz data files.
  5. Config Generation: Execute scripts/generate_mace_config.py using the .xyz data to produce finetune_config.yaml.
  6. Fine-Tuning: Execute mace_run_train --config /path/to/finetune_config.yaml to begin fine-tuning natively on the GPU.
  7. Validation: Verify convergence and compare against the benchmarked foundation metrics.
  8. Registration: Use the register_model tool to register the newly fine-tuned model checkpoint into the local registry so future research…

What it can do on your machine

Read from SKILL.md and the folder at commit 7f2d86d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

ML Mace Finetune loads about 2.6k tokens when it runs. Until then it costs about 23 tokens; SKILL.md has 1,051 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~23
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from learningmatter-mit/AtomisticSkills at commit 7f2d86d, republished under its MIT licence (© learningmatter-mit). 1,051 words, ~2,574 tokens.

Download SKILL.mdSave it as .claude/skills/ml-mace-finetune/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
ml-mace-finetune
description
Fine-tune MACE machine learning interatomic potentials on custom datasets.
metadata.category
machine-learning
metadata.venv
cpu, mlip

MACE Fine-tuning

Goal

To evaluate and improve the accuracy of a foundation MACE potential for a specific chemical system or physical property using the provided Python fine-tuning script and data-augmentation.

Instructions

  1. Prepare Labeled Dataset: Obtain diverse structures with high-fidelity labels (energy, forces, stress). See the /benchmark-finetuning workflow for details.
  2. Custom Data Conversion: Read the source data format and write a customized conversion script if needed, formatting it for the subsequent preparation step.
  3. Benchmarking: Predict results on the new labels and benchmark the foundation model using ml-mlip-benchmark.
  4. Data Preparation: Execute scripts/prepare_mace_data.py to convert JSON structures to .xyz data files.
  5. Config Generation: Execute scripts/generate_mace_config.py using the .xyz data to produce finetune_config.yaml.
  6. Fine-Tuning: Execute mace_run_train --config /path/to/finetune_config.yaml to begin fine-tuning natively on the GPU.
  7. Validation: Verify convergence and compare against the benchmarked foundation metrics.
  8. Registration: Use the register_model tool to register the newly fine-tuned model checkpoint into the local registry so future research tasks can discover and reuse it.

Training Configuration

MACE fine-tuning is divided into a data preparation step, a configuration generation step, and a standard native training run. The script scripts/prepare_mace_data.py generates .xyz files, and scripts/generate_mace_config.py converts arguments into a fully-formed finetune_config.yaml configuration compatible with the MACE default parser.

Basic Arguments (Data Prep Script)
KeyTypeDefaultDescription
--datastr(Required)Path to JSON file containing ASE/pymatgen structure dictionaries
--output-dirstr./fine_tuning_dataDirectory to save the converted .xyz data
--val-splitfloat0.1Fraction of data to set aside for validation
--seedint42Random seed for validation splitting
--vasp-stress-conversionflag-If set, multiplies stress values by -1/160.2x to convert VASP raw kB to eV/ų
Basic Arguments (Configuration Generation Script)
KeyTypeDefaultDescription
--train-filestr(Required)Path to the converted train.xyz data
--valid-filestrNonePath to the valid.xyz data
--modelstrMACE-MP-smallBase model name or path to a checkpoint
--epochsint100Number of training epochs
--lrfloat0.01Peak learning rate for training
--batch-sizeint2Training batch size
--output-dirstr./fine_tuningDirectory to save the fine-tuned model and logs
--devicestrcudaTarget compute device (cuda or cpu)

[!NOTE] If you have created a dedicated research directory for your current workflow (e.g. using the create_research_dir tool), you should set the --output-dir argument to a folder within that active research directory to keep all artifacts and models organized.

Model Freezing and Heads (Configuration Generation Script)
KeyTypeDefaultChoicesDescription
--freeze-backboneflagN/AAdd flagFreeze backbone (interaction blocks); only readout heads are trained.
--reinit-headflagN/AAdd flagRe-initialize readout weights. When absent (default), pre-trained readout is preserved.
--multiheadsflagN/AAdd flagEnable multi-head fine-tuning (adds new head while keeping existing ones).
Advanced Parameters (Manual YAML Injection)

[!IMPORTANT] The following parameters govern Optimizer, Regularization, and Scheduling. They are NOT exposed via the prepare_mace_data.py CLI. Note that prepare_mace_data.py exposes --energy-weight, --forces-weight (default 10.0), and --stress-weight which inject cleanly into the initial YAML. For all other properties below, you must manually append the keys to the generated finetune_config.yaml file prior to running mace_run_train.

Optimizer & Regularization
KeyTypeDefaultChoices / RangeDescription
optimizerstr"adam""adam", "adamw", "schedulefree"Optimizer type.
weight_decayfloat5e-7≥0L2 weight decay.
amsgradboolTrueTrue, FalseUse AMSGrad variant of Adam.
clip_gradfloat10.0>0 or NoneMaximum gradient norm for clipping. Set to None to disable.
emaboolTrueTrue, FalseEnable exponential moving average of model weights.
ema_decayfloat0.990–1EMA decay rate. Higher = more smoothing.
LR Scheduler
KeyTypeDefaultChoices / RangeDescription
schedulerstr"ReduceLROnPlateau""ReduceLROnPlateau", "ExponentialLR"LR scheduler type.
lr_factorfloat0.80–1Factor by which LR is reduced on plateau (for ReduceLROnPlateau).
scheduler_patienceint50≥1Epochs without improvement before reducing LR (for ReduceLROnPlateau).
lr_scheduler_gammafloat0.99930–1Per-epoch multiplicative decay factor (for ExponentialLR).

ReduceLROnPlateau (default): Monitors validation loss. When loss stops improving for scheduler_patience epochs, LR is multiplied by lr_factor.

ExponentialLR: LR decays every epoch by lr_scheduler_gamma. At epoch n: LR = learning_rate × lr_scheduler_gamma^n.

Show full SKILL.md (395 more words)Show less
Early Stopping
KeyTypeDefaultChoices / RangeDescription
patienceint2048≥1Stop training after this many epochs without improvement.

[!NOTE] Default patience=2048 effectively disables early stopping. Set lower (e.g., 100–200) if you want to stop early.

Loss Function
KeyTypeDefaultChoicesDescription
lossstr"weighted""weighted", "universal", etc.Loss function type. "universal" is auto-set by data script when stress data is detected.
energy_weightfloat1.0≥0Weight for energy loss (exposed via CLI).
forces_weightfloat10.0≥0Weight for forces loss (exposed via CLI).
stress_weightfloat1.0≥0Weight for stress loss (exposed via CLI).
compute_forcesboolTrueTrue, FalseInclude forces in training.
compute_stressboolFalseTrue, FalseInclude stress in training (auto-enabled by data script).

[!WARNING] Stress Units: MACE expects stress in eV/ų. Raw VASP stress obtained directly via some JSON files may be in kilo-Bar (kB), which is ~160x larger and will cause catastrophic training divergence. The Atomate2 MCP tool handles this conversion automatically when convert_units=True. However, if your JSON labels contain raw kB stress, you MUST pass the --vasp-stress-conversion flag to scripts/prepare_mace_data.py to automatically scale them by -1/160.2x. For more details on unit standardization, see @[skills/general-property-units/SKILL.md].

[!WARNING] Learning rate sensitivity for MACE-OMAT: The official MACE docs recommend lr=0.01 for MACE-MP-0, but MACE-OMAT-0-small requires lr=1e-4 to avoid divergence. Higher values (1e-3, 0.01) cause catastrophic forgetting even with frozen backbone + EMA.

[!IMPORTANT] The generated finetune_config.yaml maps exactly to mace_run_train arguments. You can open and manually modify the YAML file before running mace_run_train to inject any advanced parameter.

Usage:

bash
# 1. Prepare Data
${CLAUDE_SKILL_DIR}/../../venv/run mlip python ${CLAUDE_SKILL_DIR}/scripts/prepare_mace_data.py \
    --data /path/to/training_data.json \
    --output-dir ./mace_finetuned_data

# 2. Generate Configuration
${CLAUDE_SKILL_DIR}/../../venv/run mlip python ${CLAUDE_SKILL_DIR}/scripts/generate_mace_config.py \
    --train-file ./mace_finetuned_data/train.xyz \
    --valid-file ./mace_finetuned_data/valid.xyz \
    --model MACE-OMAT-0-small \
    --epochs 10 \
    --lr 1e-4 \
    --batch-size 2 \
    --freeze-backbone \
    --output-dir ./mace_finetuned

# 3. Run Training
${CLAUDE_SKILL_DIR}/../../venv/run mlip mace_run_train --config ./mace_finetuned/finetune_config.yaml

# 4. Extract Training Logs (Optional, to create standard training_history.json)
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/extract_mace_logs.py \
    --results-dir ./mace_finetuned/results

Examples

See the mace-wbm-finetune directory for a complete, runnable example of 10-epoch fine-tuning on high-energy crystal structures (WBM dataset), including exact usage of the --vasp-stress-conversion flag and diagnostic output artifacts.

Constraints

  • Data Size: For small datasets (<500 structures), freeze_backbone=True is strongly recommended.
  • Reference Energies (E0s): If your fine-tuning data is computed using the same DFT functional (e.g., PBE) as the foundation model's original training data, you should reuse the foundation model's original isolated atom reference energies (E0s) instead of re-fitting them. This maintains thermodynamic compatibility across the periodic table for elements not in your fine-tuning set.
  • Units (input): Stress labels must be in eV/ų as per project standards.
  • Units (output): All training_history.json files use meV units: energy MAE in meV/atom, force MAE in meV/Å, stress MAE in meV/ų.

Author: Bowen Deng Contact: GitHub @learningmatter-mit

© learningmatter-mit, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files (scripts) in skills/ml-mace-finetune of learningmatter-mit/AtomisticSkills.

  • SKILL.md
  • examples/mace-wbm-finetune/README.md
  • examples/mace-wbm-finetune/finetune_config.yaml
  • examples/mace-wbm-finetune/label_distributions.png
  • examples/mace-wbm-finetune/training_history.json
  • examples/mace-wbm-finetune/training_history.png
  • examples/mace-wbm-finetune/valid.xyz
  • scripts/extract_mace_logs.py
  • scripts/generate_mace_config.py
  • scripts/prepare_mace_data.py

Open the folder on GitHubat commit 7f2d86d

Compare with similar skills

ML Mace Finetune next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

ML Mace Finetune compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
ML Mace Finetune this skilllearningmatter-mit/AtomisticSkills175—~2.6kAutomated safety check: PassMIT
Unimoljinzhezenggroup/computational-chemistry-agent-skills1481 repos~1.5kAutomated safety check: PassLGPL-3.0-or-later
Deepmd TrainHello-QM/catgo-LRG2051 repos~1.1kAutomated safety check: PassAGPL-3.0
ML Research LabAnastasiyaW/codex-claude-code-config154—~794Automated safety check: PassMIT
RuView Model Trainingruvnet/RuView97k—~1.3kAutomated safety check: NotesMIT
ML Experiment IterationLeeroo-AI/superml195—~4.8kAutomated safety check: PassApache-2.0

Similar skills

  • Unimol

    jinzhezenggroup/computational-chemistry-agent-skills

    A standardized CLI wrapper for Uni-Mol molecular ML workflows that handles representation extraction (embeddings), model training (regression/classification), and property prediction with built-in…

    148 GitHub starsUsed in 1 repo~1.5k tokens
    AI & LLM EngineeringAuto-check passed
  • Deepmd Train

    Hello-QM/catgo-LRG

    Train DeePMD-kit machine learning potentials. An agent skill from Hello-QM/catgo-LRG.

    205 GitHub starsUsed in 1 repo~1.1k tokens
    AI & LLM EngineeringAuto-check passed
  • ML Research Lab

    AnastasiyaW/codex-claude-code-config

    Machine-learning research loop for dataset curation, fine-tuning, evaluation, inference deployment, experiment tracking, and model explainability.

    154 GitHub stars~794 tokensUpdated 5 days ago
    AI & LLM EngineeringAuto-check passed
  • Trains and evaluates several WiFi-signal-based pose and sensing models, from unsupervised pose estimation to domain adaptation and publishing.

    97k GitHub stars~1.3k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check: notes
  • ML Experiment Iteration

    Leeroo-AI/superml

    Produces ranked, evidence-grounded next steps when an ML experiment has stalled, drawing on a Leeroopedia knowledge base or on fetched docs and issues.

    195 GitHub stars~4.8k tokensUpdated 6 mo ago
    AI & LLM EngineeringAuto-check passed
  • Vision Sft

    wshobson/agents

    Fine-tune vision-language models (VLMs) with supervised learning on image+text data.

    40k GitHub stars~2k tokensUpdated 3 days ago
    AI & LLM EngineeringAuto-check passed

More from learningmatter-mit/AtomisticSkills

All 129 skills in this repo
  • Drug Binding Site Definition

    learningmatter-mit/AtomisticSkills

    Define a docking search box (center coordinates + box dimensions in Angstroms) from a co-crystal ligand, binding-site residues, or a saved JSON specification.

    175 GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Drug Complex System Builder

    learningmatter-mit/AtomisticSkills

    Build a solvated, charge-neutralized protein-ligand complex for OpenMM molecular dynamics simulation.

    175 GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Drug Pocket Detection

    learningmatter-mit/AtomisticSkills

    Identify and rank ligandable pockets on a protein structure or model using geometry (fpocket) or an ML predictor (P2Rank).

    175 GitHub stars~4k tokensUpdated yesterday
    Auto-check passed
  • Chem Bond Dissociation

    learningmatter-mit/AtomisticSkills

    Calculate homolytic and heterolytic bond dissociation energies (BDEs) for all single bonds in a molecule using MLIPs with RDKit fragmentation.

    175 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Chem Conformer Search

    learningmatter-mit/AtomisticSkills

    Generate molecular conformers with RDKit ETKDG, relax with MLIPs, and rank by energy with Boltzmann weighting.

    175 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Chem DB Mof

    learningmatter-mit/AtomisticSkills

    Query multiple MOF databases (QMOF via MPContribs; ARC-MOF DB7/Majumdar et al.

    175 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed

Questions about ML Mace Finetune

What does ML Mace Finetune do?

Fine-tune MACE machine learning interatomic potentials on custom datasets. ML Mace Finetune is an agent skill from learningmatter-mit/AtomisticSkills. Fine-tune MACE machine learning interatomic potentials on custom datasets.

When should I use ML Mace Finetune?

ML Mace Finetune fits situations like: tasks that involve Fine-tuning; tasks that involve Machine learning.

How do I install ML Mace Finetune in Claude Code?

Run `npx skills add learningmatter-mit/AtomisticSkills --skill ml-mace-finetune -a claude-code`. Or copy the skill folder (skills/ml-mace-finetune in learningmatter-mit/AtomisticSkills) into .claude/skills/ml-mace-finetune in your project. Claude Code loads it when a task matches its description.

How do I install ML Mace Finetune in Codex?

Run `npx skills add learningmatter-mit/AtomisticSkills --skill ml-mace-finetune -a codex`. Or copy the skill folder (skills/ml-mace-finetune in learningmatter-mit/AtomisticSkills) into .agents/skills/ml-mace-finetune in your project. Codex loads it when a task matches its description.

Can I use ML Mace Finetune in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add learningmatter-mit/AtomisticSkills --skill ml-mace-finetune -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ml-mace-finetune, .gemini/skills/ml-mace-finetune, .github/skills/ml-mace-finetune and .opencode/skills/ml-mace-finetune in your project.

What does ML Mace Finetune need to run?

Going by SKILL.md and its folder, ML Mace Finetune needs Python for the scripts in its folder. Our summary lists: Python 3.

Does ML Mace Finetune access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is ML Mace Finetune safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does ML Mace Finetune use?

ML Mace Finetune is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does ML Mace Finetune use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to ML Mace Finetune?

Skills that share tags, products or a category with ML Mace Finetune: Unimol (jinzhezenggroup/computational-chemistry-agent-skills, 148 stars), Deepmd Train (Hello-QM/catgo-LRG, 205 stars), ML Research Lab (AnastasiyaW/codex-claude-code-config, 154 stars) and RuView Model Training (ruvnet/RuView, 97k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains ML Mace Finetune?

learningmatter-mit (a GitHub organization) maintains it in learningmatter-mit/AtomisticSkills, which has 175 GitHub stars. The repository holds 129 skills in this directory. The repository was last updated on October 6, 2026.

Source: learningmatter-mit/AtomisticSkills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.