When training machine learning models, tracking metrics, hyperparameters, and results is critical for understanding performance and iterating effectively. While many experiment tracking tools exist, they often come with drawbacks: complex setup, proprietary APIs, paywalls, or heavy overhead.
Hugging Face has introduced Trackio—a lightweight, open-source, and free experiment tracking Python library. Designed as a drop-in replacement for WandB, Trackio makes it easy to log experiments locally, visualize them in a simple dashboard, and share progress seamlessly with Hugging Face Spaces.
Why Experiment Tracking Matters
If you’ve ever trained a model, you know how quickly experiments pile up. Comparing different runs, tweaking hyperparameters, or measuring GPU usage can become overwhelming without a consistent system. Tracking tools help streamline this by:
- Recording metrics and parameters during training.
- Visualizing training/validation curves.
- Comparing results across runs.
- Sharing findings with teammates.
However, most tools are either paid, proprietary, or too rigid for rapid experimentation. This is where Trackio steps in.
Why Hugging Face Built Trackio
The Hugging Face Science team switched to Trackio after finding that existing solutions didn’t fully align with their needs. Key benefits they’ve experienced include:
- Effortless Sharing & Embedding
Easily share experiment dashboards via Hugging Face Spaces or embed plots in blogs and documentation—no logins or complex dashboards required. - Standardization & Transparency
Track GPU energy usage directly withnvidia-smi
integration, making it easier to quantify environmental impacts and include sustainability metrics in model cards. - Accessible Data
No proprietary lock-in. Experiment logs are simple to extract, analyze, and integrate into research workflows. - Lightweight Flexibility
Trackio’s design makes it easy to customize and experiment with logging features without compromising training performance.
Getting Started with Trackio
Installing Trackio is as simple as:
pip install trackio
# or with uv
uv pip install trackio
Since Trackio is API-compatible with WandB, you can start using it instantly by swapping imports:
- import wandb
+ import trackio as wandb
Example: Simulating Multiple Runs
import trackio
import random, time
runs, epochs = 3, 8
def simulate_runs():
for run in range(runs):
trackio.init(project="fake-training", config={
"epochs": epochs,
"learning_rate": 0.001,
"batch_size": 64
})
for epoch in range(epochs):
train_loss = random.uniform(0.2, 1.0)
val_loss = train_loss - random.uniform(0.01, 0.1)
trackio.log({
"epoch": epoch,
"train_loss": train_loss,
"val_loss": val_loss
})
time.sleep(0.2)
trackio.finish()
simulate_runs()
Visualizing Results with Trackio
Once experiments are logged, you can visualize them locally with:
trackio show
Or in Python:
import trackio
trackio.show(project="my-project")
The Gradio-powered dashboard lets you explore metrics interactively.
Want to share your results? Sync your dashboard to Hugging Face Spaces:
trackio.init(project="fake-training", space_id="org_name/space_name")
From there, you can share a link or embed via iframe—perfect for collaboration or public documentation.
Trackio + Hugging Face Ecosystem
Trackio integrates directly with Hugging Face’s ecosystem:
- 🤗 Transformers
Simply setreport_to="trackio"
inTrainingArguments
to start logging. - 🤗 Accelerate
UseAccelerator(log_with="trackio")
to track distributed training with minimal setup.
Behind the scenes, Trackio stores logs in an SQLite database, automatically backing them up as Parquet datasets to Hugging Face Datasets every 5 minutes when used with Spaces. This ensures durability and easy re-analysis.
Design Principles
Trackio is built on a few simple principles:
- WandB-compatible API – seamless migration for existing users.
- Local-first – dashboards run and persist locally by default.
- Lightweight & extensible – under 1,000 lines of Python, easy to customize.
- Free & open-source – no hidden fees, all Hugging Face hosting included.
- Built on Hugging Face Datasets & Spaces – robust handling and visualization.
What’s Next?
Trackio is currently in beta. While it already supports metrics logging and visualization, features like artifact management and advanced visualizations are still on the roadmap. Hugging Face is inviting the community to shape its future—feedback and feature requests can be submitted via the GitHub repo.
Conclusion
Experiment tracking is essential for modern machine learning, but it doesn’t have to be heavy, complex, or expensive. Trackio offers a lightweight, flexible, and open alternative—perfect for researchers, engineers, and teams who want transparency, easy sharing, and integration with Hugging Face’s ecosystem.
If you’re looking for a simple yet powerful experiment tracker, give Trackio a try.