Skip to content

Commit 17d3917

Browse files
authored
Merge branch 'main' into saba/auto-ml
2 parents 34791b4 + e3642f6 commit 17d3917

85 files changed

Lines changed: 7120 additions & 731 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ jobs:
4646
4747
- name: Install system dependencies (Windows)
4848
if: matrix.os == 'windows-latest'
49-
run: |
50-
# FFmpeg installation for Windows (using chocolatey)
51-
choco install ffmpeg -y
49+
uses: AnimMouse/setup-ffmpeg@27e66fd2fe1d643b73a7c5cb105f3b4116bfb8db # v1.2.1
50+
51+
- name: Verify ffmpeg
52+
run: ffmpeg -version
5253

5354
- name: Install Python dependencies
5455
run: |

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# trackio
22

3+
## 0.25.1
4+
5+
### Features
6+
7+
- [#535](https://github.com/gradio-app/trackio/pull/535) [`d7f1b27`](https://github.com/gradio-app/trackio/commit/d7f1b27a98f185d2d97ef54975d5865e0b5243c9) - Avoid HF token leaks in static snapshots. Thanks @abidlabs!
8+
9+
## 0.25.0
10+
11+
### Features
12+
13+
- [#533](https://github.com/gradio-app/trackio/pull/533) [`08bc5eb`](https://github.com/gradio-app/trackio/commit/08bc5eb090525d3ff5f7fa4233c30c42162aa74c) - Fix Windows-only emoji mojibake when uploading Space README. Thanks @tomaarsen!
14+
- [#518](https://github.com/gradio-app/trackio/pull/518) [`e7ed176`](https://github.com/gradio-app/trackio/commit/e7ed176da53d8b49290fddd890b3d18c0b9b958f) - Traces in Trackio. Thanks @abidlabs!
15+
- [#531](https://github.com/gradio-app/trackio/pull/531) [`27a50a3`](https://github.com/gradio-app/trackio/commit/27a50a37362020304b774344b4c774ff548985b6) - Add configurable custom frontends for Trackio. Thanks @abidlabs!
16+
17+
## 0.24.2
18+
19+
### Features
20+
21+
- [#527](https://github.com/gradio-app/trackio/pull/527) [`7d1c0b9`](https://github.com/gradio-app/trackio/commit/7d1c0b9c37ce9a9845e6bbe6c083da9d36084caf) - Fix dashboard UX issues: smoothing in share URL, run selection, and run filtering. Thanks @abidlabs!
22+
- [#526](https://github.com/gradio-app/trackio/pull/526) [`643878a`](https://github.com/gradio-app/trackio/commit/643878a82985fab9e6675f769ff0107cb46e042a) - Add emoji to README and deploy README content. Thanks @qgallouedec!
23+
- [#529](https://github.com/gradio-app/trackio/pull/529) [`a77972b`](https://github.com/gradio-app/trackio/commit/a77972b68541ebe9e056824e69c9bbca3979ece4) - Remove pydub dependency. Thanks @abidlabs!
24+
25+
## 0.24.1
26+
27+
### Features
28+
29+
- [#524](https://github.com/gradio-app/trackio/pull/524) [`65a6897`](https://github.com/gradio-app/trackio/commit/65a6897561b465fc8f05550562f8da1ba3c99060) - Fix `trackio skills add`. Thanks @abidlabs!
30+
- [#522](https://github.com/gradio-app/trackio/pull/522) [`05aaca7`](https://github.com/gradio-app/trackio/commit/05aaca7f166bf7667b60b40656d677532a4bdd6e) - relax `starlette` dependency and fix import style. Thanks @abidlabs!
31+
- [#525](https://github.com/gradio-app/trackio/pull/525) [`32c05c5`](https://github.com/gradio-app/trackio/commit/32c05c5d5e3aa84ca7099a6fa08a9093ccd4b95f) - Restore sidebar share and embed snippets, and fix query parameter regression. Thanks @abidlabs!
32+
333
## 0.24.0
434

535
### Features

README.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,32 @@ import trackio
146146
trackio.show(project="my-project")
147147
```
148148

149+
You can also point Trackio at a custom static frontend directory:
150+
151+
```bash
152+
trackio show --frontend ./my-trackio-frontend
153+
```
154+
155+
```py
156+
import trackio
157+
158+
trackio.show(frontend_dir="./my-trackio-frontend")
159+
```
160+
161+
The directory only needs an `index.html` file. Trackio keeps serving the same backend API under `/api/*`, so you can replace the UI without forking the backend. If the directory is missing or invalid, Trackio falls back to a minimal starter template.
162+
163+
To make a custom frontend apply everywhere by default:
164+
165+
```bash
166+
trackio config set frontend ./my-trackio-frontend
167+
```
168+
169+
Reset it with:
170+
171+
```bash
172+
trackio config unset frontend
173+
```
174+
149175
## Deploying to Hugging Face Spaces
150176

151177
When calling `trackio.init()`, by default the service will run locally and store project data on the local machine.
@@ -183,10 +209,16 @@ If you've been tracking experiments locally and want to move them to Hugging Fac
183209
```py
184210
import trackio
185211

186-
trackio.sync(project="my-project", space_id="username/space_id")
212+
trackio.sync(
213+
project="my-project",
214+
space_id="username/space_id",
215+
frontend_dir="./my-trackio-frontend",
216+
)
187217
```
188218

189-
This uploads your local project database to a new or existing Space. The Space will display all your logged experiments and metrics.
219+
This uploads your local project database to a new or existing Space. The Space will display all your logged experiments and metrics, and if a custom frontend is configured or passed explicitly it will be deployed there too.
220+
221+
Static Trackio Spaces (`sdk="static"`) are read-only browser-only snapshots, so their snapshot data must be public. Use the default Gradio Space for private dashboards; `sdk="static"` does not support `private=True`.
190222

191223
**Example workflow:**
192224

@@ -199,7 +231,11 @@ trackio.log({"loss": 0.5})
199231
trackio.finish()
200232

201233
# Later, sync to Spaces
202-
trackio.sync(project="my-project", space_id="username/my-experiments")
234+
trackio.sync(
235+
project="my-project",
236+
space_id="username/my-experiments",
237+
frontend_dir="./my-trackio-frontend",
238+
)
203239
```
204240

205241
## Embedding a Trackio Dashboard

docs/source/_toctree.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@
3636
title: How-to guides
3737
- sections:
3838
- local: transformers_integration
39-
title: Transformers Trainer
39+
title: Running with Transformers
40+
- local: trl_integration
41+
title: Running with TRL
4042
- local: rapidfireai_integration
41-
title: RapidFire AI
43+
title: Running with RapidFire AI
4244
title: Integration
4345
- sections:
4446
- local: api

docs/source/cli_commands.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Deploy as a static Space (reads from an HF Bucket, no server needed):
3939
trackio sync --project "my-project" --space-id "username/space_id" --sdk static
4040
```
4141

42+
Static Spaces serve data directly from the browser and therefore require public snapshot data. `--sdk static --private` is not supported; use the default Gradio SDK for private dashboards.
43+
4244
Sync all projects that have unsynced data to their configured Spaces:
4345

4446
```sh
@@ -51,7 +53,7 @@ trackio sync --all
5153
| `--space-id` | The HF Space ID to sync to (e.g. `username/space_id`). If not provided, uses the previously-configured Space |
5254
| `--all` | Sync all projects with unsynced data |
5355
| `--sdk` | `gradio` (default) for a live server, or `static` for a read-only bucket-backed Space |
54-
| `--private` | Make the Space private if creating a new one |
56+
| `--private` | Make the Space private if creating a new Gradio Space. Not supported with `--sdk static` |
5557
| `--force` | Overwrite the existing database without prompting |
5658

5759
## Freeze Command
@@ -73,10 +75,11 @@ trackio freeze --space-id "username/my-space" --project "my-project" --new-space
7375
| `--space-id` | The source Gradio Space ID (required) |
7476
| `--project` | The project to freeze (required) |
7577
| `--new-space-id` | The destination static Space ID. Defaults to `{space_id}_static` |
76-
| `--private` | Make the new static Space private |
78+
| `--private` | Not supported for static frozen snapshots |
7779

7880
> **Note:** The source must be a Gradio Space with a bucket mounted at `/data`. If the destination Space already exists and is not a Trackio static Space, `freeze` will refuse to overwrite it.
7981
> The frozen Space is a snapshot. Later metrics synced to the original Gradio Space do not appear in the frozen static Space unless you run `freeze` again.
82+
> Static frozen snapshots require public destination data, so `trackio freeze --private` is not supported.
8083
8184
## List Commands
8285

docs/source/deploy_embed.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ trackio.sync(project="my-project", space_id="username/space_id", sdk="static")
4242
trackio sync --project "my-project" --space-id "username/space_id" --sdk static
4343
```
4444

45-
Static Spaces are lightweight and free — they serve a read-only dashboard backed by Parquet files in an HF Bucket.
45+
Static Spaces are lightweight and free — they serve a read-only dashboard backed by Parquet files in an HF Bucket. Because the dashboard runs entirely in the browser, static Trackio Spaces require public snapshot data and do not support `private=True`. Use the default Gradio Space (`sdk="gradio"`) for private dashboards.
4646

4747
## Freezing a Space Snapshot
4848

@@ -61,6 +61,7 @@ trackio freeze --space-id "username/my-space" --project "my-project"
6161
This creates a new static Space (by default named `{space_id}_static`) containing a snapshot of the project's data from the source Space's bucket. The original Space is not modified.
6262

6363
Note that`freeze()` is a one-time snapshot. If new metrics are later uploaded to the original Gradio Space, the frozen static Space will not update automatically.
64+
The source Gradio Space can use a private bucket, but the frozen static snapshot is public data. `freeze(private=True)` is not supported; use a Gradio Space if the frozen dashboard must stay private.
6465

6566
You can customize the destination:
6667

@@ -69,7 +70,6 @@ trackio.freeze(
6970
space_id="username/my-space",
7071
project="my-project",
7172
new_space_id="username/my-snapshot",
72-
private=True,
7373
)
7474
```
7575

docs/source/environment_variables.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ export TRACKIO_WRITE_TOKEN="YOUR_TOKEN"
3131

3232
The dashboard **write token** for a self-hosted Trackio server (same value as the `write_token` query parameter in the write-access URL). Use this when `TRACKIO_SERVER_URL` or `server_url` is a base URL without query parameters. The client sends this token on each request (for example as the `X-Trackio-Write-Token` header) so metric ingestion and uploads are authenticated when not running on Hugging Face Spaces.
3333

34+
### `TRACKIO_FRONTEND_DIR`
35+
36+
Path to a custom static frontend directory for Trackio. The directory must contain `index.html`.
37+
38+
When set, Trackio uses that frontend for `trackio.show()` and for deploy flows such as `trackio.sync()` and `trackio.freeze()`, unless an explicit `frontend_dir` / `--frontend` argument is passed.
39+
40+
```bash
41+
export TRACKIO_FRONTEND_DIR="/path/to/my-trackio-frontend"
42+
```
43+
44+
If the configured directory is invalid, Trackio ignores it and falls back to the built-in frontend selection logic. The automatic starter-template copy behavior only applies when an explicit `frontend_dir` / `--frontend` argument points to a missing or empty directory.
45+
3446
### `TRACKIO_LOGO_LIGHT_URL` and `TRACKIO_LOGO_DARK_URL`
3547

3648
Customize the logos displayed in the Trackio dashboard for light and dark themes. You can provide URLs to custom logos. Note that both environment variables should be supplied; otherwise, the Trackio default will be used for any variable that is not provided.
@@ -164,5 +176,3 @@ export GRADIO_MCP_SERVER="True"
164176
165177
166178
See [this more comprehensive list](https://www.gradio.app/guides/environment-variables) of environment variables used by Gradio.
167-
168-

docs/source/launch.md

Lines changed: 61 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,56 @@ trackio.show(project="my-project")
4646
</hfoption>
4747
</hfoptions>
4848

49-
## Changing the Theme
50-
51-
You can change the theme of the dashboard by providing an optional `theme` argument.
49+
## Using a Custom Frontend
50+
51+
You can replace the bundled dashboard with your own static frontend directory. The directory only needs an `index.html` file; your frontend can call the existing Trackio API under `/api/*`.
52+
53+
The intended workflow is:
54+
55+
1. Run `trackio show --frontend ./my-trackio-frontend`.
56+
2. Ask your LLM to edit the files in that directory.
57+
3. Keep the browser open while Trackio live reloads the frontend as those files change.
58+
59+
If the directory passed to `--frontend` does not exist, or exists but is empty, Trackio copies in the starter frontend automatically, prints that it did so, and then serves that directory. The starter is a complete plain-HTML/CSS/JS template: it calls the Trackio API, loads projects and runs, fetches metric values, and draws simple charts that you can replace with your own UI.
60+
61+
The currently available HTTP endpoints are:
62+
63+
- `POST /api/get_run_mutation_status`
64+
- `POST /api/upload_db_to_space`
65+
- `POST /api/bulk_upload_media`
66+
- `POST /api/log`
67+
- `POST /api/bulk_log`
68+
- `POST /api/bulk_log_system`
69+
- `POST /api/bulk_alert`
70+
- `POST /api/get_alerts`
71+
- `POST /api/get_metric_values`
72+
- `POST /api/get_runs_for_project`
73+
- `POST /api/get_metrics_for_run`
74+
- `POST /api/get_all_projects`
75+
- `POST /api/get_project_summary`
76+
- `POST /api/get_run_summary`
77+
- `POST /api/get_system_metrics_for_run`
78+
- `POST /api/get_system_logs`
79+
- `POST /api/get_system_logs_batch`
80+
- `POST /api/get_snapshot`
81+
- `POST /api/get_logs`
82+
- `POST /api/get_logs_batch`
83+
- `POST /api/get_traces`
84+
- `POST /api/query_project`
85+
- `POST /api/get_settings`
86+
- `POST /api/get_project_files`
87+
- `POST /api/delete_run`
88+
- `POST /api/rename_run`
89+
- `POST /api/force_sync`
90+
- `POST /api/upload` for multipart file uploads used by media and file-related flows
91+
92+
For reading stored files returned by the API, Trackio also serves `GET /file?path=...`.
5293

5394
<hfoptions id="language">
5495
<hfoption id="Shell">
5596

5697
```sh
57-
trackio show --theme "soft"
98+
trackio show --frontend ./my-trackio-frontend
5899
```
59100

60101
</hfoption>
@@ -63,13 +104,27 @@ trackio show --theme "soft"
63104
```py
64105
import trackio
65106

66-
trackio.show(theme="soft")
107+
trackio.show(frontend_dir="./my-trackio-frontend")
67108
```
68109

69110
</hfoption>
70111
</hfoptions>
71112

72-
To see the available themes, check out the [themes gallery](https://huggingface.co/spaces/gradio/theme-gallery).
113+
If the provided frontend directory is non-empty but invalid, Trackio falls back to the shipped starter template.
114+
115+
## Setting a Persistent Default Frontend
116+
117+
If you want the same custom frontend to be used by `trackio show`, `trackio sync`, and deploy flows by default, save it in Trackio's persistent config:
118+
119+
```sh
120+
trackio config set frontend ./my-trackio-frontend
121+
```
122+
123+
Reset it with:
124+
125+
```sh
126+
trackio config unset frontend
127+
```
73128

74129
## Customizing Plot Colors
75130

docs/source/trl_integration.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# TRL Integration
2+
3+
Trackio integrates natively with [TRL](https://github.com/huggingface/trl) so you can log metrics from any TRL trainer (`SFTTrainer`, `DPOTrainer`, `GRPOTrainer`, etc.) with minimal setup. Ensure you have the latest version of `trl` installed (version 1.2.0 or higher).
4+
5+
```python
6+
from datasets import Dataset
7+
from trl import SFTConfig, SFTTrainer
8+
9+
# Create a small fake dataset
10+
prompts = ["The capital of France is", "Hamlet was written by"] * 12
11+
completions = [" Paris.", " Shakespeare."] * 12
12+
dataset = Dataset.from_dict({"prompt": prompts, "completion": completions})
13+
14+
# Train a model using the TRL SFTTrainer API
15+
trainer = SFTTrainer(
16+
model="Qwen/Qwen3-0.6B",
17+
args=SFTConfig(report_to="trackio", run_name="Qwen3-0.6B-sft"),
18+
train_dataset=dataset,
19+
)
20+
trainer.train()
21+
```
22+
23+
## Configuring Project and Space
24+
25+
Set the project and space ID directly in your TRL config (e.g. [`~trl.SFTConfig`], [`~trl.DPOConfig`], [`~trl.GRPOConfig`]):
26+
27+
```python
28+
from trl import SFTConfig
29+
30+
args = SFTConfig(
31+
report_to="trackio",
32+
run_name="my-run",
33+
project="my-project",
34+
trackio_space_id="username/space_id",
35+
)
36+
```
37+

examples/crash-and-resume-same-run-name.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,8 @@
2222
import argparse
2323
import math
2424
import uuid
25-
import warnings
2625

27-
warnings.filterwarnings(
28-
"ignore",
29-
category=SyntaxWarning,
30-
module=r"pydub\.utils",
31-
)
32-
33-
import trackio # noqa: E402
26+
import trackio
3427

3528
DEFAULT_PROJECT = f"crash-and-resume-demo-{uuid.uuid4().hex[:8]}"
3629
DEFAULT_RUN_NAME = "trainer-job-42"

0 commit comments

Comments
 (0)