Adds experiment tracking to ML training with Trackio - log metrics via the Python API, fire structured alerts on diagnostic conditions, and query runs/metrics/alerts via CLI with JSON output for agents.
---
name: huggingface-trackio
description: Track and visualize ML training experiments with Trackio. Use when logging metrics during training (Python API), firing alerts for training diagnostics, or retrieving/analyzing logged metrics (CLI). Syncs to HF Spaces for real-time dashboards and supports JSON output for automation.
---
# Trackio - Experiment Tracking
Trackio logs and visualizes ML training metrics and syncs to Hugging Face Spaces for monitoring dashboards.
## How to use
1. Log metrics in your training script: `trackio.init(project=..., space_id=...)`, then `trackio.log({"loss": ..., "accuracy": ...})`, finishing with `trackio.finish()`. Pass `space_id` so remote runs persist after the instance terminates.
2. Fire alerts on diagnostic conditions with `trackio.alert(title=..., text=..., level=trackio.AlertLevel.WARN|ERROR)` - useful for loss spikes, NaN gradients, or stalls.
3. Retrieve data via the CLI: `trackio list projects/runs/metrics/alerts` and `trackio get metric ...`; add `--json` for agent-friendly output.
4. Launch the dashboard with `trackio show` and sync to a Space with `trackio sync`.
5. For autonomous runs: insert alerts, launch in background, poll `trackio list alerts --json --since <ts>`, read metrics, then iterate hyperparameters.
Full skill & source: https://github.com/huggingface/skills/tree/ea9a24f38a98baf2430dab3bcb31a89753ae9e6d/skills/huggingface-trackio