Skip to main content

Using Replit and Weights & Biases

A quick guide on using Weights & Biases
Created on February 3|Last edited on February 8

What is Weights & Biases?

Weights & Biases allows you to keep track of your experiments, find your best results and save your best models. For a quick guide on how to get started with adding Weights & Biases to your code, checkout our Quickstart Guide. You will need a free account to use Weights & Biases, sign up here

W&B API Key

When a W&B run starts, you will be prompted for your API key, which you can find here: https://wandb.ai/authorize
  • When using Weights & Biases with Replit, we recommend adding it to your Replit Secrets and naming it WANDB_API_KEY
  • You can also set an environment varibale for your API key in your script like so: os.environ["WANDB_API_KEY"] = "XXX"


W&B on Replit

One small addition needed for W&B to work on Replit is to adde the following environment variable to the top of your script, then you'll be good to go!
os.environ["WANDB_CONSOLE"]="wrap"


W&B Reports

To be eligible for one of our Hackathon prizes you'll need to create a Report to showcase your work. Here is a link to some of our favorite Reports:



W&B Tables




Project Ideas

Some ideas!

Training Focussed

  • nanoGPT fine-tuning - replit example
  • Your intro to ML journey
  • SetFiT training for quick NLP models
  • Agent to navigate your UI - fine-tune a OCR model to use it to find UI elements - (example code here)

API-focussed



GPUs on Replit

GPUs are in Beta on Replit, meaning that you’ll have to turn on Explorer mode to access them inside of your Repl. To turn on Explorer, follow the instructions here. Then, you’ll be able to add a GPU to your Repl using the instructions in the official Replit documentation. If you encounter any bugs, please report them in the Ask forum.
For support during the Hackathon and the latest announcements, please visit the #machine-learning-hackathon channel in the Replit Discord server.


Disk Storage and GPU Memory Management on Replit

Disk Storage Management

Replit repls are currently limited to 1 GB so its worth keeping an eye on your disk space usage and periodically deleting any model files or datasets that aren't being used

GPU Memory Management

You can check how much GPU memory is available by running the following command in the shell:
  • nvidia-smi


Weights & Biases Community Resources

Replit Resources

Replit repl Templates