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
Copy file name to clipboardExpand all lines: README.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,9 +35,9 @@ Trackio's main features:
35
35
```
36
36
and keep your existing logging code.
37
37
38
-
-**Local-first** design: dashboard runs locally by default. You can also host it on Spaces by specifying a `space_id`in `trackio.init()`.
39
-
- Persists logs in a Sqlite database locally (or, if you provide a `space_id`, in a private Hugging Face Dataset)
40
-
- Visualize experiments with a **Svelte 5** dashboard locally (or, if you provide a `space_id`, on Hugging Face Spaces)
38
+
-**Local-first** design: dashboard runs locally by default. You can also send metrics to a Hugging Face Space with `space_id`for free or to a self-hosted Trackio server you run yourself with `server_url`
39
+
- Persists logs in a Sqlite database locally (or on the remote target you chose: Space, or the machine hosting your self-hosted server)
40
+
- Visualize experiments with a **Svelte 5** dashboard locally, on Hugging Face Spaces, or on your own host when you self-host the server
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
42
- Use `trackio query project --project <name> --sql "SELECT ..."` for read-only SQL when `trackio list` and `trackio get` are not enough
43
43
- See the storage schema and direct query reference at https://huggingface.co/docs/trackio/storage_schema
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.
157
157
158
+
## Self-hosted Trackio server
159
+
160
+
You can run the Trackio dashboard and API on your own machine or infrastructure and point training jobs at it over HTTP. Pass the write-access URL from `trackio.show()` (which may include `write_token` in the query), or a base URL plus the `TRACKIO_WRITE_TOKEN` environment variable. The client sends that token on requests; it is not your Hugging Face token.
You can also set `TRACKIO_SERVER_URL` (and optionally `TRACKIO_WRITE_TOKEN` if the URL has no query string). If `space_id` / `TRACKIO_SPACE_ID` and `server_url` / `TRACKIO_SERVER_URL` are both set, Trackio uses the Hugging Face Space and ignores the self-hosted URL.
167
+
168
+
See the documentation: [Self-host the Server](https://huggingface.co/docs/trackio/self_hosted_server).
169
+
158
170
## Syncing Offline Projects to Spaces
159
171
160
172
If you've been tracking experiments locally and want to move them to Hugging Face Spaces for sharing or collaboration, use the `sync` function:
Note: This environment variable applies as long as Trackio is not running in a Space with persistent storage enabled. If Trackio is running in a Space with persistent storage enabled (which is detected with the `PERSISTANT_STORAGE_ENABLED` env variable), then the Trackio data will be stored in `/data/trackio`.
16
16
17
+
### `TRACKIO_SERVER_URL`
18
+
19
+
Base URL of a self-hosted Trackio server (`http://` or `https://`). You may include `write_token` in the query string (as in the `full_url` from `trackio.show()`), or keep the URL bare and set `TRACKIO_WRITE_TOKEN` instead. When set, `trackio.init()` sends metrics to that server. Equivalent to passing `server_url=` to `trackio.init()`.
20
+
21
+
**Precedence:** If `TRACKIO_SPACE_ID` is also set (or `space_id` is passed in code), the Hugging Face Space is used and `TRACKIO_SERVER_URL` is ignored. Same rule when both `space_id` and `server_url` are passed: `space_id` wins.
22
+
23
+
See [Self-host the Server](self_hosted_server.md).
24
+
25
+
```bash
26
+
export TRACKIO_SERVER_URL="http://127.0.0.1:7860"
27
+
export TRACKIO_WRITE_TOKEN="YOUR_TOKEN"
28
+
```
29
+
30
+
### `TRACKIO_WRITE_TOKEN`
31
+
32
+
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.
33
+
17
34
### `TRACKIO_LOGO_LIGHT_URL` and `TRACKIO_LOGO_DARK_URL`
18
35
19
36
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.
Copy file name to clipboardExpand all lines: docs/source/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,9 @@
14
14
import trackio as wandb
15
15
```
16
16
17
-
-**Local-first** design: dashboard runs locally by default. You can also host it on Spaces by specifying a `space_id`.
18
-
- Persists logs locally (or in a private Hugging Face Dataset)
19
-
- Visualize experiments with a Gradio dashboard locally (or on Hugging Face Spaces)
17
+
-**Local-first** design: dashboard runs locally by default. You can also log to a Hugging Face Space (`space_id`) for free or to a **self-hosted** Trackio server (`server_url`)
18
+
- Persists logs locally, in a Hugging Face Dataset when using Spaces, or on the machine hosting your self-hosted server
19
+
- Visualize experiments with a Gradio dashboard locally, on Hugging Face Spaces, or on your own host when self-hosting
20
20
-**LLM-friendly**: Designed for autonomous ML experiments with CLI commands and Python APIs that enable LLMs to easily log and query experiment data.
21
21
- Everything here, including hosting on Hugging Face, is **free**!
You can run the Trackio dashboard and API on your own machine (or any host you control) and send metrics from training scripts to that server over HTTP. This is an alternative to logging to a Hugging Face Space via `space_id`.
4
+
5
+
## Run the server locally
6
+
7
+
Install Trackio, then start the dashboard. By default it listens on `127.0.0.1` and uses the port from `GRADIO_SERVER_PORT` if set, otherwise **7860** (see [Launch the Dashboard](launch.md)).
8
+
9
+
<hfoptionsid="language">
10
+
<hfoptionid="Shell">
11
+
12
+
```sh
13
+
trackio show
14
+
```
15
+
16
+
</hfoption>
17
+
<hfoptionid="Python">
18
+
19
+
```py
20
+
import trackio
21
+
22
+
trackio.show()
23
+
```
24
+
25
+
</hfoption>
26
+
</hfoptions>
27
+
28
+
Leave that process running while you train. The terminal prints a base URL for the UI and a URL that includes a **write token**; anyone who can reach that URL with the token can perform write operations supported by the server (for example renaming runs), so treat it like a secret on untrusted networks.
29
+
30
+
## Listen on all interfaces
31
+
32
+
To access the dashboard from another machine on your network (or from containers), bind to all interfaces:
33
+
34
+
<hfoptionsid="language">
35
+
<hfoptionid="Shell">
36
+
37
+
```sh
38
+
trackio show --host 0.0.0.0
39
+
```
40
+
41
+
</hfoption>
42
+
<hfoptionid="Python">
43
+
44
+
```py
45
+
import trackio
46
+
47
+
trackio.show(host="0.0.0.0")
48
+
```
49
+
50
+
</hfoption>
51
+
</hfoptions>
52
+
53
+
Ensure your firewall and security policies allow the traffic you intend.
54
+
55
+
## Point training code at your server
56
+
57
+
In your training script, pass a `server_url` and supply the **write token**: either embed `write_token` in the query string (the same URL the dashboard prints for write access, or the `full_url` return value from `trackio.show()`), or pass a base URL like `http://127.0.0.1:7860/` and set the `TRACKIO_WRITE_TOKEN` environment variable to that token. Metric ingestion and uploads require this token when the server is not on Hugging Face Spaces. You can also set `TRACKIO_SERVER_URL` instead of passing `server_url` in code.
Precedence: **`space_id` / `TRACKIO_SPACE_ID` always wins** over `server_url` / `TRACKIO_SERVER_URL` when both are set (in code or in the environment). Trackio then behaves as if only the Space were configured.
71
+
72
+
Hugging Face–specific options such as `dataset_id` and `bucket_id` apply only when logging to a Space. When only `server_url` is in effect, configure persistence on the machine where the server runs (for example via `TRACKIO_DIR` on that host). See [Environment Variables](environment_variables.md).
73
+
74
+
## Related
75
+
76
+
-[Launch the Dashboard](launch.md) — CLI options, port, and remote access
77
+
-[Environment Variables](environment_variables.md) — `TRACKIO_SERVER_URL`, `TRACKIO_DIR`, and others
Runs with the same group name can be grouped together in sidebar, making it easier to compare related experiments. You can also group runs by any other configuration parameter (see [Tracking Configuration](#tracking-configuration) below).
46
46
47
+
### Remote logging (Hugging Face Space or self-hosted server)
48
+
49
+
By default, metrics are stored locally and you open the dashboard on your machine. You can instead send metrics to:
50
+
51
+
- A **Hugging Face Space**, by passing `space_id` (or setting `TRACKIO_SPACE_ID`). Trackio can create or reuse the Space and sync data there.
52
+
- A **self-hosted Trackio server** (HTTP or HTTPS), by passing `server_url` (or setting `TRACKIO_SERVER_URL`). Use the write-access URL from `trackio.show()` (optionally with `write_token` in the query), or a base URL plus `TRACKIO_WRITE_TOKEN`. The client authenticates with the same **write token** the dashboard uses (not your Hugging Face token).
53
+
54
+
If both a Space and a self-hosted URL are configured (`space_id` / `TRACKIO_SPACE_ID` together with `server_url` / `TRACKIO_SERVER_URL`), **the Space takes precedence** and the self-hosted URL is ignored. Options such as `dataset_id` and `bucket_id` apply to Hugging Face deployments; when only `server_url` is in effect, configure storage on the host that runs the server (see [Environment Variables](environment_variables.md)).
55
+
56
+
For setup steps (running `trackio show`, binding to `0.0.0.0`, write tokens), see [Self-host the Server](self_hosted_server.md).
57
+
47
58
## Logging Data
48
59
49
60
Once your run is initialized, you can start logging data using the [`log`] function:
0 commit comments