Skip to content
Introducing Trackio: Hugging Face’s Lightweight Experiment Tracking Library
Source: huggingface.co

Introducing Trackio: Hugging Face’s Lightweight Experiment Tracking Library

Sources: https://huggingface.co/blog/trackio, Hugging Face Blog

TL;DR

  • Trackio is an open-source, free experiment-tracking Python library with a local Gradio dashboard.
  • It can sync the dashboard to Hugging Face Spaces for sharing via URL, with private or public options.
  • It’s designed as a drop-in replacement for wandb, with API compatibility for wandb.init, wandb.log, and wandb.finish.
  • It surfaces energy usage metrics (via nvidia-smi) to support transparency and comparisons.
  • Data logged to Spaces lives in an ephemeral SQLite database, which Trackio converts to Parquet and backs up to a Hugging Face Dataset every 5 minutes.

Context and background

Trackio is an open-source Python library that lets you track metrics and visualize them using a local Gradio dashboard. You can also sync this dashboard to Hugging Face Spaces, which means you can share the dashboard with other users simply by sharing a URL. Since Spaces can be private or public, this means you can share a dashboard publicly or just within members of your Hugging Face organization — all for free. Trackio is designed to be a drop-in replacement for experiment tracking libraries like wandb; the API is compatible with wandb.init, wandb.log, and wandb.finish, so you can simply import Trackio as wandb in your code. The Hugging Face science team has started using Trackio for research projects and has highlighted several advantages: easier sharing and embedding, standardization and transparency, data accessibility, and flexibility for rapid experimentation. A notable capability is the direct collection of GPU energy usage information via nvidia-smi, enabling straightforward energy accounting and comparison to add context in model cards. The broader idea is to provide a lightweight, open-source tool that fits into existing research workflows without imposing cost or rigid infrastructure. For Teams and researchers seeking verifiable, shareable progress, Trackio offers a practical path within the Hugging Face ecosystem, including native alignment with other Hugging Face libraries like transformers and accelerate.

What’s new

Trackio introduces a local, lightweight experiment-tracking workflow with several core capabilities:

  • Local Gradio dashboard for interactive visualization of metrics and hyperparameters.
  • Optional synchronization to Hugging Face Spaces, allowing sharing via URL and embedding in blogs or docs with iframes.
  • Drop-in API compatibility with wandb, enabling a smooth transition for teams used to wandb.init, wandb.log, and wandb.finish.
  • Ephemeral SQLite storage on Spaces for live dashboards, with automated conversion to Parquet and periodic backups to a Hugging Face Dataset every 5 minutes.
  • Native integration with Hugging Face libraries like transformers and accelerate; no extra setup required to log metrics when using Trainer or Accelerate.
  • Acknowledgement that Trackio is lightweight and currently in beta, with some features intentionally missing (artifact management and complex visualizations). The project invitation page welcomes feature requests via GitHub issues.
FeatureDescription
Open-source and freeYes; Trackio is open-source and freely available
Local dashboardGradio-based dashboard on the local machine
Spaces syncDashboards can be synced to Hugging Face Spaces for sharing
API compatibilityDrop-in replacement for wandb; wandb.init, wandb.log, wandb.finish compatible; import as wandb
Data storageEphemeral SQLite on Spaces; converted to Parquet and backed up to a Dataset every 5 minutes
Energy metricsTracks GPU energy usage via nvidia-smi
IntegrationsWorks with transformers and accelerate; supports Trainer and Accelerate workflows
StatusBeta; artifact management and advanced visualizations are not yet available
Sharing optionsShare via URL or embed with iframe; Spaces can be private or public

Why it matters (impact for developers/enterprises)

For developers and teams, Trackio promises easier sharing of training progress and results. The ability to embed plots directly in blog posts and documentation using iframes lowers the barrier to communicating findings without requiring collaborators to set up accounts or dashboards. The energy-usage capability supports transparency around resource use, which is increasingly relevant for model cards and responsible AI reporting. By exporting logged data to a Parquet dataset on Hugging Face Datasets and backing up periodically, Trackio also supports reproducibility and downstream analytics beyond the live dashboard. The integration with the Hugging Face ecosystem — including native compatibility with transformers and accelerate — means developers can log metrics with minimal setup and maintain a lightweight workflow suitable for rapid experimentation and sharing across teams.

Technical details or Implementation

Trackio is an open-source Python library that lets you track any metrics and visualize them using a local Gradio dashboard. You can also sync this dashboard to Hugging Face Spaces, which means you can then share the dashboard with other users simply by sharing a URL. Since Spaces can be private or public, this means you can share a dashboard publicly or just within members of your Hugging Face organization — all for free. Trackio is designed to be a drop-in replacement for experiment tracking libraries like wandb. The API is compatible with wandb.init, wandb.log, and wandb.finish, so you can simply import Trackio as wandb in your code. The library’s design emphasizes lightweight deployment and rapid experimentation.

Installation

  • You can install Trackio using pip. The project emphasizes a straightforward setup without requiring a complex environment.

Getting started and dashboards

  • After logging your experiments, you can launch the dashboard to visualize your results. You can also run the dashboard from Python and, if desired, specify a project name to organize experiments.

Space synchronization

  • To sync your local dashboard to Hugging Face Spaces, simply pass a space_id to init. When you host the dashboard on Spaces, you can share the URL or embed it anywhere using an iframe, with Spaces offering private or public access.

Data storage and backups on Spaces

  • When syncing to Spaces, the data is logged to an ephemeral SQLite database on Spaces. This database is reset if the Space restarts, so Trackio converts the SQLite data to a Parquet dataset and backs it up to a Hugging Face Dataset every 5 minutes, ensuring you can visualize logged metrics at any time.
  • Tip: you can set the name of this dataset by passing a dataset_id to trackio.init().

Integrations and usage with HF libraries

  • Trackio integrates natively with Hugging Face libraries like transformers and accelerate, so you can log metrics with minimal setup. With transformers.Trainer and with accelerate, there is no extra setup required—just plug Trackio in and start tracking.

Status and roadmap

  • Trackio is intentionally lightweight and currently in beta. Some features found in other tracking tools, such as artifact management or complex visualizations, are not available yet. The project invites community input and feature requests via its GitHub issues page.

Key takeaways

  • Trackio provides a local, open-source tracking solution with Spaces integration for sharing.
  • It offers a drop-in wandb replacement with API compatibility to ease adoption.
  • Energy usage metrics and data export to Parquet-backed Hugging Face Datasets improve transparency and reproducibility.
  • The tool is lightweight, HF-native, and designed for rapid experimentation, with some features still in development.
  • Dashboards can be embedded or shared via URL, enabling collaboration without requiring additional accounts.

FAQ

  • What is Trackio and who is it for?

    Trackio is an open-source Python library for tracking metrics and visualizing them in a local Gradio dashboard, with optional synchronization to Hugging Face Spaces. It is intended for researchers and developers who want an accessible, shareable, and lightweight experiment-tracking tool.

  • How does Trackio relate to wandb?

    Trackio is designed as a drop-in replacement for wandb, with an API compatible with wandb.init, wandb.log, and wandb.finish, so you can import it as wandb in your code and migrate gradually.

  • How is data stored when using Spaces?

    Data logged to Spaces is stored in an ephemeral SQLite database on Spaces, which Trackio converts to a Parquet dataset and backs up to a Hugging Face Dataset every 5 minutes.

  • Can I share dashboards publicly?

    Yes. Dashboards can be shared via a URL and embedded with an iframe; Spaces can be private or public.

  • What is the current status and what’s missing?

    Trackio is in beta and intentionally lightweight; artifact management and more complex visualizations are not yet available, and user feedback via issues is welcome.

References

More news