You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`trackio list alerts --project <name> --json` — retrieve alerts
51
53
-`trackio show` — launch the dashboard
52
54
-`trackio sync` — sync to HF Space
53
55
54
56
**Key concept**: Add `--json` for programmatic output suitable for automation and LLM agents.
55
57
56
-
**Remote Spaces**: Add `--space <space_id_or_url>` to any `list`/`get` command to query a remote HF Space instead of local data. Use `--hf-token` for private Spaces.
58
+
**Remote Spaces**: Add `--space <space_id_or_url>` to any `list`/`get`/`query` command to query a remote HF Space instead of local data. Use `--hf-token` for private Spaces.
57
59
58
60
→ See [retrieving_metrics.md](retrieving_metrics.md) for all commands, workflows, and JSON output formats.
61
+
→ See [storage_schema.md](storage_schema.md) for SQLite tables, parquet layout, and direct query examples.
59
62
60
63
## Minimal Logging Setup
61
64
@@ -73,6 +76,7 @@ trackio.finish()
73
76
```bash
74
77
trackio list projects --json
75
78
trackio get metric --project my-project --run my-run --metric loss --json
79
+
trackio query project --project my-project --sql "SELECT name FROM sqlite_master WHERE type = 'table'" --json
76
80
77
81
# Query a remote Space
78
82
trackio list projects --space username/my-space --json
Use this reference when you need to inspect Trackio data directly instead of going through higher-level `trackio list` or `trackio get` commands.
4
+
5
+
## Where Data Is Stored
6
+
7
+
- Local project databases live in `TRACKIO_DIR`, which defaults to `~/.cache/huggingface/trackio`.
8
+
- Each project is stored in its own SQLite file: `{project}.db`.
9
+
- Media files live under `TRACKIO_DIR/media/`.
10
+
- Parquet files are derived exports written from SQLite for syncing and static Spaces.
11
+
12
+
## SQLite Tables
13
+
14
+
Trackio defines its live schema in `trackio/sqlite_storage.py` inside `SQLiteStorage.init_db()`.
15
+
16
+
### `metrics`
17
+
18
+
-`id`: integer primary key
19
+
-`timestamp`: ISO timestamp
20
+
-`run_name`: run identifier
21
+
-`step`: integer step
22
+
-`metrics`: JSON text payload
23
+
-`log_id`: optional deduplication key
24
+
-`space_id`: optional pending-sync marker
25
+
26
+
Indexes:
27
+
28
+
-`(run_name, step)`
29
+
-`(run_name, timestamp)`
30
+
- unique partial index on `log_id`
31
+
- partial index on `space_id`
32
+
33
+
### `configs`
34
+
35
+
-`id`: integer primary key
36
+
-`run_name`: run identifier
37
+
-`config`: JSON text payload
38
+
-`created_at`: ISO timestamp
39
+
40
+
Constraints:
41
+
42
+
- unique `run_name`
43
+
- index on `run_name`
44
+
45
+
### `system_metrics`
46
+
47
+
-`id`: integer primary key
48
+
-`timestamp`: ISO timestamp
49
+
-`run_name`: run identifier
50
+
-`metrics`: JSON text payload
51
+
-`log_id`: optional deduplication key
52
+
-`space_id`: optional pending-sync marker
53
+
54
+
Indexes:
55
+
56
+
-`(run_name, timestamp)`
57
+
- unique partial index on `log_id`
58
+
- partial index on `space_id`
59
+
60
+
### `project_metadata`
61
+
62
+
-`key`: primary key
63
+
-`value`: metadata value
64
+
65
+
### `pending_uploads`
66
+
67
+
-`id`
68
+
-`space_id`
69
+
-`run_name`
70
+
-`step`
71
+
-`file_path`
72
+
-`relative_path`
73
+
-`created_at`
74
+
75
+
### `alerts`
76
+
77
+
-`id`
78
+
-`timestamp`
79
+
-`run_name`
80
+
-`title`
81
+
-`text`
82
+
-`level`
83
+
-`step`
84
+
-`alert_id`
85
+
86
+
Indexes:
87
+
88
+
-`run_name`
89
+
-`timestamp`
90
+
- unique partial index on `alert_id`
91
+
92
+
## Parquet Layout
93
+
94
+
Trackio flattens JSON blobs when exporting parquet:
95
+
96
+
-`{project}.parquet` comes from `metrics`
97
+
-`{project}_system.parquet` comes from `system_metrics`
98
+
-`{project}_configs.parquet` comes from `configs`
99
+
100
+
Static export layout:
101
+
102
+
-`metrics.parquet`
103
+
-`aux/system_metrics.parquet`
104
+
-`aux/configs.parquet`
105
+
-`runs.json`
106
+
-`settings.json`
107
+
108
+
The flattened parquet files keep structural columns such as `timestamp`, `run_name`, and `step`, then add one column per JSON key found in the source payload.
109
+
110
+
## Direct SQL With The CLI
111
+
112
+
Use `trackio query` for read-only SQL:
113
+
114
+
```bash
115
+
trackio query project --project my-project --sql "SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name" --json
Copy file name to clipboardExpand all lines: README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,8 @@ Trackio's main features:
39
39
- Persists logs in a Sqlite database locally (or, if you provide a `space_id`, in a private Hugging Face Dataset)
40
40
- Visualize experiments with a **Svelte 5** dashboard locally (or, if you provide a `space_id`, on Hugging Face Spaces)
41
41
-**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.
42
+
- Use `trackio query project --project <name> --sql "SELECT ..."` for read-only SQL when `trackio list` and `trackio get` are not enough
43
+
- See the storage schema and direct query reference at https://huggingface.co/docs/trackio/storage_schema
42
44
43
45
-**Free**: Everything here, including hosting on Hugging Face, is free!
44
46
@@ -266,6 +268,8 @@ These numbers were measured against a free-tier Hugging Face Space (2 vCPU / 16
266
268
267
269
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`).
268
270
271
+
The current SQLite and parquet layout is documented in the [Storage Schema and Direct Queries](https://huggingface.co/docs/trackio/storage_schema) guide, including examples for `trackio query`.
272
+
269
273
Since Trackio is in beta, your feedback is welcome! Please create issues with bug reports or feature requests.
0 commit comments