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.
Agent 可直接安装
这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。
npx -y tokrepo@latest install 084bc7ee-ad89-498d-8640-9cbd2e197a42 --target codex先 dry-run 确认安装计划,再运行此命令。
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.
常见问题
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.
引用来源 (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
来源与感谢
wandb/wandb — 10,900+ GitHub stars
讨论
相关资产
ClearML — End-to-End MLOps Platform
ClearML provides experiment tracking, pipeline orchestration, data management, and model serving in one platform. 6.6K+ stars. 2-line integration. Apache 2.0.
MediaPipe — Cross-Platform ML Solutions by Google
A framework for building multimodal applied ML pipelines, providing ready-to-use solutions for face detection, hand tracking, pose estimation, object detection, and text classification across mobile, web, and desktop.
Kedro — Production-Ready ML Pipeline Framework for Python
Kedro is an open-source Python framework by McKinsey QuantumBlack that applies software engineering best practices to data science and ML pipelines. It provides a standardized project structure, data catalog, and pipeline abstraction that makes experimental code production-ready.
MLX — Apple Silicon ML Framework
MLX is an array framework for machine learning on Apple silicon by Apple Research. 24.9K+ GitHub stars. NumPy-like API, unified memory, lazy computation, autodiff. Python, C++, Swift. MIT licensed.