Welcome to trackio: a lightweight, free experiment tracking Python library built by Hugging Face π€. It is local-first, supports very high logging throughputs for many parallel experiments, and provides an easy CLI interface for querying, perfect for LLM-driven experimenting.
Trackio also ships with a Gradio-based dashboard you can use to view metrics locally:
Trackio's main features:
-
API compatible with
wandb.init,wandb.log, andwandb.finish. Drop-in replacement: justimport trackio as wandb
and keep your existing logging code.
-
Local-first design: dashboard runs locally by default. You can also host it on Spaces by specifying a
space_idintrackio.init().- Persists logs in a Sqlite database locally (or, if you provide a
space_id, in a private Hugging Face Dataset) - Visualize experiments with a Gradio dashboard locally (or, if you provide a
space_id, on Hugging Face Spaces)
- Persists logs in a Sqlite database locally (or, if you provide a
-
LLM-friendly: Built with autonomous ML experiments in mind, Trackio includes a CLI for programmatic access and a Python API for run management, making it easy for LLMs to log metrics and query experiment data.
-
Everything here, including hosting on Hugging Face, is free!
Trackio is designed to be lightweight and extensible. It is written entirely in Python so that developers can easily fork the repository and add functionality that they care about.
Trackio requires Python 3.10 or higher. Install with pip:
pip install trackioor with uv:
uv pip install trackioTo get started, you can run a simple example that logs some fake training metrics:
import trackio
import random
import time
runs = 3
epochs = 8
for run in range(runs):
trackio.init(
project="my-project",
config={"epochs": epochs, "learning_rate": 0.001, "batch_size": 64}
)
for epoch in range(epochs):
train_loss = random.uniform(0.2, 1.0)
train_acc = random.uniform(0.6, 0.95)
val_loss = train_loss - random.uniform(0.01, 0.1)
val_acc = train_acc + random.uniform(0.01, 0.05)
trackio.log({
"epoch": epoch,
"train_loss": train_loss,
"train_accuracy": train_acc,
"val_loss": val_loss,
"val_accuracy": val_acc
})
time.sleep(0.2)
trackio.finish()Running the above will print to the terminal instructions on launching the dashboard.
The usage of trackio is designed to be identical to wandb in most cases, so you can easily switch between the two libraries.
import trackio as wandbYou can launch the dashboard by running in your terminal:
trackio showor, in Python:
import trackio
trackio.show()You can also provide an optional project name as the argument to load a specific project directly:
trackio show --project "my-project"or, in Python:
import trackio
trackio.show(project="my-project")When calling trackio.init(), by default the service will run locally and store project data on the local machine.
But if you pass a space_id to init, like:
trackio.init(project="my-project", space_id="orgname/space_id")or
trackio.init(project="my-project", space_id="username/space_id")it will use an existing or automatically deploy a new Hugging Face Space as needed. You should be logged in with the huggingface-cli locally and your token should have write permissions to create the Space.
If you've been tracking experiments locally and want to move them to Hugging Face Spaces for sharing or collaboration, use the sync function:
import trackio
trackio.sync(project="my-project", space_id="username/space_id")This uploads your local project database to a new or existing Space. The Space will display all your logged experiments and metrics.
Example workflow:
import trackio
# Start tracking locally
trackio.init(project="my-project", config={"lr": 0.001})
trackio.log({"loss": 0.5})
trackio.finish()
# Later, sync to Spaces
trackio.sync(project="my-project", space_id="username/my-experiments")One of the reasons we created trackio was to make it easy to embed live dashboards on websites, blog posts, or anywhere else you can embed a website.
If you are hosting your Trackio dashboard on Spaces, then you can embed the url of that Space as an IFrame. You can even use query parameters to only specific projects and/or metrics, e.g.
<iframe src="https://abidlabs-trackio-1234.hf.space/?project=my-project&metrics=train_loss,train_accuracy&sidebar=hidden" style="width:1600px; height:500px; border:0;">Supported query parameters:
project: (string) Filter the dashboard to show only a specific projectmetrics: (comma-separated list) Filter the dashboard to show only specific metrics, e.g.train_loss,train_accuracysidebar: (string: one of "hidden" or "collapsed"). If "hidden", then the sidebar will not be visible. If "collapsed", the sidebar will be in a collapsed state initially but the user will be able to open it. Otherwise, by default, the sidebar is shown in an open and visible state.footer: (string: "false"). When set to "false", hides the Gradio footer. By default, the footer is visible.xmin: (number) Set the initial minimum value for the x-axis limits across all metric plots.xmax: (number) Set the initial maximum value for the x-axis limits across all metric plots.smoothing: (number) Set the initial value of the smoothing slider (0-20, where 0 = no smoothing).
To get started and see basic examples of usage, see these files:
- Basic example of logging metrics locally
- Persisting metrics in a Hugging Face Dataset
- Deploying the dashboard to Spaces
trackio.log() is a non-blocking call that appends to an in-memory queue and returns immediately. A background thread drains the queue every 0.5 s and writes to the local SQLite database. Because log calls never touch the network or disk on the calling thread, the client-side throughput is effectively unlimited -- you can burst thousands of calls per second without slowing down your training loop.
When a space_id is provided, the same background thread batches queued entries and pushes them to the Space via the Gradio client API. The main factors that affect end-to-end throughput are:
| Metric | Measured | Notes |
|---|---|---|
| Burst from a single run | 2,000 logs delivered in < 8 s | log() calls themselves complete in ~0.01 s; the rest is network drain time. |
| Parallel runs (32 threads) | 32,000 logs (32 Γ 1,000) delivered in ~14 s wall time | Each thread opens its own Gradio client connection to the Space. |
| Logs per batch | No hard cap | All entries queued during the 0.5 s interval are sent in a single predict() call. |
| Data safety | Zero-loss | If a batch fails to send, it is persisted to local SQLite and retried automatically when the connection recovers. |
These numbers were measured against a free-tier Hugging Face Space (2 vCPU / 16 GB RAM). Throughput will scale with the Space hardware tier, and local-only logging is orders of magnitude faster since no network round-trip is involved.
Tip: For high-frequency logging (e.g. logging every training step), Trackio's queue-and-batch design means your training loop is never blocked by network I/O. Even if the Space is temporarily unreachable, logs accumulate locally and are replayed once the connection is restored.
Note that Trackio is in pre-release right now and we may release breaking changes. In particular, the schema of the Trackio sqlite database may change, which may require migrating or deleting existing database files (located by default at: ~/.cache/huggingface/trackio).
Since Trackio is in beta, your feedback is welcome! Please create issues with bug reports or feature requests.
MIT License
The complete documentation and API reference for each version of Trackio can be found at: https://huggingface.co/docs/trackio/index
We welcome contributions to Trackio! Whether you're fixing bugs, adding features, or improving documentation, your contributions help make Trackio better for the entire machine learning community.
To start contributing, see our Contributing Guide.
To set up Trackio for development, clone this repo and run:
pip install -e ".[dev,tensorboard]"Trackio is pronounced TRACK-yo, as in "track yo' experiments"

