wandb review
wandb 0.28.2 is the Python client and CLI for Weights & Biases experiment tracking. A run records configuration, metrics, system data, console output, media, and summaries in the W&B service; artifacts add dataset and model lineage, while sweeps coordinate hyperparameter jobs across agents. The default destination is W&B's hosted platform, with dedicated and self-managed deployments sold separately. This release makes `wandb login` verify credentials by default, replaces `wandb sync --clean` with `wandb clean`, and adds opt-in gzip for metric filestream requests.
wandb 0.28.2 installed in 0.7 seconds, occupied 106 MB, and imported in 1.57 seconds in our sandbox with 0 audit findings. Use it when a team will accept W&B's service boundary for shared experiment history and artifacts; use a local or self-hosted tracker when credentials, uploads, pricing, or vendor-held history are the wrong trade.
We installed it
| Install | ✓ · 0.7s | 18 packages on disk · 106 MB |
| Import | ✓ | import wandb in 1.57s · compiled extensions · py.typed · requires Python >=3.10 |
| Known vulns | 0 | (pip-audit) |
Answers from our run
Does wandb install cleanly?
Yes. In a fresh container with an empty cache, pip install wandb finished in 0.7s, leaving 18 packages and 106 MB on disk. pip-audit reported no known vulnerabilities.
What does wandb need to run?
Python >=3.10, and a platform wheel with compiled extensions. In our run import wandb succeeded in 1.57s, and the package ships py.typed for type checkers.
wandb or mlflow: which should you use?
mlflow: Choose it for an open source tracking server and model registry that your team operates directly. wandb 0.28.2 installed in 0.7 seconds, occupied 106 MB, and imported in 1.57 seconds in our sandbox with 0 audit findings.
When should you not use wandb?
Training data and metrics cannot leave your infrastructure, and the organization will not operate or buy a private W&B deployment.
Use it if
- A training team needs shared comparisons of metrics, configuration, system utilization, and media across many runs.
- Dataset and model files need versioned artifacts whose lineage connects inputs, training runs, and evaluations.
- Hyperparameter sweeps should distribute configurations to agents running on several machines.
- A supported training framework already reports to W&B and the team wants its maintained integration.
- Training data and metrics cannot leave your infrastructure, and the organization will not operate or buy a private W&B deployment.
- A commercial service, account, API key, and storage plan are unacceptable dependencies for experiment history.
- One developer needs only local loss curves. TensorBoard or a structured metrics file avoids credentials, background uploads, and a remote dashboard.
- The main job is tracing prompts, retrieval, and LLM generations rather than tracking training experiments; W&B treats that as its separate Weave product area.
- Your runtime is 32-bit Windows. Version 0.28.2 removed win32 wheels and requires a 64-bit Python environment there.
Setup reality
We installed wandb 0.28.2 in a fresh Python 3.12 Bookworm sandbox in 0.7 seconds. It left 18 packages and 106 MB on disk; pip-audit reported 0 known vulnerabilities. The package declares 57 direct dependencies, requires Python 3.10 or newer, includes compiled .so extensions and py.typed, and completed import wandb in 1.57 seconds.
Hosted use needs a W&B account and API key. Supply WANDB_API_KEY through a secret manager or run wandb login; version 0.28.2 verifies credentials before saving them by default. Check .netrc handling on shared machines and containers because the CLI can persist credentials there. Set the correct base URL for a private deployment. Do not bake keys or run directories into an image.
Each run writes local files and communicates through background client machinery. Use with wandb.init(...) as run or call run.finish() on every path so queued metrics and final state are sent. In tests, WANDB_MODE=disabled avoids creating runs. offline still writes a run directory for later wandb sync, so it is useful for disconnected training but not a no-op. Version 0.28.2 replaces wandb sync --clean with wandb clean.
Artifacts and media can dominate storage and upload time even when scalar logging is cheap. Log selected examples, define retention outside the training loop, and store the run ID with checkpoints when resumption matters. Metric filestream gzip is opt-in in 0.28.2 and requires server support through x_file_stream_no_gzip=False; do not enable it against an unknown server version. On Windows, this release no longer publishes 32-bit wheels.
Patterns
Track a run and log metrics init-and-log
import wandb
config = {"epochs": 10, "lr": 3e-4}
with wandb.init(project="my-awesome-project", config=config) as run:
for epoch in range(config["epochs"]):
loss = train_one_epoch()
run.log({"loss": loss, "epoch": epoch})The context manager finishes a successful run and marks exceptions as failures. Manual initialization needs an explicit `finish()`.
Use wandb.config as the source of hyperparameters read-config
import wandb
run = wandb.init(project="my-awesome-project", config={"lr": 0.001, "batch_size": 32})
cfg = run.config
optimizer = build_optimizer(lr=cfg.lr)
loader = build_loader(batch_size=cfg.batch_size)
run.finish()Sweep agents replace values in `run.config`; reading local constants instead would ignore the assigned trial.
Log images and other media log-images-media
import wandb
with wandb.init(project="vision") as run:
run.log({
"examples": [wandb.Image(img, caption=f"pred: {p}") for img, p in samples[:8]],
})`wandb.Image` accepts arrays, Pillow images, and paths. Log a selected sample rather than an entire batch.
Version a dataset or model as an artifact log-artifact
import wandb
with wandb.init(project="my-awesome-project", job_type="training") as run:
artifact = wandb.Artifact("model-weights", type="model")
artifact.add_file("checkpoint.pt")
run.log_artifact(artifact)Artifacts are content-addressed, so an unchanged file can create a new version reference without another byte upload.
Download an artifact in another run use-artifact
import wandb
with wandb.init(project="my-awesome-project", job_type="evaluation") as run:
artifact = run.use_artifact("model-weights:latest")
path = artifact.download()
model = load_model(f"{path}/checkpoint.pt")`use_artifact()` records the consumed version in run lineage as well as downloading its files.
Run a hyperparameter sweep hyperparameter-sweep
import wandb
sweep_config = {
"method": "bayes",
"metric": {"name": "val_loss", "goal": "minimize"},
"parameters": {
"lr": {"min": 1e-5, "max": 1e-2},
"batch_size": {"values": [16, 32, 64]},
},
}
def train():
with wandb.init() as run:
val_loss = train_with(run.config.lr, run.config.batch_size)
run.log({"val_loss": val_loss})
sweep_id = wandb.sweep(sweep_config, project="my-awesome-project")
wandb.agent(sweep_id, function=train, count=20)Any agent using this sweep ID can request work; the controller assigns configurations until the count is exhausted.
Track a Hugging Face Trainer run huggingface-trainer
import os
from transformers import TrainingArguments
os.environ["WANDB_PROJECT"] = "my-awesome-project"
args = TrainingArguments(
output_dir="out",
report_to="wandb",
run_name="bert-finetune-1",
logging_steps=50,
)`report_to='wandb'` makes Trainer emit its config and metrics. Set a run name when generated labels are too hard to audit.
Run offline and sync later offline-mode
import os
import wandb
os.environ["WANDB_MODE"] = "offline"
with wandb.init(project="airgapped") as run:
run.log({"loss": 0.5})
# later, from a machine with network access:
# wandb sync wandb/offline-run-*`offline` writes local run data for later sync. Use `disabled` when tests should produce no W&B work at all.
Log a table of predictions log-predictions-table
import wandb
with wandb.init(project="my-awesome-project") as run:
table = wandb.Table(columns=["id", "input", "prediction", "label"])
for ex in eval_samples:
table.add_data(ex.id, ex.text, ex.pred, ex.label)
run.log({"eval_predictions": table})W&B Tables support filtering in the web UI, but large prediction sets also consume upload time and storage.
Resume a crashed or interrupted run resume-run
import wandb
run = wandb.init(
project="my-awesome-project",
id="a1b2c3d4",
resume="must",
)
run.log({"loss": 0.42})
run.finish()Persist the original run ID beside the checkpoint. `resume='must'` fails instead of silently creating a replacement.
Track the best value of a metric, not the last define-metric-summary
import wandb
with wandb.init(project="my-awesome-project") as run:
run.define_metric("val_acc", summary="max")
for epoch in range(10):
run.log({"val_acc": evaluate()})
# run summary now shows val_acc.max instead of the final epoch valueRun summaries default to the last value; declaring `summary='max'` keeps the best validation accuracy.
Alternatives
| Package | Registry | Pick it when |
|---|---|---|
| mlflow | PyPI | Choose it for an open source tracking server and model registry that your team operates directly. |
| tensorboard | PyPI | Choose it for local scalar and graph visualization without shared artifact lineage or a hosted account. |
| aim | PyPI | Choose it for a lighter open source experiment tracker with a local-first server and queryable runs. |
More ai / ml guides
openai · mcp · huggingface-hub · @modelcontextprotocol/sdk · scikit-learn · tiktoken · the whole shelf →
How this guide is made: grounded in the library's documentation, release notes, changelog, and issue history, on a fixed rubric — not a hands-on install of every release. The 50 most-downloaded entries are additionally install-verified in clean containers. Corrections: contact the desk.

