# Kermt Finetune

Finetune a pretrained KERMT encoder on a labeled CSV.

- Repository: https://github.com/NVIDIA-BioNeMo/bionemo-agent-toolkit (503 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-10-28
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add NVIDIA-BioNeMo/bionemo-agent-toolkit --skill kermt-finetune -g -a claude-code -y`
Codex: `npx skills add NVIDIA-BioNeMo/bionemo-agent-toolkit --skill kermt-finetune -g -a codex -y`
Cursor: `npx skills add NVIDIA-BioNeMo/bionemo-agent-toolkit --skill kermt-finetune -g -a cursor -y`
Gemini CLI: `npx skills add NVIDIA-BioNeMo/bionemo-agent-toolkit --skill kermt-finetune -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add NVIDIA-BioNeMo/bionemo-agent-toolkit`

## Description

Finetune a pretrained KERMT encoder on a labeled CSV. The skill validates the input checkpoint (must be a pretrain ckpt, grover_base / cmim / hybrid), validates the labeled CSV, prepares the data (clean + features + optional split), then launches main.py finetune inside the kermt container (detached for hours-scale runs). Hyperparameters come from agent/config/defaults_finetune.json with per-flag CLI override.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# kermt-finetune

Finetune a pretrained KERMT encoder on a user-supplied labeled CSV. The skill
is the workflow orchestrator: validate ckpt, validate data, prepare data,
launch the runner detached, return a run directory + container name.

## Hardware requirements

- **GPUs**: 1 by default (single-GPU); pass `--gpus 0` (or whichever id) to
  select one. For faster training on a multi-GPU host, pass `--num-gpus N`
  (N>1) to run data-parallel DDP across N GPUs, `--batch-size` is then
  per-GPU (effective global batch = batch_size × N).
- **VRAM**: ≥ 8 GB for the default `batch_size 32` configuration. Lower VRAM
  works at smaller batch sizes, pass `--batch-size N` to override.
- **Disk**: a few GB per run (checkpoint + features + logs).
- **Driver / CUDA**: any host supporting CUDA 12.6 (the kermt image base).
  `kermt-setup` validates this up-front.

## Inputs

Required:

- `--csv <path>`, labeled CSV. First column is `smiles`; every other column
  is a target.

Checkpoint (optional, defaults to the released model if omitted):

- `--ckpt <path>`, input pretrain checkpoint (grover_base / cmim / hybrid).
  The validator refuses already-finetuned ckpts with a redirect to
  `kermt-infer`. **If omitted**, the skill offers to download the released
  pretrained hybrid model **nvidia/NV-KERMT-70M-v2** and finetune from it, see "Resolve & validate the checkpoint" (workflow step 3).
- `--pretrained-release`, explicit opt-in to use the released model without
  the interactive prompt (for non-interactive / agent runs). Mutually
  exclusive with `--ckpt`.
- `--model-dir <dir>`, where to save the downloaded bundle (default
  `$KERMT_REPO/models/NV-KERMT-70M-v2/`). An already-complete bundle there is
  reused, not re-downloaded.

Optional:

The rest: https://github.com/NVIDIA-BioNeMo/bionemo-agent-toolkit/blob/HEAD/skills/bionemo-agent-toolkit/skills/kermt-finetune/SKILL.md
