Advanced

W&B Advanced Best Practices

Enterprise patterns, team collaboration workflows, CI/CD integration, and production ML pipelines with Weights & Biases.

Team Collaboration Patterns

PatternImplementation
Project namingUse consistent naming: team/task-version (e.g., nlp/sentiment-v2)
Run namingDescriptive names: resnet50-augmented-lr0.001-bs64
TagsUse tags for lifecycle: ["experiment", "baseline", "production"]
GroupsGroup related runs: cross-validation folds, ablation studies
Weekly reportsCreate template Reports that auto-update with latest runs

CI/CD Integration

YAML - GitHub Actions with W&B
name: ML Pipeline
on:
  push:
    branches: [main]
    paths: ['models/**', 'data/**']

jobs:
  train-and-evaluate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: pip install -r requirements.txt

      - name: Train model
        env:
          WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
        run: python train.py --config configs/prod.yaml

      - name: Evaluate and promote
        env:
          WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
        run: |
          python evaluate.py --model latest
          python promote.py --alias staging

Model Registry Workflow

Python - Production model lifecycle
import wandb

# After training: log model as artifact
run = wandb.init(project="production-models")
artifact = wandb.Artifact("sentiment-model", type="model")
artifact.add_dir("./model_weights")
run.log_artifact(artifact)

# Link to Model Registry
run.link_artifact(artifact, "my-team/model-registry/sentiment-model")
run.finish()

# Promote to staging
api = wandb.Api()
artifact = api.artifact("my-team/model-registry/sentiment-model:latest")
artifact.aliases.append("staging")
artifact.save()

# After validation: promote to production
artifact.aliases.append("production")
artifact.save()

Production Monitoring

Python - Monitor model in production
import wandb

# Log inference metrics
run = wandb.init(project="production-monitoring",
                 name="inference-monitor",
                 tags=["production", "monitoring"])

# Log predictions and latency
for batch in inference_stream:
    predictions = model.predict(batch)
    wandb.log({
        "inference_latency_ms": latency,
        "prediction_distribution": wandb.Histogram(predictions),
        "confidence_mean": predictions.mean(),
        "low_confidence_count": (predictions < 0.5).sum(),
        "requests_per_second": rps,
    })

Common Pitfalls

  • Too many projects: Consolidate related experiments into one project. Use tags and groups to organize, not separate projects.
  • Inconsistent configs: Use the same config key names across all runs. Standardize with a config schema.
  • Not using Model Registry: Track model lifecycle with aliases (staging, production) instead of manual file management.
  • Ignoring Reports: Reports are how you communicate results. Make weekly reporting a team habit.
  • API key in code: Always use WANDB_API_KEY environment variable or wandb login. Never hardcode keys.

Frequently Asked Questions

W&B provides an MLflow import tool. Use wandb sync mlruns/ to import existing MLflow runs. For ongoing migration, you can log to both platforms simultaneously during the transition period.

W&B Enterprise supports on-premises deployment, SOC 2 Type II compliance, SSO/SAML, and audit logging. For sensitive data, use W&B Server (self-hosted) to keep all data within your infrastructure.

Use W&B Artifacts with reference-type artifacts that point to data in S3/GCS instead of uploading to W&B servers. This tracks lineage without duplicating large datasets. Set type="dataset" and use artifact.add_reference().

Ready to Go Deeper?

Live instructor-led courses from our partners. Affiliate disclosure.