/mlops-skills:weights-and-biases-experiment-trackingfrom mlops-skills
Sets up and operates Weights & Biases (W&B) — run/sweep/artifact object model, hyperparameter sweep configuration and agents, report generation, and comparison with MLflow for team decision-making.
Ships in mlops-skills. 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.
None: SKILL.md is the whole skill.
Weights & Biases (W&B) is a SaaS-first experiment tracking platform built around three linked objects: a run (one training/evaluation execution and everything logged to it), a sweep (a managed hyperparameter search that spawns and coordinates many runs), and an artifact (a versioned, lineage-tracked file or directory — datasets, models, or evaluation tables — that runs consume and produce). It is distinguished operationally by how much of the hyperparameter-search and stakeholder-reporting workflow is built in rather than assembled from separate tools. This skill covers W&B's specific object model, sweep configuration, and report authoring — not the general case for experiment tracking, which is covered in experiment-tracking and applies here without needing to be restated.
wandb.init()/wandb.log() for the
first time, or debugging why expected metrics/config aren't showing up
in the W&B UI.sweep.yaml, wandb sweep, wandb agent) — grid, random, or Bayesian search, with or without early
termination.wandb Python package installed in the training environment.wandb login (interactive) or the
WANDB_API_KEY environment variable in CI/non-interactive environments
— never hardcoded in source.wandb agent processes that actually execute
trials — the sweep controller coordinates trials, it doesn't provide
compute itself.Initialize a run and log config/metrics — config captures
hyperparameters once at the start; log is called per step/epoch:
import wandb
run = wandb.init(
project="fraud-scorer",
entity="ml-platform-team",
config={
"model_type": "gradient_boosted_trees",
"max_depth": 6,
"learning_rate": 0.05,
"n_estimators": 300,
},
tags=["baseline"],
)
for epoch in range(config_epochs):
train_loss, val_auc = train_one_epoch(...)
wandb.log({"train_loss": train_loss, "val_auc": val_auc, "epoch": epoch})
run.finish()
Log artifacts with explicit versioning and lineage, not just ad hoc file uploads — an artifact records what run produced it and what it was built from:
artifact = wandb.Artifact(
name="fraud-scorer-model",
type="model",
metadata={"val_auc": val_auc, "framework": "xgboost"},
)
artifact.add_file("model.xgb")
run.log_artifact(artifact)
# Downstream: consuming a specific version pins reproducibility
used = run.use_artifact("fraud-scorer-model:v14", type="model")
model_dir = used.download()
W&B's artifact lineage graph (visible in the UI) links this artifact back to the run that created it and forward to any run that later consumed it — the same "queryable provenance" goal described in experiment-tracking, implemented here as a first-class object rather than a manually-added tag.
Define a sweep configuration declaring the search method, the metric being optimized, and the parameter space:
# sweep.yaml
program: train.py
method: bayes # grid | random | bayes
metric:
name: val_auc
goal: maximize
parameters:
max_depth:
values: [4, 6, 8, 10]
learning_rate:
min: 0.005
max: 0.2
distribution: log_uniform_values
n_estimators:
values: [200, 300, 500]
early_terminate:
type: hyperband
min_iter: 5
wandb sweep sweep.yaml
# -> prints a sweep ID, e.g. ml-platform-team/fraud-scorer/abc123
wandb agent ml-platform-team/fraud-scorer/abc123
wandb agent can be started on multiple machines/processes pointed at
the same sweep ID; the sweep controller assigns each agent a
parameter set to try and aggregates results centrally — this
distributed-agent coordination is built into the product rather than
something the team assembles from a job scheduler.
Bound every sweep explicitly before starting it.
Warning — an unbounded sweep is a risky action that can burn compute budget with no natural stopping point.
method: bayesormethod: randomwithout a run-count limit or early termination will keep spawning trials for as long as agents keep polling. Set an explicit cap:wandb agent --count 50 ml-platform-team/fraud-scorer/abc123and/or configure
early_terminate(hyperband) in the sweep config so clearly underperforming trials are killed early rather than running to completion. For anything running on paid/shared compute, treat a sweep launched without a--countcap or early termination the same as a production deploy with no rollback plan — a preventable, foreseeable cost/resource incident, not an edge case.
Compare sweep results and pick a winner via the sweep's parallel coordinates / parameter-importance views rather than scanning a metrics table — W&B computes parameter-to-metric correlation directly, surfacing which hyperparameters actually moved the target metric across the sweep.
Build a Report to communicate results to stakeholders who won't open the raw run dashboard:
import wandb
import wandb.apis.reports as wr
report = wr.Report(
project="fraud-scorer",
title="Fraud Scorer — Q3 Sweep Results",
description="Comparing the top 5 sweep trials against the current production model.",
)
report.blocks = [
wr.H1("Summary"),
wr.MarkdownBlock("Best trial improved val_auc from 0.891 to 0.912 "
"with no meaningful latency regression."),
wr.PanelGrid(
runsets=[wr.Runset(project="fraud-scorer", filters={"tags": "baseline,sweep-2026-07"})],
panels=[wr.LinePlot(y=["val_auc"]), wr.ScalarChart(metric="val_auc")],
),
]
report.save()
Reports are a shareable URL with live, filterable panels — suited to a release-review or model-selection writeup that non-engineering stakeholders can consume without W&B project access to raw runs (share permissions still need reviewing — see pitfalls below).
Choose W&B vs. MLflow deliberately, not by default:
--count and/or early_terminate before
starting the first agent — decide the budget up front, not after
noticing the cost.wandb.Artifact for anything a downstream run consumes (a
dataset snapshot, a trained model) instead of logging it as a plain
file — the lineage graph is what makes "what produced this" answerable
later, matching the audit-trail goal in
experiment-tracking.group and job_type in wandb.init() for
distributed training (one physical training job spanning multiple
processes should appear as one logical run in the UI, not N duplicate
runs).wandb client in training environments — logging
behavior and the Reports API have changed across major versions.Symptom: A Bayesian sweep is started with no --count and no
early_terminate, and three days later dozens of agents are still
running trials, well past the point of any further metric improvement,
consuming significant cloud compute budget.
Fix: Always launch wandb agent with an explicit --count, and
configure early_terminate: hyperband in the sweep config so
underperforming trials are killed early — treat an uncapped sweep on
paid compute as a preventable incident, not a "just let it run" default.
Symptom: A distributed training job spanning 8 GPU processes shows
up as 8 separate, confusingly-named runs in the W&B UI instead of one
logical run.
Fix: Call wandb.init() only from the rank-0 process (or use
group/job_type consistently across ranks so the UI can group them),
rather than letting every worker process independently initialize its
own top-level run.
Symptom: A WANDB_API_KEY ends up committed to a training script or
a public repo, and the team discovers unexpected runs/artifacts
appearing in their project from an unrelated source.
Fix: Only supply the key via wandb login locally or the
WANDB_API_KEY environment variable / secret manager in CI — never
hardcode it in source — and rotate the key immediately if it was ever
committed, even to a private repo.
Symptom: An artifact is repeatedly logged under the latest alias
during iterative development, and a teammate assumes old versions are
gone, only to find storage costs are actually climbing because every
prior version is still retained under its own version tag.
Fix: Understand that W&B artifact versions are immutable and
additive by default — latest is just a moving alias, not a
replacement. Set a deliberate retention/deletion policy for
superseded artifact versions instead of assuming latest overwriting
means old data is freed.
Symptom: A W&B Report meant for an internal stakeholder update is shared via a link that turns out to have been left at a broader visibility setting than intended, exposing run details or metrics outside the team. Fix: Review and set the project/report's sharing scope explicitly before sending a report link outside the immediate team — don't assume the default visibility matches what a specific report should have.
Scenario: A team runs a bounded Bayesian sweep to tune a fraud-scoring XGBoost model, then shares a report with the model-risk stakeholder group.
# sweep.yaml
program: train.py
method: bayes
metric: {name: val_auc, goal: maximize}
parameters:
max_depth: {values: [4, 6, 8]}
learning_rate: {min: 0.01, max: 0.15, distribution: log_uniform_values}
early_terminate: {type: hyperband, min_iter: 5}
wandb sweep sweep.yaml # -> ml-platform-team/fraud-scorer/xyz789
for i in 1 2 3 4; do
wandb agent --count 10 ml-platform-team/fraud-scorer/xyz789 &
done
wait
max_depth=6, learning_rate=0.047 reaches val_auc=0.913
versus the current production model's 0.891, with a comparable
latency profile (logged as an artifact-attached benchmark table).fraud-scorer-model:v22) and handed to the packaging step described
in model-packaging-and-versioning.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
22 skills in this plugin
/complete-mlops-platform-deployment-on-aws-from-scratchSequences a complete, end-to-end MLOps platform deployment on AWS from a bare AWS Organization to a production-ready platform serving a first retrained model — AWS landing zone, the SageMaker-vs-EKS+Kubeflow platform decision (EKS+Kubeflow is the worked path here), GPU node pools via the NVIDIA GPU Operator, MLflow experiment tracking on S3, a Kubeflow Pipelines retraining DAG, model registry/packaging with gated promotion, KServe canary/shadow serving, and drift monitoring. This is an integration/orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "stand up an MLOps platform on AWS from scratch," "build the full ML training-to-serving pipeline on EKS/SageMaker," "give me the end-to-end sequence from AWS account to a retrained, monitored production model," or "decide between SageMaker and EKS+Kubeflow for our ML platform."
/complete-mlops-platform-deployment-on-azure-from-scratchSequences a complete, end-to-end MLOps platform deployment on Azure from a bare tenant to a production-ready platform serving a first retrained model — Azure landing zone, the Azure-ML-vs-AKS+Kubeflow platform decision (Azure ML is the worked path), GPU compute clusters/quota, MLflow-compatible experiment tracking, an Azure ML pipeline retraining DAG, Model Registry with gated promotion, managed online endpoints with traffic-split canary rollout, and data-drift monitoring. An integration/ orchestration skill that sequences existing tool-specific skills in the right order and flags handoff points — it does not restate their internals. Use when a user asks to "stand up an MLOps platform on Azure from scratch," "build the full ML training-to-serving pipeline on Azure ML/AKS," "give me the end-to-end sequence from Azure tenant to a retrained, monitored production model," or "decide between Azure ML and AKS+Kubeflow for our ML platform."
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin mlops-skillsOther plugins' skills for the same job