npx skills add ...
npx skills add nvidia/skills --skill kermt-monitor
Check progress for a detached KERMT run (pretrain, finetune, or any kermt_run_detached invocation). Reads run.json, queries docker for container state, tails the pretrain/finetune log, and parses progress lines (epoch, step, val loss).
npx skills add nvidia/skills --skill kermt-monitor
Companion skill for any KERMT workflow that runs detached: the three pretrain
skills (kermt-continue-pretrain, kermt-pretrain-scratch,
kermt-add-cmim-pretrain) plus kermt-finetune. kermt-infer and
kermt-embed run blocking by default and don't need this skill, but if a
user launches them detached on purpose the monitor still works (the
workflow-dispatch in step 4 handles unknown workflows by tailing the
most-recent log file in the run dir). Reads the run directory's run.json,
queries docker for the container's state, surfaces the latest progress,
and either tails or follows the log.
None. This skill only reads disk + queries docker; no GPU compute.
One of:
<run-dir> — a positional argument pointing at the directory containing
run.json (e.g. runs/continue-pretrain_2026-05-17T10-23Z). Preferred.--container <name-or-id> — direct container reference; the skill still
reads run.json from the run dir referenced inside the container's
inspect output if available, but works degraded-mode without it.Optional:
--lines N — number of trailing log lines to print (default 50).--follow — stream docker logs -f until ^C. Useful for "watch the
loss". Without it, the skill is one-shot and exits.--json — emit a structured status report instead of human-readable text.
Useful when the parent agent wants to take downstream action.Let RUN_DIR=$1 (or whatever path the user supplies).
Locate the manifest.
Refuse to proceed if it doesn't exist; surface a helpful message
pointing the user at the run-dir convention (runs/<workflow>_<ts>/).
Parse the manifest (Python helper):
Query docker for container state.
If absent, fall back to docker inspect $container_name --format '{{.State.Status}} (exit {{.State.ExitCode}})' to see whether the
container exited (ok or failed) or was removed (--rm after exit).
Find the live log file.
The manifest's workflow field disambiguates pretrain (pretrain_ddp.log)
from finetune (finetune.log). Other workflows fall back to the
most-recently-modified .log in $logs_dir.
Show the latest progress.
tail -n $LINES $LOG for the raw recent output.args_applied.metric from run.json)
Final test-metrics block (finetune, on completion). If workflow is
finetune AND the container has exited cleanly (State.Status=exited,
ExitCode=0) AND $RUN_DIR/ckpt/fold_*/test_result.csv exists, parse it
and emit a per-task metric table:
The metric column matches args_applied.metric (mae for regression, auc
for classification, etc.). For multi-fold or ensemble runs, average across
folds/models and note ± std if std > 0. Skip silently if no
test_result.csv exists (run incomplete or no test split was emitted).
If --follow, stream live logs.
Wraps until ^C.
Stop / cleanup hints (printed at end of one-shot mode):
run.json, never touch the
container's checkpoint dir. The monitor only inspects.docker stop; if they ask to abandon, leave it
running and just exit.The run.json schema as currently written does not yet include the launched
container name — kermt_run_detached prints it to stdout but the runner
script doesn't capture it into run.json. The monitor falls back to a
filesystem-based lookup: list runs/<workflow>_*/ directories and match by
mtime; or accept --container <name> explicitly. Follow-up: have the
launching skill record container name into run.json before exiting.