Weights & Biases — ML Experiment Tracking
W&B tracks, visualizes, and manages ML experiments and LLM apps. 10.9K+ GitHub stars. Experiment tracking, model versioning, Weave for LLMs. MIT.
What it is
Weights and Biases (W&B) is a platform for tracking, visualizing, and managing machine learning experiments. It captures hyperparameters, metrics, model artifacts, and system resource usage with a lightweight Python integration. The Weave product extends this to LLM application observability.
W&B targets ML engineers and data scientists who need to compare experiments, reproduce results, and collaborate on model development. The Python SDK is MIT licensed.
How it saves time or tokens
Without experiment tracking, ML teams rely on spreadsheets, terminal logs, and naming conventions to keep track of training runs. W&B auto-captures everything: hyperparameters, loss curves, system metrics, code state, and output artifacts. A dashboard lets you compare runs side by side.
The estimated token cost for describing a W&B integration is approximately 331 tokens. The 2-line init captures most information automatically.
How to use
- Install and authenticate:
pip install wandb
wandb login
- Add tracking to any training script:
import wandb
wandb.init(project='my-project', config={
'learning_rate': 1e-4,
'epochs': 10,
'batch_size': 32
})
for epoch in range(10):
loss = train_one_epoch()
wandb.log({'loss': loss, 'epoch': epoch})
wandb.finish()
- View results at wandb.ai or your self-hosted instance.
Example
import wandb
from wandb import Artifact
# Track a training run with model artifact
run = wandb.init(project='nlp', name='bert-v2')
# Training loop
for step in range(1000):
metrics = train_step()
wandb.log(metrics)
# Save model as an artifact
artifact = Artifact('model-bert-v2', type='model')
artifact.add_dir('checkpoints/')
run.log_artifact(artifact)
# Weave for LLM tracing
import weave
weave.init('my-llm-app')
@weave.op
def generate(prompt: str) -> str:
return llm.complete(prompt)
Related on TokRepo
- AI Tools for Monitoring -- ML observability and tracking tools
- AI Tools for Coding -- Development tools for ML workflows
Common pitfalls
- The free tier has limits on storage and team size. Large teams or projects with big artifacts may need a paid plan.
- wandb.init() creates a network connection to the W&B servers. In air-gapped environments, use offline mode:
wandb.init(mode='offline'). - Auto-logging can capture sensitive information (environment variables, code diffs). Review what is logged before sharing runs publicly.
Frequently Asked Questions
W&B has a free tier for personal projects with unlimited experiments. Team features and increased storage require paid plans. Academic researchers get free access to team features.
Both track experiments and manage models. W&B provides a more polished UI, better visualization tools, and a hosted platform. MLflow is fully open-source and self-hosted. W&B's Weave product extends into LLM observability.
Yes. W&B offers a self-hosted option called W&B Server for teams that need to keep data on-premises. It runs as a Docker container and supports the same features as the cloud version.
Yes. W&B has integrations for PyTorch, TensorFlow, Keras, JAX, Hugging Face Transformers, and many other ML frameworks. Most frameworks are auto-detected and logged without extra configuration.
Weave is W&B's LLM observability product. It traces LLM application calls, tracks prompts and completions, and provides evaluation tools for LLM outputs. Use it to monitor production LLM applications.
Citations (3)
- W&B GitHub Repository— W&B tracks ML experiments with 2-line Python integration
- W&B Weave Documentation— Weave provides LLM application observability
- W&B README— Python SDK is MIT licensed
Related on TokRepo
Source & Thanks
wandb/wandb — 10,900+ GitHub stars
Discussion
Related Assets
Conda — Cross-Platform Package and Environment Manager
Install, update, and manage packages and isolated environments for Python, R, C/C++, and hundreds of other languages from a single tool.
Sphinx — Python Documentation Generator
Generate professional documentation from reStructuredText and Markdown with cross-references, API autodoc, and multiple output formats.
Neutralinojs — Lightweight Cross-Platform Desktop Apps
Build desktop applications with HTML, CSS, and JavaScript using a tiny native runtime instead of bundling Chromium.