/nvidia-bionemo:kermt-pretrain-scratchfrom NVIDIA BioNeMo Agent Toolkit
Pretrains a fresh KERMT model from scratch on a user-provided corpus, building vocabulary and launching distributed training in a Docker container. For custom-domain chemistry models not based on existing checkpoints.
Ships in NVIDIA BioNeMo Agent Toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Pretrain a brand-new KERMT model from scratch on a user-provided corpus. Useful
when you want to retrain a model on a custom chemistry domain rather than
extending one of the released checkpoints. Significantly more expensive than
kermt-continue-pretrain — no warm start, so the loss curves need to descend
from scratch over many epochs.
Same as kermt-continue-pretrain:
GPUs: 1–N CUDA-capable. The runner auto-detects via
torch.cuda.device_count(); --gpus 0,2 overrides. Single-GPU fallback:
--batch_size 32 --save_interval 500. Multi-GPU keeps defaults
(--batch_size 256 etc.). Note: --gpus N uses torch.cuda indexing,
which can differ from nvidia-smi's display order on multi-GPU hosts
(PCI bus vs. CUDA enumeration). To target a specific physical GPU, set
CUDA_VISIBLE_DEVICES before invoking, or run
python -c "import torch; print([torch.cuda.get_device_name(i) for i in range(torch.cuda.device_count())])"
to confirm which device you're picking.
VRAM: the default --batch-size 256 is sized for A100-class hardware
(80 GB VRAM). On smaller GPUs, downscale to avoid OOM:
| GPU class | VRAM | Suggested --batch-size |
|---|---|---|
| L4, T4, V100 16 GB | 16–24 GB | 32–64 |
| A100 40 GB, L40, A40 | 40–48 GB | 128 |
| A100 80 GB, H100, H200 | 80 GB | 256 (default) |
These are rough starting points — pass --batch-size N to override.
Disk: tens of GB for shards + vocab + checkpoints, scaled by epochs.
Wall time: this is the big difference. Pretraining from scratch on an 11M-mol corpus at 100 epochs typically takes days even on a multi-GPU box. The skill prints an estimate before launching; confirm with the user.
For continuing an existing released ckpt, use kermt-continue-pretrain. For
adding a cMIM decoder to an encoder-only grover_base ckpt, use
kermt-add-cmim-pretrain.
Required:
--csv <path> — the pretrain corpus CSV with a smiles column. Single file
by convention; multi-file corpora deferred. Use --val-csv for a separate
validation set.--pretrain-target-mode {vocab|cmim|hybrid} — which pretrain objective to
use. No default — must be set explicitly so the user makes an informed
choice:
vocab — original GROVER-style atom + bond vocab prediction (encoder-only
output, lightweight).cmim — contrastive + SMILES reconstruction objective. Requires building
a SMILES vocab from the corpus.hybrid — both vocab and contrastive objectives jointly (the
state-of-the-art config from the KERMT manuscript).Optional:
--val-csv <path> — separate validation CSV. Without it, prepare_data
auto-splits the input by --val-frac 0.1 (random shuffle with --seed).--epochs N / --batch-size N /
--init-lr F / --max-lr F / --final-lr F / --warmup-epochs F /
--weight-decay F / --dropout F / --save-interval N / --seed N.
Anything not given is filled from agent/config/defaults_pretrain.json.--vocab-loss-weight F (hybrid only) / --latent-dim N /
--contrastive-temperature F (cmim and hybrid only).--wandb-project NAME / --wandb-run-name NAME — optional Weights & Biases
logging. When --wandb-project is set, rank 0 logs train/val losses; the run
name is honored only alongside a project. Off by default.--gpus 0,2 — restrict to a GPU subset.Let $KERMT_REPO be the path to your kermt repo checkout.
Pre-flight: ensure container + system probe (same as
kermt-continue-pretrain step 1). Refuse to proceed if check_system
reports gaps.
Compute run directory.
RUN_DIR=$KERMT_REPO/runs/pretrain-scratch_$(date -u +%Y-%m-%dT%H-%M-%SZ)
Validate the corpus (no ckpt to validate, so this is the only input check):
$KERMT_REPO/agent/scripts/kermt_container.sh run --data <user-csv> -- \
"python agent/scripts/check_data.py --mode pretrain --csv /data/<basename>"
Abort on ok: false.
Prepare the data — no vocab pass-through (we want fresh vocab from corpus):
$KERMT_REPO/agent/scripts/kermt_container.sh run --data <user-csv> --run-dir $RUN_DIR -- \
"python agent/scripts/prepare_data.py --mode pretrain \\
--csv /data/<basename> --out /runs/data \\
[--val-csv /data/<val-basename>] [--val-frac 0.1] [--seed 0]"
Outputs land at $RUN_DIR/data/prepare_data.json with
vocab_source: "built_fresh".
Estimate runtime + warn loudly. This is critical for pretrain-from-scratch:
kermt-continue-pretrain from a released ckpt
instead, which converges in hours instead of days."--yes was given.Launch the runner detached.
$KERMT_REPO/agent/scripts/kermt_container.sh run_detached \\
--name kermt-pretrain-scratch-<ts> \\
--run-dir $RUN_DIR -- \\
"python agent/scripts/run_pretrain_local.py \\
--from-scratch --pretrain-target-mode <vocab|cmim|hybrid> \\
--prepare-manifest /runs/data/prepare_data.json \\
--out /runs \\
[--epochs N --batch-size N ...]"
Note: NO --ckpt flag (the runner refuses if both --from-scratch and
--ckpt are given). The runner uses the arch group from
agent/config/defaults_pretrain.json to size the model.
Report to the user. Always include all of the following — do not omit the TensorBoard line under output-length pressure:
$RUN_DIR/run.json (the manifest with workflow: pretrain-scratch,
from_scratch: true, vocab_check: null, arch from defaults, full
cmd_replay)$RUN_DIR/logs/pretrain_ddp.log$RUN_DIR/logs/tb (open with tensorboard --logdir $RUN_DIR/logs/tb)kermt-monitor <RUN_DIR> for progress.--ckpt flag. From-scratch is exclusive with input
ckpt — the runner enforces this; the skill should too.--pretrain-target-mode. This is a significant
architectural choice (vocab = lightweight, hybrid = SOTA). Prompt the user
if not given on the CLI.--pretrain-target-mode is required when --from-scratch is set → user
forgot the mode flag. Prompt.--from-scratch is incompatible with --ckpt → user provided both; ask which
one they meant.defaults_pretrain.json has no arch group → repo state issue (should never
happen on a fresh clone); points the user at running kermt-setup again.Same reproducibility fields as continue-pretrain (repo.commit, kermt_image,
cmd_replay, args_applied), plus:
workflow: "pretrain-scratch"from_scratch: trueinputs.ckpt: nullckpt_symlink: nullvocab_check: null (not verified — vocab built from corpus is
authoritative for from-scratch)arch: the values pulled from agent/config/defaults_pretrain.json's
arch group (with any future CLI overrides applied).Same as continue-pretrain: cmd_replay is a copy-pasteable command. If
ok_to_replay: false, the kermt repo working tree was dirty at launch
time — check repo.commit and git checkout it first.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub nvidia-bionemo/bionemo-agent-toolkit --plugin nvidia-bionemo43 skills in this plugin
/boltz2-nimUse Boltz2 NIM for biomolecular structure prediction and binding affinity. Invoke for Boltz2, protein structures, protein-ligand/DNA/RNA complexes, SMILES or CCD ligands, pIC50/IC50 affinity scoring, mmCIF output, hosted NVIDIA API calls, or local Docker deployment.
/codonfm-embedValidate coding-sequence CSVs, extract public CodonFM/Encodon embeddings, and choose checkpoints for downstream property modeling./codonfm-finetuneFine-tune public CodonFM Encodon checkpoints on labeled coding-sequence or coding-variant data using LoRA, head-only, or full fine-tuning. Use when a user explicitly asks to fine-tune CodonFM or Encodon for regression or classification. Support generic public-v1 Encodon workflows only; reject Decodon, MissenseDataset, missense_synom_agg, and generation workflows.2 plugins in one repository ship this exact skill · first indexed Nov 14, 2026
Other plugins' skills for the same job