Start tracking machine learning experiments in 5 minutes
Build better models more efficiently with Weights & Biases experiment tracking.
Try this short Google Colab to see Weights & Biases in action, no code installation required!

1. Set up wandb

a) Sign up for a free account at and then login to your wandb account.
b) Install the wandb library on your machine in a Python 3 environment using pip
c) Login to the wandb library on your machine. You will find your API key here:
Command Line
Install the CLI and Python library for interacting with the Weights and Biases API:
pip install wandb
Next, log in to W&B:
wandb login
Or if you're using W&B Server:
wandb login --host=
Install the CLI and Python library for interacting with the Weights and Biases API:
!pip install wandb
Next, import the W&B Python SDK and log in:
import wandb

2. Start a new run

Initialize a new run in W&B in your Python script or notebook. wandb.init() will start tracking system metrics and console logs, right out of the box. Run your code, put in your API key when prompted, and you'll see the new run appear in W&B. More about wandb.init() →
import wandb

3. Track metrics

Use wandb.log() to track metrics or a framework integration for easy instrumentation. More about wandb.log() →
wandb.log({'accuracy': train_acc, 'loss': train_loss})

4. Track hyperparameters

Save hyperparameters so you can quickly compare experiments. More about wandb.config →
wandb.config.dropout = 0.2

5. Get alerts

Get notified via Slack or email if your W&B Run has crashed or whether a custom trigger, such as your loss going to NaN or a step in your ML pipeline has completed, has been reached. See the Alerts docs for a full setup.
  1. 1.
    Turn on Alerts in your W&B User Settings
  2. 2.
    Add wandb.alert() to your code
title="Low accuracy",
text=f"Accuracy {acc} is below the acceptable threshold {thresh}"
Then see W&B Alerts messages in Slack (or your email):
W&B Alerts in a Slack channel

What next?

  1. 1.
    Collaborative Reports: Snapshot results, take notes, and share findings
  2. 2.
    Data + Model Versioning: Track dependencies and results in your ML pipeline
  3. 3.
    Data Visualization: Visualize and query datasets and model evaluations
  4. 4.
    Hyperparameter Tuning: Quickly automate optimizing hyperparameters
  5. 5.
    Private-Hosting: The enterprise solution for private cloud or on-prem hosting of W&B

Common Questions

Where do I find my API key? Once you've signed in to, the API key will be on the Authorize page.
How do I use W&B in an automated environment? If you are training models in an automated environment where it's inconvenient to run shell commands, such as Google's CloudML, you should look at our guide to configuration with Environment Variables.
Do you offer local, on-prem installs? Yes, you can privately host W&B locally on your own machines or in a private cloud, try this quick tutorial notebook to see how. Note, to login to wandb local server you can set the host flag to the address of the local instance.
How do I turn off wandb logging temporarily? If you're testing code and want to disable wandb syncing, set the environment variable WANDB_MODE=offline.