oh-my-mlip
AGENTS.md25 starsChanged 55 days agoMITView on GitHub
This file is for an AI coding agent (Claude Code, Codex or any other) working in a clone of this repository on a user's behalf: installing machine-learning interatomic potentials (MLIPs), running them, benchmarking them with CatBench, fine-tuning them, or distilling them. A person can follow it step by step too. Everything runs on the user's own Linux machine with an NVIDIA GPU — a workstation, or a node of a cluster. Each framework lives in its own conda env and…
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,266 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
19 rules. About 0 are common, 4 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Recover, but boundedly: When an install fails, classify the error with §8 and retry with a *different* strategy.
- Very specific: line 45
Before a build, install.sh compares the torch +cuNNN build with the CUDA version the NVIDIA driver supports.
- Very specific: line 104
When writing a standalone script, take python, imports, inference and env_run from resolve() and put them in the file.
- Very specific: line 115
Call resolve(model). Respect env_run and any note: they carry run conditions.
- Very specific: line 164
When result/ is filled, scripts/catbench_report.py --result <dir> --out <dir> runs CatBench's AdsorptionAnalysis, including the threshold …
- Very specific: line 239
Weights with restrictive licences are flagged, not refused: When a version has finetune.licence set (MACE-MH-1: ASL.
- Very specific: line 311
Check gated, license_url and weights in models.json before fetching:
- Distinctive: line 325
When a gated model is requested: check only whether a token is available, never read or print it:
- Distinctive: line 365
When none is known to work (a GPU newer than any listed, or an env whose arch entry is null) it stops before downloading and says why: …
- Very specific: line 447
use $OH_MY_MLIP_HOME if it is set and exists.
- Very specific: line 452
never use the copy of this repository inside an agent's plugin cache (~/.claude/plugins/...) as the hub: the host replaces it on every …
- Very specific: line 462
Read models.json, or call oh_my_mlip.list_models(), and report name, framework and whether each model is gated.
- Very specific: line 482
Run scripts/setup_survey.py first.
- Distinctive: line 489
If disk is short, include that in the same question.
- Distinctive: line 490
Ask through selectable options if the agent's interface offers them: install everything planned / only what is missing or broken / choose …
- Very specific: line 566
After a batch, retry each failed target through steps 1–4, then run scripts/setup_sweep.py report.
- Very specific: line 579
Follow docs/host_requirements.md "HPC clusters".
- Very specific: line 586
Do not redirect $HOME or add network workarounds yourself: set OMM_SHARED_CACHE_ROOT (the docs' export block) and install.sh handles both.
- Very specific: line 595
After each env, read envs/<env>/.omm_prefetch.json: a variant marked failed may not load on an offline GPU node.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
oh-my-mlip — Agent Guide
This file is for an AI coding agent (Claude Code, Codex or any other) working in a clone of this repository on a user's behalf: installing machine-learning interatomic potentials (MLIPs), running them, benchmarking them with CatBench, fine-tuning them, or distilling them. A person can follow it step by step too.
Everything runs on the user's own Linux machine with an NVIDIA GPU — a workstation, or a node of a cluster. Each framework lives in its own conda env and is called through that env's Python interpreter. Nothing here needs a job scheduler; where it helps, the tools can also write a SLURM script for the user to submit themselves.
Ground rules — read before installing anything
- One env at a time. Build, compile and verify one env completely before
starting the next. Never run two
install.sh,conda env createor pip-into-env builds at the same time: they race on the shared package cache and the env prefix, and stack GPU compiles that interfere with each other.install.shandscripts/setup_sweep.pyare serial by design; do not work around that with&,xargs -Por several shells. Before retrying a failed build, make sure no process from the earlier attempt is still running, and check free disk space first (DISK_FLOOR_GBinoh_my_mlip/hub.py, 30 GB;install.shrefuses to start a build below it). - Done means energy and forces on the GPU. A model is installed only when
scripts/setup_verify.py <model> --jsonpasses: it computes energy and forces and confirms the GPU was used. A zero exit code frominstall.shis not enough. - Recover, but boundedly. When an install fails, classify the error with §8
and retry with a different strategy.
scripts/setup_guardrail.pystops the loop when the same error repeats or the attempt budget runs out; then report to the user instead of retrying. - A label in the registry is not proof for this machine. A
validationvalue or note inmodels.jsondescribes where the model was checked before. Whether it works here is decided only bysetup_verify.pyon this machine; say so when a model has not been verified here. - Never load an empty or partial weight file. A cached or downloaded weight
must pass a size check (and a sha256 check when a fingerprint is recorded)
before it is loaded.
EOFError('Ran out of input')or "... does not exist" at load time usually means a broken download, not a broken model: remove it and fetch again. Frameworks whose own downloader accepts an empty file are pre-fetched byscripts/{prestage,prepare}_<env>_weights.py, whichinstall.shruns with the env's interpreter. - Driver too old for an env's CUDA build: say so, do not pretend to fall back.
Before a build,
install.shcompares the torch+cuNNNbuild with the CUDA version the NVIDIA driver supports. If the driver is older (for example CUDA 12.x against a+cu130build), the env still installs, but a CPU run is only available where the variant's own inference line takes a device: the lines run verbatim and most pindevice='cuda'. For those,get_calculatorrefuses the CPU request instead of building a CUDA calculator and calling it CPU, andsetup_verify.pyreports that failure. Tell the user a newer driver (or a host whose driver matches the build) is the fix; never report a GPU run as CPU, and never report a degraded run as GPU verification.
0. Read these first
models.json— the registry, and the only source of model facts. For each model: its env,importlines, per-versioninferencelines (the code that creates the calculator),arch_pinnedandgatedflags,env_runprefixes and notes. Look facts up here every time; never write them from memory.envs/<env>.yml— each env's recipe (conda + PyPI), whichinstall.shbuilds; this is the only way an env is installed.
Source $OH_MY_MLIP_HOME/env.sh in every shell that runs a model or a build: it
sets up the model caches and the CUDA environment that the D3 correction needs.
An agent's tool calls usually each start a fresh shell, so put it in the same
command: source "$OH_MY_MLIP_HOME/env.sh" && <command>.
1. Layout
oh-my-mlip/ # $OH_MY_MLIP_HOME (the clone root)
├── models.json # model registry
├── env.sh # caches + CUDA environment (source it)
├── install.sh # builds envs from envs/<env>.yml
├── oh_my_mlip/ # Python interface (import by path, not pip)
├── envs/ # env recipes; envs/locks/ = exact package sets
├── models/ # hub-managed weights, compiled/<arch>/ models
├── run_examples/ # single_point.py, relax.py, catbench_quickstart.py
├── recipes/ # one workflow per request kind (§10)
└── scripts/ # install, verify, benchmark, fine-tune, distill toolsEnvs built by install.sh live at $OH_MY_MLIP_HOME/envs/<env>/. An env the user
already has can be registered instead with scripts/adopt_env.py. Either way,
resolve(model)["python"] gives the interpreter to use.
2. The interface — oh_my_mlip, not hand-built interpreter paths
| You want to… | Use | Notes |
| The interpreter, imports and calculator lines for a script | resolve(model, version=None) | Returns a dict; loads no model. |
| A calculator object inside that model's env | get_calculator(model, version=None, device="cuda", apply_d3=False) | Only when the current interpreter is that env's. |
| A quick result from any Python | run(model, atoms, properties=("energy","forces"), device="cuda", apply_d3=False) | Starts the right env's worker and returns a dict. |
| Many repeated calls | Worker / WorkerPool | One long-lived process per env; JSONL requests keyed by id. |
import os, sys
sys.path.insert(0, os.environ["OH_MY_MLIP_HOME"]) # import by path
from oh_my_mlip import resolve, get_calculator, run, WorkerWhen writing a standalone script, take python, imports, inference and
env_run from resolve() and put them in the file.
3. Four kinds of request — decide which one you are in first
(A) One or a few models — single point, relaxation, MD, custom scripts
Examples: "single-point this structure with MACE", "relax this POSCAR with SevenNet-Omni", "write an MD script with UMA". Do not use the CatBench runner for this.
- Call
resolve(model). Respectenv_runand any note: they carry run conditions. - Either:
- one-shot result —
run(model, atoms, ...)returns{"energy": ..., "forces": ...}; or - calculator in the user's own script (the usual case) — paste
resolve()'simportsandinferencelines unchanged. These are the lines that were checked; an edited line is an unchecked model. The inference line createscalc; thenatoms.calc = calc. Run the script withspec["python"], never a guessedpythonorconda activate.
- one-shot result —
- GPU-architecture-specific models (
arch_pinned: true: NequIP, Allegro) load a model compiled for one GPU architecture.resolve()detects the current GPU and fills themodels/compiled/<arch>/path;resolve(model, arch="sm86")writes a job for a different GPU, whose compiled file must exist (§6). env_run(for example anLD_LIBRARY_PATHsetting) must prefix the interpreter call.run()andWorkerapply it; in a hand-written command, put it in front of thepythoncall.
from ase.build import bulk
from oh_my_mlip import run
atoms = bulk("Cu", "fcc", a=3.61, cubic=True)
print(run("MACE", atoms, properties=("energy", "forces"))["energy"])(B) Benchmark many models with CatBench — run_catbench
Examples: "benchmark every installed model on this adsorption dataset",
"compare MACE, SevenNet and UMA on CO2 reduction on Cu". No single process can
host two models, so each model runs in its own env process, and all write into
one result/ directory that CatBench aggregates.
run_examples/catbench_quickstart.py drives this:
- The dataset is
raw_data/<tag>_adsorption.jsonin the working directory. The quickstart can fetch published CatBench datasets itself; the user's own VASP calculations are converted withscripts/catbench_vasp_stage.py, which works on a copy. Data format:docs/catbench_data_format.md. - For each model it sets up CatBench with
calc_num = 3calculator instances andconfig = {"mlip_name", "benchmark"}, writing toresult/. With D3 on,mlip_namegets a_D3suffix so both runs stay separate. - Write the job files, then run them — never
python -c.scripts/catbench_jobgen.pywritesjobs/catbench_<MLIP>.py(theresolve()lines) andjobs/run_catbench_<MLIP>.sh(changes to the absolute work dir, exportsenv_run, runs the.py); the quickstart runs the.sh.--emit-onlystops after writing.--slurm [--partition P]also writesjobs/run_slurm_<MLIP>.shwithout submitting it;--submitdispatches throughcatbench_jobgen.submit()instead of running locally. - When
result/is filled, `scripts/catbench_report.py --result<dir>--out<dir>` runs CatBench's `AdsorptionAnalysis`, including the threshold sensitivity analysis, and writes `mae_table.{md,csv}`, `mae_comparison.png` and a `run_report.sh` that rebuilds the report.
CatBench's
Time_per_stepis total time over total steps, so a busy CPU makes models look slower; energies, MAE and anomaly counts are not affected. Compare speed only on the same machine under the same load. Models with heavy CPU-side neighbour lists (for example ORB conservative) are the most sensitive.
(C) Fine-tune a model on the user's data — ft_run.py
Examples: "fine-tune MACE on my dataset", "adapt ORB to my data", "continue training SevenNet from the foundation checkpoint with my extxyz". Ask which model and where the data is if either is missing. Never write a training command or config from memory.
- Read the framework's settings before asking about hyperparameters.
scripts/ft_run.py <model> --show-settingsprints the settings that framework really has (fromfinetune/settings/<Framework>.json, taken from its pinned source): native name, the flag that sets it (if any), upstream default, the official fine-tuning value where upstream publishes one, and whether a value is required. Frameworks differ: DeePMD trains by steps, not epochs; MACE and SevenNet turn stress on through its weight; some have no EMA or early stopping. The run uses the defaults unless the user says otherwise. Show the user the handful that matter for their run (training length, batch size, learning rate, energy/force/stress weights, stress on or off) with the value each will take and where it comes from, and ask whether to keep them or change any. Use the values the user gives; do not tune or second-guess them. Values resolve as: user > official fine-tuning value > upstream default; a required setting with none of these (e.g. DPA4's learning rate) must be asked, and is refused if still missing. Common knobs are flags (--epochs,--max-steps,--batch-size,--lr,--energy-weight,--force-weight,--stress-weight,--include-stress/--no-stress,--patience,--ema,--precision); any other setting passes as--set <native name>=<value>. A flag sets only the settings listed against it (--lris the start learning rate, not the final one); settings marked "related to<flag>" are not touched by that flag and take--set. A knob the framework does not have is refused with its list of available knobs; never map it to something else.ft_run.jsonrecords every emitted value with its origin (user, official-finetune, default). - Convert the data.
scripts/ft_dataset.pyreads anythingase.io.readreads and writes one extxyz with aSinglePointCalculatorand the same values asREF_energy/REF_forces, so a single file serves MACE (readsREF_*) and SevenNet, NequIP, Allegro, GRACE, MatterSim, PET and TACE (read the calculator).--to deepmd/--to dpa4writes the npy layout instead.ft_run.pycalls it for you. scripts/ft_run.py <model> --dataset <path> [--out DIR] [--epochs N]reads the version'sfinetuneblock inmodels.jsonand writes everything before running: the converted data, a patched config where the framework uses one, and<out>/finetune_<version>.sh, which reproduces the run from anywhere.--emit-onlystops after writing;--slurm [--partition P]also writes an SBATCH version without submitting it.- Exit codes are answers, not bugs. 2: no documented training code for
this framework (for example Eqnorm, MatRIS, AlphaNet).
3:
runnable_as_installed: false; the message lists each remaining blocker as the fix to apply. 4: this hub has no command builder for the framework yet; nothing is written. 5: an explicit--seedthe framework cannot fully honour (NequIP/Allegro seed only the data split;--allow-partial-seedaccepts that). 1: usage error or unknown model. Pass the message to the user; do not retry with guessed flags. - Command builders exist for MACE, SevenNet, DeePMD, DPA4, GRACE, PET, NequIP,
Allegro, MatterSim, TACE, CHGNet, UMA, fairchemv1 (eSEN), EquFlash, Nequix, ORB
and EquiformerV3 (
BUILDERSinscripts/ft_run.py). EquiformerV3's status issource-derived (hub builder): upstream documents no user fine-tune, and its builder follows the installed trainer source; say so when you offer it. <out>/ft_run.jsonrecords inputs, seed scope, the checkpoint to use and the command to rebuild the run; per-framework seed behaviour is inrecipes/finetune.md.
- Verify:
scripts/ft_verify.py <ckpt> --model <M> [--version <V>] --jsonloads the new checkpoint through the framework's own ASE calculator in its own env, and passes when energy and forces are finite with the expected shape and, on--device cuda, the GPU was used. A checkpoint that only exists on disk is not a verified fine-tune. - Weights with restrictive licences are flagged, not refused. When a
version has
finetune.licenceset (MACE-MH-1:ASL; EquFlash:CC-BY-NC-SA-4.0, the project's licence -- the record hosting the EquFlash weights says CC BY 4.0, see docs/model_licenses.md),ft_run.pyprints the licence and its URL before starting. Tell the user: a fine-tuned model derived from those weights inherits their terms.
(D) Distill a teacher into an NN-MTP student for LAMMPS — distill_bootstrap.py
Examples: "distill MACE into a LAMMPS student", "compress this model into a fast
CPU potential". Distillation uses the onthefly-distill engine, a separate
GPL-2.0 project (https://github.com/JinukMoon/onthefly-distill). If the user
has no checkout, ask where to clone it. It is invoked from that checkout
(--repo or $ONTHEFLY_REPO, required) and never copied into this repository. Ask for the
teacher (any installed model) and the structure (an ASE-readable file
with at most 4 elements) if missing.
- Once:
scripts/build_lammps_nnmtp.sh --repo <engine>builds LAMMPS withpair_style nnmtpunder$HOME/.cache/oh-my-mlip/lammps. It is long and unattended; skip it if$HOME/.cache/oh-my-mlip/lammps/build/lmp -halready listsnnmtpand the engine has not been updated since. After an engine update, run it again (it recompiles only the pair style): a binary that cannot read the engine's model format is refused bydistill_bootstrap.py. - **`scripts/distill_bootstrap.py --teacher
<variant>--structure<file>--work<dir> --repo <engine> [--target-ps F]`** writes three files into a new or empty work dir and runs nothing: - `omm_teacher.py` — `make_calc()` built from `resolve(<teacher>)`'s import and inference lines, unchanged, with the teacher's start-up output silenced (the engine reads that process's stdout, and banner text would make it believe the teacher cannot relabel); - `config.yaml` — the engine's example config with the teacher hook, the teacher env's interpreter, the LAMMPS binary, the species from the structure and an absolute `work_dir`; - `run_distill.sh` — sets `PATH`, `PYTHONPATH` (engine and work dir) and `ONTHEFLY_CONFIG`, seeds the training pool with a short teacher MD, then runs the engine's own active-learning loop. For a run whose result must be judged, add `--acceptance` with every target stated explicitly (`recipes/distill.md`) and check it afterwards with `scripts/distill_verify.py --work <dir> --json`. Repeat `--structure` to seed the pool from several structures; the student MD runs the first. A pool of one composition fixes only that composition's total energy, so when the student must also hold for other compositions (a slab with another number of water molecules, say), add a structure of another composition: with `--acceptance --mode production`, held-out frames whose composition is outside the span of the pool compositions are refused. Atoms under `FixAtoms` are labelled with real forces but not trained on, and held-out frames you supply must mark them. - Run it:
cd <work> && bash run_distill.sh, in the background with its output logged; it takes long (teacher MD, then rounds of training, student MD and relabelling). It stops by itself when the student survives the target MD length, when rounds stop making progress, or at the round limit; the outcome is in<work>/run/.al_status. - At most 4 elements: the student's LAMMPS pair style supports four species.
distill_bootstrap.pyrejects larger systems with a clear message before writing anything.
4. D3 dispersion correction
CatBench is installed in every env, so D3 is available everywhere:
from catbench.dispersion import DispersionCorrection
calc_d3 = DispersionCorrection().apply(calc) # calc = the MLIP calculatorOr pass apply_d3=True to get_calculator() / run(). The D3 CUDA kernel is
compiled for the user's GPU and cached; install.sh triggers that build once
when nvcc is available (§6). source env.sh first: it sets PYTHONUTF8=1
(avoids a decode error during that build) and finds CUDA_HOME.
5. Gated and open models
Check gated, license_url and weights in models.json before fetching:
- Open models (
gated: false, most of them): weights arebundledin the framework package,auto-downloaded by name on first use, oron-demand-hffrom the Hugging Face Hub. No token needed. - Gated models (
gated: true: all UMA variants and eSEN-30M-OAM): the user must (1) accept the license at the model'slicense_urlwith their own Hugging Face account (https://huggingface.co/facebook/UMA,https://huggingface.co/facebook/OMAT24) and (2) make a read token available, preferably withhf auth loginin their own terminal (alternatives:HF_TOKEN_PATH,OMM_HF_TOKEN_FILE,HF_TOKEN). This repository never redistributes gated weights. Without an accepted license or a token the download fails by design.
When a gated model is requested: check only whether a token is available,
never read or print it:
python3 -c "import sys; sys.path.insert(0, 'scripts'); from setup_survey import token_source; print(token_source())"
(with $OH_MY_MLIP_HOME as the working directory). If it prints none, stop
the gated targets only (install the others meanwhile), give the user each
license_url and the steps in docs/hf_token.md, and ask them to log in
themselves (in Claude Code: ! hf auth login in the prompt). Never ask them to
paste a token into the conversation or onto a command line. Resume when the
check prints a source. HTTP 401 or 403 on the fetch means the license or access
request is not approved yet for that account: show the license_url again and
do not retry in a loop. Full flow: docs/gated_models.md.
6. GPU-specific compilation (D3 kernel, NequIP/Allegro models)
Some artifacts only work on the GPU architecture they were built for, so they are built on the user's machine:
- NequIP and Allegro (
arch_pinned: true): during install,scripts/prepare_nequip_weights.pyandscripts/prepare_allegro_weights.pydownload each checkpoint, check its MD5 and compile it withnequip-compilefor the current GPU intomodels/compiled/<arch>/(sm86,sm89, …). NequIP uses--modifiers enable_OpenEquivariance; Allegro uses--modifiers enable_CuEquivarianceContracter. For another GPU architecture, run the prepare script on a machine with that GPU. - D3 kernel:
install.shandscripts/adopt_env.pybuild catbench'spair_d3.soonce per env withscripts/build_d3.py, using the env's ownnvcc,ninjaand conda compiler, so the bare interpreter never compiles it. A failed build never fails the env (energies and forces do not need D3): it prints a WARNING with the log and the rerun command, leavesstate=failedin<prefix>/.omm_d3, and an install.sh re-run tries it again. While that marker saysfailed, constructing catbench'sDispersionCorrectionin that env raises at once with the reason (a start-up hook install.sh puts in the env) instead of compiling again; report such a model as "ready, D3 unavailable". On a read-only hub the kernel goes to torch's extensions cache.setup_verify.pyreports one D3 calculation as its ownd3item, apart from the energy/forcespass. - Whole envs on a newer GPU (sm120, Blackwell): a torch wheel built for CUDA
below 12.8 has no sm120 kernels.
install.shreads the host GPU (detect_host_arch()) and builds the recipeenvs/_arch_recipes.jsonnames for it: the baseenvs/<env>.yml, or a sibling such asenvs/mace.cu128.yml, always intoenvs/<env>/(the recipe used is inenvs/<env>/.omm_recipe). When none is known to work (a GPU newer than any listed, or an env whose arch entry is null) it stops before downloading and says why: report that, do not install the base recipe by hand. An env built from another arch's recipe is not reused;install.sh --rebuild <env>rebuilds it. Avalidated_sm89label says nothing about sm120: that state isarch_validation.sm120(status table column sm120).
Without nvcc, only D3 is unavailable; the models themselves still run.
install.sh says so. Details: docs/arch_first_run_compile.md,
docs/compile.md.
7. Checklist before handing back code
- Model facts came from
models.jsonviaresolve(), not memory. - Used
resolve/get_calculator/run/Workerrather than a hand-built interpreter path. - Calculator lines pasted unchanged; script run with
spec["python"]. env_runapplied; notes respected.- For NequIP/Allegro, the compiled model exists for the GPU the job runs on.
- For gated models, token presence checked and
license_urlgiven; no token or gated weight written into any file. source "$OH_MY_MLIP_HOME/env.sh" &&in the same command that runs the model.
8. Recovering from install errors
The agent classifies each failure here and picks the strategy.
scripts/setup_guardrail.py only decides when to stop (see below).
Where a recovery may look. Wheels, archives and weights come from the
network, the clone ($OH_MY_MLIP_HOME), the env being built, and the caches the
tools use on their own (pip and conda read theirs; framework weight caches are
resolved by oh_my_mlip/fetch.py). Never search the user's other folders for a
file a download could not fetch: not Downloads, not other conda envs, not
personal caches or home directories, and never copy from them. A network
failure is handled by the rows below and the stop rules at the end of this
section; when those do not get the file, stop and report which file and which
host were blocked.
RETRYABLE — try a different strategy, then continue
| Error | Recovery |
Wrong GPU architecture (a .pt2 compiled for another GPU) | Compile for this GPU with the prepare script (§6). Rename the mismatched file rather than deleting it first. |
Network error or partial download (connection reset, incomplete archive or .nequip.zip) | Delete the partial file and fetch again, so the retry does not resume a corrupt download. |
Leftover files from a failed download (a tmp.tar.gz or an empty or partial directory under $OH_MY_MLIP_HOME/models/<framework>/ makes the weights look present, or makes every run download again; a complete copy may already be in the framework's own cache such as ~/.cache/<framework>/) | Remove only the leftovers under models/<framework>/ (never the framework's own cache), then let fetch.ensure_weights run again. Do not write your own path-searching resolver: weight locations belong to oh_my_mlip/fetch.py. |
pypi.nvidia.com unreachable (torch +cuNNN envs pull nvidia-* wheels through that host; when it times out, every torch env fails in the pip step, although the same wheels are on pypi.org) | Run python3 scripts/install_nvidia_wheels.py <env> (add --dry-run to see the pins first): it installs the exact nvidia-* pins torch declares on pypi.org into the partial env, and refuses when PyPI's pins belong to a different CUDA build than the recipe's. Then run install.sh <env> again, as it prints. A ConnectTimeout to pypi.nvidia.com in pip install --dry-run identifies this case. |
HALT AND REPORT — do not retry; give the user an actionable message
| Error | What to do |
install.sh stops: no recipe for this GPU (STOP '<env>' (GPU sm120), or an arch newer than any in envs/_arch_recipes.json) | No wheel known to run on this GPU exists in the registry; installing the base recipe would end in CUDA error: no kernel image is available. Report the printed reason; do not work around it (§6). |
CUDA error: no kernel image is available for execution on the device | The env's CUDA wheels were built for older GPUs. Check install.sh --status <env>: an env built from another arch's recipe is rebuilt with install.sh --rebuild <env>. |
nvcc missing | D3 is unavailable; the models still run (§6). Tell the user; installing a CUDA toolkit is their decision. |
| Gated weights without token or accepted license | Give the license_url and point to docs/hf_token.md (§5). Do not retry the download. |
| conda / mamba missing | An agent's shell often lacks the PATH lines conda init writes, so which conda failing is not proof. install.sh looks in $CONDA_EXE and the usual install directories and uses a conda it finds there; only when it reports none, point the user to Miniconda (https://docs.conda.io/projects/miniconda). Install it only with the user's explicit consent. |
Install recipe or weight source missing or wrong in models.json, and the official documentation does not resolve it | Make one bounded attempt (read the official page, try one or two real fetches or builds). If that fails, stop: ask the user for the model's official install or download instructions, and report what was tried. The guardrail stops below lead here too. |
When to stop (enforced by scripts/setup_guardrail.py)
Whatever the error, the first of these ends the loop:
- free disk below the floor (
DISK_FLOOR_GB, 30 GB) →guardrail_halt; - the same normalized error twice →
stalled; - 5 attempts in total, even with different errors →
stalled_cumulative; - a wall-clock limit, when one is set →
wallclock_halt.
Partial downloads under the hub are cleaned between attempts
(setup_guardrail.py clean-cache --yes; it never deletes from shared caches
such as ~/.cache/huggingface or ~/.cache/torch_extensions). On any of these
verdicts, stop and report the verdict.
9. Installing model envs — one, several or all
This is the procedure behind /oh-my-mlip:setup and any request to install or
"get working" MLIPs. After an env is installed and verified here, §3 takes over.
skills/setup/SKILL.md only points into this section.
9.0 When the repository is not on disk yet
The working directory does not matter:
- use
$OH_MY_MLIP_HOMEif it is set and exists; - otherwise clone
https://github.com/JinukMoon/oh-my-mlip.gitinto~/.oh-my-mlip(envs land under it: about 5 to 15 GB per model); - export
OH_MY_MLIP_HOMEfor every child process, and run scripts and read documents from that clone; - never use the copy of this repository inside an agent's plugin cache
(
~/.claude/plugins/...) as the hub: the host replaces it on every plugin update, andinstall.sh,setup_survey.py,setup_verify.py,setup_sweep.pyandadopt_env.pyrefuse it; install.shfinds conda or mamba itself, also when this shell lacks it on PATH (§8 if it reports none);source "$OH_MY_MLIP_HOME/env.sh" &&in the same command asinstall.sh.
9.1 Listing what can be installed (installs nothing)
Read models.json, or call oh_my_mlip.list_models(), and report name,
framework and whether each model is gated. docs/model_status.md is the same list
for people. Offer the install step, and mention that gated models need the user's
own Hugging Face login (§5).
9.2 Which targets
- Named models: resolve each through the registry, keep the user's order;
install.shaccepts several targets. all: every framework inmodels.json, one env each.all except <names>:allminus those; list the exclusions in the plan.- Naming the models, one or several, is the approval;
allandall except <names>go through the gate in §9.3. Either way, a survey showing the disk will not fit, or a gated model without a token, is put to the user before anything is built.
9.3 Installing everything: survey, plan, approve
Installing everything takes 100+ GB and hours, so ask once, clearly:
- Run
scripts/setup_survey.pyfirst. It reports each env's state (ready / partial / missing), the disk needed for what will actually be built, whether a Hugging Face token is available (presence only) and the gated models. Show its output as printed. - Show the plan before asking:
OH_MY_MLIP_HOME, the state table with gated models and exclusions, and the disk verdict. Never offer to install an env that is alreadyready. - If disk is short, include that in the same question.
- Ask through selectable options if the agent's interface offers them: install everything planned / only what is missing or broken / choose exclusions (then a multi-select of the pending models). Accept free-text exclusions too. After approval, run to the end without more questions.
- Gated models without a token: include the token steps in the plan — each
license_url, the token page, andhf auth loginto run in the user's own terminal. Re-check when the user says the token is set. - Restate the final target list in one line before starting.
9.4 Running the installs
scripts/setup_sweep.py --targets <M1,M2,...> runs a batch: one env at a time,
gated models without a token recorded as skipped_gated, a failure never stops
the rest, a DISK_FLOOR_GB (30 GB) free-disk check before each target (below it, the remaining
targets are recorded as skipped_disk), and one JSONL line per step under
.sweep/. Do not loop over install.sh by hand.
For each target:
- State first:
scripts/setup_survey.py --table <model>(read-only). Ifready, go to step 4 and stop when verification passes; otherwise continue (install.shfinishes a partial env whose imports work, and asks for--rebuildwhen they do not; it never builds a duplicate). Install: launch detached, then poll. A first build takes 30 to 120 minutes, longer than one agent tool call may run (Claude Code's Bash tool stops a call after 2 minutes by default, 10 at most). With
OH_MY_MLIP_HOMEexported andL=$OH_MY_MLIP_HOME/.sweep; mkdir -p $L:nohup bash "$OH_MY_MLIP_HOME/install.sh" <model> > "$L/install_<env>.log" 2>&1 & echo $! > "$L/install_<env>.pid"Then poll it yourself with short foreground calls, each well inside the tool's time limit (for example
sleep 60; kill -0 $(cat <pid file>)): the install succeeded whenenvs/<env>/.omm_readyexists and the pid has exited; it failed when the pid has exited without it (read the log). Do not end your turn to wait for a background notification: in a one-shot session (claude -p,codex exec) the session ends with the turn and nothing wakes it again, sosetup_verifynever runs. Thenohuplaunch keeps the build itself alive either way.- A tool call that times out or is killed while you wait is not an install
error. Do not re-run
install.shand do not give that output tosetup_guardrail.py; keep polling.install.shrefuses a second build of an env that is still being built. install.shstops without deleting anything when an existing env's imports fail, which is what an interrupted build leaves. Re-run it with--rebuild <env>to delete that env and build it again; it never deletes a symlinked env, or one whose import check timed out.
- A tool call that times out or is killed while you wait is not an install
error. Do not re-run
- Guardrail (only after an install that failed; after a successful one
go straight to step 4, since the finished build itself may have taken the
disk below the floor): save the attempt's stderr to a file as-is, then run
scripts/setup_guardrail.py gate --state <state-file> --stderr-file <stderr-file>. Read its JSON verdict (the exit code is always 0):guardrail_halt/wallclock_haltstop;stalled/stalled_cumulativestop and ask for documentation (§8);okcontinues. - On failure: classify with §8, apply that strategy, back to step 1.
- Verify:
scripts/setup_verify.py <model> --jsonfor each variant the user named (a family name verifies its default variant;--all-variantsverifies every variant of the family and downloads each one's weights, so do that only when asked). It picks CPU when the driver is too old (ground rule 6), computes energy and forces, confirms GPU use, and prints one verdict (pass,device,degraded,reason,energy_ev,fmax_ev_a,forces_shape,gpu_pid_confirmed,gpu_mem_bytes,local_record); exit 0 means pass. A pass is recorded in the machine-localmodels.local.json, whichresolve()exposes aslocal_verified. Report the verdict as printed; do not run your own GPU check.pass: true, degraded: falseis a clean GPU pass;degraded: trueis a CPU pass with a reason;pass: falsegoes back to step 3. - Report: model, env path,
energy_ev,forces_shape,device,degraded(with reason),gpu_pid_confirmed, and thed3state. Whend3is notpass(the kernel build failed at install), report the model as "ready, D3 unavailable", never plain "ready": a D3 request in that env fails at once with the build's reason (<prefix>/.omm_d3), and re-runninginstall.sh <env>retries the build.
After a batch, retry each failed target through steps 1–4, then run
scripts/setup_sweep.py report; targets that never ran show as not_attempted.
A single gated request without a token stops per §5; in a batch it is recorded
as skipped_gated.
9.5 NequIP and Allegro
These also need the compiled model for the GPU (§6). install.sh runs the
prepare scripts; if verification fails with a missing or mismatched .pt2, run
the prepare script again on this machine.
9.6 HPC clusters (login node without a GPU, GPU nodes without internet)
Follow docs/host_requirements.md "HPC clusters". In short:
- Install on the login node with
OMM_INSTALL_ARCH=<arch of the job GPUs>and every path on project storage, not$HOME. Verify each model withsetup_verify.pyinside a GPU job (SLURM--gres=gpu:1or--gpus=1, aftersource env.sh, which switches on offline mode on a node without internet); it refuses on a node without a GPU, and that refusal is not an install error. Do not redirect$HOMEor add network workarounds yourself: setOMM_SHARED_CACHE_ROOT(the docs' export block) andinstall.shhandles both. - A login node may cap tasks per user.
install.shlowers its own parallelism when it finds the cap; you and your tool calls count against the same cap, so run one install at a time and nothing else heavy beside it. - Some login nodes end all your processes when your last session closes, so a
nohuplaunch (§9.4) does not outlive the session: keep this session running until the install ends. If it was cut, run the same command again (finished envs are skipped; an interrupted env asks for--rebuild <env>). - After each env, read
envs/<env>/.omm_prefetch.json: a variant markedfailedmay not load on an offline GPU node. For NequIP and Allegro, run the compile command the install printed as the first step of the GPU job.
10. Recipes — from request to plan, approval, run and evidence
recipes/ has one workflow per kind of request. Each follows the same six stages
(ask, plan, approve, execute, verify, out of scope — defined in
recipes/README.md) on top of the sections above, and ends with the helpers that
are planned but not implemented yet. Read the section here, then the recipe for
the request at hand:
| Request | Section | Recipe |
| install / verify envs | §9 | recipes/setup.md |
| single point / relaxation | §3A | recipes/run.md |
| CatBench | §3B | recipes/catbench.md |
| fine-tuning | §3C | recipes/finetune.md |
| distillation | §3D | recipes/distill.md |
Claude Code reaches a recipe through skills/<name>/SKILL.md; Codex and other
agents through the table above. Recipe text is not copied here or into the
skills (tests/test_onramp_contract_no_dup.py, tests/test_recipe_contract.py).
To test a different checkout than the installed plugin: in Claude Code, start
with claude --plugin-dir <checkout> and set OH_MY_MLIP_HOME to the same
checkout; in Codex, start inside that checkout so its AGENTS.md is read. A
session started without either uses the installed plugin, and its results say
nothing about the other checkout (recipes/README.md).
A recipe explains and calls; it does not duplicate what executable files own.
Package sets and their order live in install.sh with envs/<env>.yml and
envs/<env>.build.sh; run commands live in the generators under scripts/ and
the files they write; the agent supplies the scientific inputs (models, data,
targets, budget). A failure those files do not handle is reported as failed and
fixed by changing the owning file, never by installing or upgrading packages
inside an env during a job.
Plugin and MCP server
The Claude Code plugin (.claude-plugin/ + skills/) adds
/oh-my-mlip:setup, /oh-my-mlip:run, /oh-my-mlip:catbench,
/oh-my-mlip:finetune and /oh-my-mlip:distill. The skills only point here and
to the recipes; model facts stay in models.json.
The MCP server (python -m oh_my_mlip.mcp_server) is optional: it offers the
same registry information and run/install entry points as typed tools, as a thin
adapter (see oh_my_mlip/mcp_server.py). Launch it from an interpreter with
requirements-mcp.txt installed, with OH_MY_MLIP_HOME exported. Every tool
answers {"ok": true, ...} or {"ok": false, "error": ...}; install_model
only reports the command (a build is launched and polled per §9.4), and
verify_model is the done-check. run_relax and run_catbench start a job
and return at once with a job_id and a log path (the job runs in its own
process under $OH_MY_MLIP_HOME/.mcp_jobs/, stopped after timeout_s); poll
job_status(job_id) with a pause between calls until it reports done
(with result), failed or timeout.
| Section | MCP tool |
| §0–1 registry and layout | list_models |
§0 one model's resolve() dict | describe_model |
| §5 gated / weights status | model_status |
| §1, §6 is an env installed / the command that builds it | install_model |
| §9.4 step 4 verify an install on the GPU | verify_model |
| §3A single point | run_singlepoint |
| §3A relaxation | run_relax |
| §3B CatBench across models | run_catbench |
| a started relaxation or CatBench job | job_status |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

