Registry / ai-ml / trackio

trackio

JSON →
library0.37.0pypypi✓ verified 24d ago

Trackio is a lightweight, local-first, and free experiment tracking library built by Hugging Face. It offers an API compatible with Weights & Biases (wandb) for seamless migration, allowing users to log metrics, parameters, and artifacts. Logs are persisted locally in an SQLite database and can be optionally synced with Hugging Face Datasets and visualized on Hugging Face Spaces. It is actively developed with a focus on simplicity, extensibility, and LLM-friendly programmatic access.

pip install trackio
INSTALL
IMPORT
SIG · TRACKIO
T
trackio
ai-mlpythonv0.37.0
Install
13.5s avg
Import
2776ms
Disk
504MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.8.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.930 runs
installs and imports cleanly · install 0.0s · import 3.028s · 728MB
glibc
py 3.103.930 runs
installs and imports cleanly · install 13.5s · import 1.413s · 324MB
504MB installed
● package 504MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

trackio
import trackio
from trackio import init, log
The primary interaction is through the main 'trackio' module, often aliased as 'wandb' for compatibility.
wandb_alias
import trackio as wandb
For direct compatibility with existing Weights & Biases codebases, `trackio` can be imported as `wandb`.

This quickstart demonstrates how to initialize a tracking run, log metrics within a simulated training loop, and finalize the run. It uses `trackio.init` to set up the project and configuration, `trackio.log` to record scalar metrics, and `trackio.finish` to conclude the experiment. To view the collected metrics, open a new terminal and run `trackio show`.

import trackio import random import time import os # Initialize a new experiment run # For Spaces integration, add space_id='your_username/your_space_name' run = trackio.init(project="my-awesome-project", name=f"run-{int(time.time())}", config={ "learning_rate": 0.001, "epochs": 5, "batch_size": 32 }) print(f"Starting run: {run.name} in project: {run.project_name}") # Simulate a training loop for epoch in range(run.config["epochs"]): # Simulate metrics train_loss = 1.0 / (epoch + 1) + random.uniform(-0.1, 0.1) val_loss = 0.8 / (epoch + 1) + random.uniform(-0.05, 0.05) accuracy = 0.5 + (epoch / run.config["epochs"]) * 0.4 + random.uniform(-0.03, 0.03) # Log metrics trackio.log({"epoch": epoch, "train_loss": train_loss, "val_loss": val_loss, "accuracy": accuracy}) print(f"Epoch {epoch}: Train Loss = {train_loss:.4f}, Val Loss = {val_loss:.4f}, Accuracy = {accuracy:.4f}") time.sleep(0.5) # Finish the run trackio.finish() print("Run finished. To view the dashboard, run `trackio show` in your terminal.")
trackio --version
Debug
Known issues
breakingTrackio is currently in beta, and its SQLite database schema may change in future releases. This could necessitate migrating or deleting existing database files (located by default at `~/.cache/huggingface/trackio`) to maintain compatibility.
fix
Be prepared to delete or migrate local database files when updating to new major/minor versions. Consult release notes for migration instructions.
affects: <=0.22.0
gotchaThe `trackio.init()` function must be called at the beginning of your script or experiment run before any other `trackio` logging functions (`log`, `save`, etc.) are used. Failing to do so will result in errors as the tracking context will not be established.
fix
Always call `trackio.init()` once per experiment run to establish the tracking environment.
affects: All
gotchaWhile Trackio provides API compatibility with `wandb`, it is intentionally lightweight and does not yet support all advanced features found in Weights & Biases, such as artifact versioning, comprehensive custom visualizations, or advanced sweeps management.
fix
Review the official Trackio documentation for supported features if migrating from `wandb` or expecting specific advanced functionalities.
affects: All
gotchaWhen using `space_id` in `trackio.init()` to sync logs to Hugging Face Spaces, your local `huggingface-cli` must be logged in and configured with a token that has write permissions for the specified Space or to create a new one.
fix
Ensure you are logged in via `huggingface-cli login` and your token has the necessary write access before initializing runs with `space_id`.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'trackio'
The trackio library has not been installed in your current Python environment.
fix
pip install trackio
NameError: name 'wandb' is not defined
You attempted to use wandb-compatible functions (like wandb.init()) after importing trackio, but without aliasing 'trackio.wandb' as 'wandb'.
fix
Replace 'import wandb' with 'import trackio.wandb as wandb' in your code.
AttributeError: module 'trackio' has no attribute 'init'
You are trying to call wandb-compatible functions directly from the top-level 'trackio' module, instead of through 'trackio.wandb'.
fix
Access wandb-compatible functions by aliasing 'trackio.wandb': 'import trackio.wandb as wandb; wandb.init(...)'
sqlite3.OperationalError: unable to open database file
Trackio failed to open or create its local SQLite database, typically due to insufficient file permissions in the specified 'log_dir' or an invalid directory path.
fix
Ensure the directory where trackio attempts to store its SQLite database (default: 'runs/' in the current working directory, or specified by 'log_dir' in 'trackio.configure()') exists and has proper read/write permissions for the running process.
Upgrade
Version history
0.37.0latest on PyPI · released Aug 26, 2026
Audit
Dependencies
nvidia-smioptionalFor logging NVIDIA GPU metrics; optional with `[gpu]` extra.
py-apple-gpuoptionalFor logging Apple M-series CPU/GPU/system metrics; optional with `[apple-gpu]` extra.
tensorboardoptionalFor importing TensorBoard event files; optional with `[tensorboard]` extra.
huggingface_huboptionalFor interacting with Hugging Face Hub (Spaces, Datasets); implicitly used when `space_id` is provided.
gradiorequiredUsed for the local dashboard UI.
Agent activity
38 hits · last 30 days
node
32
OpenAI (training)
1
Resources
trackio — pip install trackio · libregistry