opencode-skills-antigravity 1.0.39 → 1.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +10 -1
  2. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  3. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  4. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  5. package/bundled-skills/docs/maintainers/security-findings-triage-2026-03-29-refresh.csv +34 -0
  6. package/bundled-skills/docs/maintainers/security-findings-triage-2026-03-29-refresh.md +2 -0
  7. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  8. package/bundled-skills/docs/sources/sources.md +2 -2
  9. package/bundled-skills/docs/users/bundles.md +1 -1
  10. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  11. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  12. package/bundled-skills/docs/users/getting-started.md +1 -1
  13. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  14. package/bundled-skills/docs/users/usage.md +4 -4
  15. package/bundled-skills/docs/users/visual-guide.md +4 -4
  16. package/bundled-skills/hugging-face-cli/SKILL.md +192 -195
  17. package/bundled-skills/hugging-face-community-evals/SKILL.md +213 -0
  18. package/bundled-skills/hugging-face-community-evals/examples/.env.example +3 -0
  19. package/bundled-skills/hugging-face-community-evals/examples/USAGE_EXAMPLES.md +101 -0
  20. package/bundled-skills/hugging-face-community-evals/scripts/inspect_eval_uv.py +104 -0
  21. package/bundled-skills/hugging-face-community-evals/scripts/inspect_vllm_uv.py +306 -0
  22. package/bundled-skills/hugging-face-community-evals/scripts/lighteval_vllm_uv.py +297 -0
  23. package/bundled-skills/hugging-face-dataset-viewer/SKILL.md +120 -120
  24. package/bundled-skills/hugging-face-gradio/SKILL.md +304 -0
  25. package/bundled-skills/hugging-face-gradio/examples.md +613 -0
  26. package/bundled-skills/hugging-face-jobs/SKILL.md +25 -18
  27. package/bundled-skills/hugging-face-jobs/index.html +216 -0
  28. package/bundled-skills/hugging-face-jobs/references/hardware_guide.md +336 -0
  29. package/bundled-skills/hugging-face-jobs/references/hub_saving.md +352 -0
  30. package/bundled-skills/hugging-face-jobs/references/token_usage.md +570 -0
  31. package/bundled-skills/hugging-face-jobs/references/troubleshooting.md +475 -0
  32. package/bundled-skills/hugging-face-jobs/scripts/cot-self-instruct.py +718 -0
  33. package/bundled-skills/hugging-face-jobs/scripts/finepdfs-stats.py +546 -0
  34. package/bundled-skills/hugging-face-jobs/scripts/generate-responses.py +587 -0
  35. package/bundled-skills/hugging-face-model-trainer/SKILL.md +11 -12
  36. package/bundled-skills/hugging-face-model-trainer/references/gguf_conversion.md +296 -0
  37. package/bundled-skills/hugging-face-model-trainer/references/hardware_guide.md +283 -0
  38. package/bundled-skills/hugging-face-model-trainer/references/hub_saving.md +364 -0
  39. package/bundled-skills/hugging-face-model-trainer/references/local_training_macos.md +231 -0
  40. package/bundled-skills/hugging-face-model-trainer/references/reliability_principles.md +371 -0
  41. package/bundled-skills/hugging-face-model-trainer/references/trackio_guide.md +189 -0
  42. package/bundled-skills/hugging-face-model-trainer/references/training_methods.md +150 -0
  43. package/bundled-skills/hugging-face-model-trainer/references/training_patterns.md +203 -0
  44. package/bundled-skills/hugging-face-model-trainer/references/troubleshooting.md +282 -0
  45. package/bundled-skills/hugging-face-model-trainer/references/unsloth.md +313 -0
  46. package/bundled-skills/hugging-face-model-trainer/scripts/convert_to_gguf.py +424 -0
  47. package/bundled-skills/hugging-face-model-trainer/scripts/dataset_inspector.py +417 -0
  48. package/bundled-skills/hugging-face-model-trainer/scripts/estimate_cost.py +150 -0
  49. package/bundled-skills/hugging-face-model-trainer/scripts/train_dpo_example.py +106 -0
  50. package/bundled-skills/hugging-face-model-trainer/scripts/train_grpo_example.py +89 -0
  51. package/bundled-skills/hugging-face-model-trainer/scripts/train_sft_example.py +122 -0
  52. package/bundled-skills/hugging-face-model-trainer/scripts/unsloth_sft_example.py +512 -0
  53. package/bundled-skills/hugging-face-paper-publisher/SKILL.md +11 -4
  54. package/bundled-skills/hugging-face-paper-publisher/examples/example_usage.md +326 -0
  55. package/bundled-skills/hugging-face-paper-publisher/references/quick_reference.md +216 -0
  56. package/bundled-skills/hugging-face-paper-publisher/scripts/paper_manager.py +606 -0
  57. package/bundled-skills/hugging-face-paper-publisher/templates/arxiv.md +299 -0
  58. package/bundled-skills/hugging-face-paper-publisher/templates/ml-report.md +358 -0
  59. package/bundled-skills/hugging-face-paper-publisher/templates/modern.md +319 -0
  60. package/bundled-skills/hugging-face-paper-publisher/templates/standard.md +201 -0
  61. package/bundled-skills/hugging-face-papers/SKILL.md +241 -0
  62. package/bundled-skills/hugging-face-trackio/.claude-plugin/plugin.json +19 -0
  63. package/bundled-skills/hugging-face-trackio/SKILL.md +117 -0
  64. package/bundled-skills/hugging-face-trackio/references/alerts.md +196 -0
  65. package/bundled-skills/hugging-face-trackio/references/logging_metrics.md +206 -0
  66. package/bundled-skills/hugging-face-trackio/references/retrieving_metrics.md +251 -0
  67. package/bundled-skills/hugging-face-vision-trainer/SKILL.md +595 -0
  68. package/bundled-skills/hugging-face-vision-trainer/references/finetune_sam2_trainer.md +254 -0
  69. package/bundled-skills/hugging-face-vision-trainer/references/hub_saving.md +618 -0
  70. package/bundled-skills/hugging-face-vision-trainer/references/image_classification_training_notebook.md +279 -0
  71. package/bundled-skills/hugging-face-vision-trainer/references/object_detection_training_notebook.md +700 -0
  72. package/bundled-skills/hugging-face-vision-trainer/references/reliability_principles.md +310 -0
  73. package/bundled-skills/hugging-face-vision-trainer/references/timm_trainer.md +91 -0
  74. package/bundled-skills/hugging-face-vision-trainer/scripts/dataset_inspector.py +814 -0
  75. package/bundled-skills/hugging-face-vision-trainer/scripts/estimate_cost.py +217 -0
  76. package/bundled-skills/hugging-face-vision-trainer/scripts/image_classification_training.py +383 -0
  77. package/bundled-skills/hugging-face-vision-trainer/scripts/object_detection_training.py +710 -0
  78. package/bundled-skills/hugging-face-vision-trainer/scripts/sam_segmentation_training.py +382 -0
  79. package/bundled-skills/jq/SKILL.md +273 -0
  80. package/bundled-skills/odoo-edi-connector/SKILL.md +32 -10
  81. package/bundled-skills/odoo-woocommerce-bridge/SKILL.md +9 -5
  82. package/bundled-skills/tmux/SKILL.md +370 -0
  83. package/bundled-skills/transformers-js/SKILL.md +639 -0
  84. package/bundled-skills/transformers-js/references/CACHE.md +339 -0
  85. package/bundled-skills/transformers-js/references/CONFIGURATION.md +390 -0
  86. package/bundled-skills/transformers-js/references/EXAMPLES.md +605 -0
  87. package/bundled-skills/transformers-js/references/MODEL_ARCHITECTURES.md +167 -0
  88. package/bundled-skills/transformers-js/references/PIPELINE_OPTIONS.md +545 -0
  89. package/bundled-skills/transformers-js/references/TEXT_GENERATION.md +315 -0
  90. package/bundled-skills/viboscope/SKILL.md +64 -0
  91. package/package.json +1 -1
@@ -0,0 +1,241 @@
1
+ ---
2
+ source: "https://github.com/huggingface/skills/tree/main/skills/huggingface-papers"
3
+ name: hugging-face-papers
4
+ description: Read and analyze Hugging Face paper pages or arXiv papers with markdown and papers API metadata.
5
+ risk: unknown
6
+ ---
7
+
8
+ # Hugging Face Paper Pages
9
+
10
+ Hugging Face Paper pages (hf.co/papers) is a platform built on top of arXiv (arxiv.org), specifically for research papers in the field of artificial intelligence (AI) and computer science. Hugging Face users can submit their paper at hf.co/papers/submit, which features it on the Daily Papers feed (hf.co/papers). Each day, users can upvote papers and comment on papers. Each paper page allows authors to:
11
+ - claim their paper (by clicking their name on the `authors` field). This makes the paper page appear on their Hugging Face profile.
12
+ - link the associated model checkpoints, datasets and Spaces by including the HF paper or arXiv URL in the model card, dataset card or README of the Space
13
+ - link the Github repository and/or project page URLs
14
+ - link the HF organization. This also makes the paper page appear on the Hugging Face organization page.
15
+
16
+ Whenever someone mentions a HF paper or arXiv abstract/PDF URL in a model card, dataset card or README of a Space repository, the paper will be automatically indexed. Note that not all papers indexed on Hugging Face are also submitted to daily papers. The latter is more a manner of promoting a research paper. Papers can only be submitted to daily papers up until 14 days after their publication date on arXiv.
17
+
18
+ The Hugging Face team has built an easy-to-use API to interact with paper pages. Content of the papers can be fetched as markdown, or structured metadata can be returned such as author names, linked models/datasets/spaces, linked Github repo and project page.
19
+
20
+ ## When to Use
21
+
22
+ - User shares a Hugging Face paper page URL (e.g. `https://huggingface.co/papers/2602.08025`)
23
+ - User shares a Hugging Face markdown paper page URL (e.g. `https://huggingface.co/papers/2602.08025.md`)
24
+ - User shares an arXiv URL (e.g. `https://arxiv.org/abs/2602.08025` or `https://arxiv.org/pdf/2602.08025`)
25
+ - User mentions a arXiv ID (e.g. `2602.08025`)
26
+ - User asks you to summarize, explain, or analyze an AI research paper
27
+
28
+ ## Parsing the paper ID
29
+
30
+ It's recommended to parse the paper ID (arXiv ID) from whatever the user provides:
31
+
32
+ | Input | Paper ID |
33
+ | --- | --- |
34
+ | `https://huggingface.co/papers/2602.08025` | `2602.08025` |
35
+ | `https://huggingface.co/papers/2602.08025.md` | `2602.08025` |
36
+ | `https://arxiv.org/abs/2602.08025` | `2602.08025` |
37
+ | `https://arxiv.org/pdf/2602.08025` | `2602.08025` |
38
+ | `2602.08025v1` | `2602.08025v1` |
39
+ | `2602.08025` | `2602.08025` |
40
+
41
+ This allows you to provide the paper ID into any of the hub API endpoints mentioned below.
42
+
43
+ ### Fetch the paper page as markdown
44
+
45
+ The content of a paper can be fetched as markdown like so:
46
+
47
+ ```bash
48
+ curl -s "https://huggingface.co/papers/{PAPER_ID}.md"
49
+ ```
50
+
51
+ This should return the Hugging Face paper page as markdown. This relies on the HTML version of the paper at https://arxiv.org/html/{PAPER_ID}.
52
+
53
+ There are 2 exceptions:
54
+ - Not all arXiv papers have an HTML version. If the HTML version of the paper does not exist, then the content falls back to the HTML of the Hugging Face paper page.
55
+ - If it results in a 404, it means the paper is not yet indexed on hf.co/papers. See [Error handling](#error-handling) for info.
56
+
57
+ Alternatively, you can request markdown from the normal paper page URL, like so:
58
+
59
+ ```bash
60
+ curl -s -H "Accept: text/markdown" "https://huggingface.co/papers/{PAPER_ID}"
61
+ ```
62
+
63
+ ### Paper Pages API Endpoints
64
+
65
+ All endpoints use the base URL `https://huggingface.co`.
66
+
67
+ #### Get structured metadata
68
+
69
+ Fetch the paper metadata as JSON using the Hugging Face REST API:
70
+
71
+ ```bash
72
+ curl -s "https://huggingface.co/api/papers/{PAPER_ID}"
73
+ ```
74
+
75
+ This returns structured metadata that can include:
76
+
77
+ - authors (names and Hugging Face usernames, in case they have claimed the paper)
78
+ - media URLs (uploaded when submitting the paper to Daily Papers)
79
+ - summary (abstract) and AI-generated summary
80
+ - project page and GitHub repository
81
+ - organization and engagement metadata (number of upvotes)
82
+
83
+ To find models linked to the paper, use:
84
+
85
+ ```bash
86
+ curl https://huggingface.co/api/models?filter=arxiv:{PAPER_ID}
87
+ ```
88
+
89
+ To find datasets linked to the paper, use:
90
+
91
+ ```bash
92
+ curl https://huggingface.co/api/datasets?filter=arxiv:{PAPER_ID}
93
+ ```
94
+
95
+ To find spaces linked to the paper, use:
96
+
97
+ ```bash
98
+ curl https://huggingface.co/api/spaces?filter=arxiv:{PAPER_ID}
99
+ ```
100
+
101
+ #### Claim paper authorship
102
+
103
+ Claim authorship of a paper for a Hugging Face user:
104
+
105
+ ```bash
106
+ curl "https://huggingface.co/api/settings/papers/claim" \
107
+ --request POST \
108
+ --header "Content-Type: application/json" \
109
+ --header "Authorization: Bearer $HF_TOKEN" \
110
+ --data '{
111
+ "paperId": "{PAPER_ID}",
112
+ "claimAuthorId": "{AUTHOR_ENTRY_ID}",
113
+ "targetUserId": "{USER_ID}"
114
+ }'
115
+ ```
116
+
117
+ - Endpoint: `POST /api/settings/papers/claim`
118
+ - Body:
119
+ - `paperId` (string, required): arXiv paper identifier being claimed
120
+ - `claimAuthorId` (string): author entry on the paper being claimed, 24-char hex ID
121
+ - `targetUserId` (string): HF user who should receive the claim, 24-char hex ID
122
+ - Response: paper authorship claim result, including the claimed paper ID
123
+
124
+ #### Get daily papers
125
+
126
+ Fetch the Daily Papers feed:
127
+
128
+ ```bash
129
+ curl -s -H "Authorization: Bearer $HF_TOKEN" \
130
+ "https://huggingface.co/api/daily_papers?p=0&limit=20&date=2017-07-21&sort=publishedAt"
131
+ ```
132
+
133
+ - Endpoint: `GET /api/daily_papers`
134
+ - Query parameters:
135
+ - `p` (integer): page number
136
+ - `limit` (integer): number of results, between 1 and 100
137
+ - `date` (string): RFC 3339 full-date, for example `2017-07-21`
138
+ - `week` (string): ISO week, for example `2024-W03`
139
+ - `month` (string): month value, for example `2024-01`
140
+ - `submitter` (string): filter by submitter
141
+ - `sort` (enum): `publishedAt` or `trending`
142
+ - Response: list of daily papers
143
+
144
+ #### List papers
145
+
146
+ List arXiv papers sorted by published date:
147
+
148
+ ```bash
149
+ curl -s -H "Authorization: Bearer $HF_TOKEN" \
150
+ "https://huggingface.co/api/papers?cursor={CURSOR}&limit=20"
151
+ ```
152
+
153
+ - Endpoint: `GET /api/papers`
154
+ - Query parameters:
155
+ - `cursor` (string): pagination cursor
156
+ - `limit` (integer): number of results, between 1 and 100
157
+ - Response: list of papers
158
+
159
+ #### Search papers
160
+
161
+ Perform hybrid semantic and full-text search on papers:
162
+
163
+ ```bash
164
+ curl -s -H "Authorization: Bearer $HF_TOKEN" \
165
+ "https://huggingface.co/api/papers/search?q=vision+language&limit=20"
166
+ ```
167
+
168
+ This searches over the paper title, authors, and content.
169
+
170
+ - Endpoint: `GET /api/papers/search`
171
+ - Query parameters:
172
+ - `q` (string): search query, max length 250
173
+ - `limit` (integer): number of results, between 1 and 120
174
+ - Response: matching papers
175
+
176
+ #### Index a paper
177
+
178
+ Insert a paper from arXiv by ID. If the paper is already indexed, only its authors can re-index it:
179
+
180
+ ```bash
181
+ curl "https://huggingface.co/api/papers/index" \
182
+ --request POST \
183
+ --header "Content-Type: application/json" \
184
+ --header "Authorization: Bearer $HF_TOKEN" \
185
+ --data '{
186
+ "arxivId": "{ARXIV_ID}"
187
+ }'
188
+ ```
189
+
190
+ - Endpoint: `POST /api/papers/index`
191
+ - Body:
192
+ - `arxivId` (string, required): arXiv ID to index, for example `2301.00001`
193
+ - Pattern: `^\d{4}\.\d{4,5}$`
194
+ - Response: empty JSON object on success
195
+
196
+ #### Update paper links
197
+
198
+ Update the project page, GitHub repository, or submitting organization for a paper. The requester must be the paper author, the Daily Papers submitter, or a papers admin:
199
+
200
+ ```bash
201
+ curl "https://huggingface.co/api/papers/{PAPER_OBJECT_ID}/links" \
202
+ --request POST \
203
+ --header "Content-Type: application/json" \
204
+ --header "Authorization: Bearer $HF_TOKEN" \
205
+ --data '{
206
+ "projectPage": "https://example.com",
207
+ "githubRepo": "https://github.com/org/repo",
208
+ "organizationId": "{ORGANIZATION_ID}"
209
+ }'
210
+ ```
211
+
212
+ - Endpoint: `POST /api/papers/{paperId}/links`
213
+ - Path parameters:
214
+ - `paperId` (string, required): Hugging Face paper object ID
215
+ - Body:
216
+ - `githubRepo` (string, nullable): GitHub repository URL
217
+ - `organizationId` (string, nullable): organization ID, 24-char hex ID
218
+ - `projectPage` (string, nullable): project page URL
219
+ - Response: empty JSON object on success
220
+
221
+ ## Error Handling
222
+
223
+ - **404 on `https://huggingface.co/papers/{PAPER_ID}` or `md` endpoint**: the paper is not indexed on Hugging Face paper pages yet.
224
+ - **404 on `/api/papers/{PAPER_ID}`**: the paper may not be indexed on Hugging Face paper pages yet.
225
+ - **Paper ID not found**: verify the extracted arXiv ID, including any version suffix
226
+
227
+ ### Fallbacks
228
+
229
+ If the Hugging Face paper page does not contain enough detail for the user's question:
230
+
231
+ - Check the regular paper page at `https://huggingface.co/papers/{PAPER_ID}`
232
+ - Fall back to the arXiv page or PDF for the original source:
233
+ - `https://arxiv.org/abs/{PAPER_ID}`
234
+ - `https://arxiv.org/pdf/{PAPER_ID}`
235
+
236
+ ## Notes
237
+
238
+ - No authentication is required for public paper pages.
239
+ - Write endpoints such as claim authorship, index paper, and update paper links require `Authorization: Bearer $HF_TOKEN`.
240
+ - Prefer the `.md` endpoint for reliable machine-readable output.
241
+ - Prefer `/api/papers/{PAPER_ID}` when you need structured JSON fields instead of page markdown.
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "trackio-cli",
3
+ "version": "1.0.0",
4
+ "description": "Query Trackio projects, runs, and metrics using the `trackio` CLI. Use when the user needs to list projects/runs/metrics, get summaries, or retrieve metric values from local Trackio databases. Supports both human-readable and JSON output formats. Covers project discovery, run inspection, metric querying, and system metrics. Designed for LLM agents and automation scripts.",
5
+ "author": {
6
+ "name": "Hugging Face"
7
+ },
8
+ "repository": "https://github.com/huggingface/skills",
9
+ "license": "Apache-2.0",
10
+ "keywords": [
11
+ "trackio",
12
+ "experiment-tracking",
13
+ "metrics",
14
+ "mlops",
15
+ "cli",
16
+ "monitoring"
17
+ ]
18
+ }
19
+
@@ -0,0 +1,117 @@
1
+ ---
2
+ source: "https://github.com/huggingface/skills/tree/main/skills/huggingface-trackio"
3
+ name: hugging-face-trackio
4
+ description: Track ML experiments with Trackio using Python logging, alerts, and CLI metric retrieval.
5
+ risk: unknown
6
+ ---
7
+
8
+ # Trackio - Experiment Tracking for ML Training
9
+
10
+ Trackio is an experiment tracking library for logging and visualizing ML training metrics. It syncs to Hugging Face Spaces for real-time monitoring dashboards.
11
+
12
+ ## Three Interfaces
13
+
14
+ | Task | Interface | Reference |
15
+ |------|-----------|-----------|
16
+ | **Logging metrics** during training | Python API | [references/logging_metrics.md](references/logging_metrics.md) |
17
+ | **Firing alerts** for training diagnostics | Python API | [references/alerts.md](references/alerts.md) |
18
+ | **Retrieving metrics & alerts** after/during training | CLI | [references/retrieving_metrics.md](references/retrieving_metrics.md) |
19
+
20
+ ## When to Use Each
21
+
22
+ ### Python API → Logging
23
+
24
+ Use `import trackio` in your training scripts to log metrics:
25
+
26
+ - Initialize tracking with `trackio.init()`
27
+ - Log metrics with `trackio.log()` or use TRL's `report_to="trackio"`
28
+ - Finalize with `trackio.finish()`
29
+
30
+ **Key concept**: For remote/cloud training, pass `space_id` — metrics sync to a Space dashboard so they persist after the instance terminates.
31
+
32
+ → See [references/logging_metrics.md](references/logging_metrics.md) for setup, TRL integration, and configuration options.
33
+
34
+ ### Python API → Alerts
35
+
36
+ Insert `trackio.alert()` calls in training code to flag important events — like inserting print statements for debugging, but structured and queryable:
37
+
38
+ - `trackio.alert(title="...", level=trackio.AlertLevel.WARN)` — fire an alert
39
+ - Three severity levels: `INFO`, `WARN`, `ERROR`
40
+ - Alerts are printed to terminal, stored in the database, shown in the dashboard, and optionally sent to webhooks (Slack/Discord)
41
+
42
+ **Key concept for LLM agents**: Alerts are the primary mechanism for autonomous experiment iteration. An agent should insert alerts into training code for diagnostic conditions (loss spikes, NaN gradients, low accuracy, training stalls). Since alerts are printed to the terminal, an agent that is watching the training script's output will see them automatically. For background or detached runs, the agent can poll via CLI instead.
43
+
44
+ → See [references/alerts.md](references/alerts.md) for the full alerts API, webhook setup, and autonomous agent workflows.
45
+
46
+ ### CLI → Retrieving
47
+
48
+ Use the `trackio` command to query logged metrics and alerts:
49
+
50
+ - `trackio list projects/runs/metrics` — discover what's available
51
+ - `trackio get project/run/metric` — retrieve summaries and values
52
+ - `trackio list alerts --project <name> --json` — retrieve alerts
53
+ - `trackio show` — launch the dashboard
54
+ - `trackio sync` — sync to HF Space
55
+
56
+ **Key concept**: Add `--json` for programmatic output suitable for automation and LLM agents.
57
+
58
+ → See [references/retrieving_metrics.md](references/retrieving_metrics.md) for all commands, workflows, and JSON output formats.
59
+
60
+ ## Minimal Logging Setup
61
+
62
+ ```python
63
+ import trackio
64
+
65
+ trackio.init(project="my-project", space_id="username/trackio")
66
+ trackio.log({"loss": 0.1, "accuracy": 0.9})
67
+ trackio.log({"loss": 0.09, "accuracy": 0.91})
68
+ trackio.finish()
69
+ ```
70
+
71
+ ### Minimal Retrieval
72
+
73
+ ```bash
74
+ trackio list projects --json
75
+ trackio get metric --project my-project --run my-run --metric loss --json
76
+ ```
77
+
78
+ ## Autonomous ML Experiment Workflow
79
+
80
+ When running experiments autonomously as an LLM agent, the recommended workflow is:
81
+
82
+ 1. **Set up training with alerts** — insert `trackio.alert()` calls for diagnostic conditions
83
+ 2. **Launch training** — run the script in the background
84
+ 3. **Poll for alerts** — use `trackio list alerts --project <name> --json --since <timestamp>` to check for new alerts
85
+ 4. **Read metrics** — use `trackio get metric ...` to inspect specific values
86
+ 5. **Iterate** — based on alerts and metrics, stop the run, adjust hyperparameters, and launch a new run
87
+
88
+ ```python
89
+ import trackio
90
+
91
+ trackio.init(project="my-project", config={"lr": 1e-4})
92
+
93
+ for step in range(num_steps):
94
+ loss = train_step()
95
+ trackio.log({"loss": loss, "step": step})
96
+
97
+ if step > 100 and loss > 5.0:
98
+ trackio.alert(
99
+ title="Loss divergence",
100
+ text=f"Loss {loss:.4f} still high after {step} steps",
101
+ level=trackio.AlertLevel.ERROR,
102
+ )
103
+ if step > 0 and abs(loss) < 1e-8:
104
+ trackio.alert(
105
+ title="Vanishing loss",
106
+ text="Loss near zero — possible gradient collapse",
107
+ level=trackio.AlertLevel.WARN,
108
+ )
109
+
110
+ trackio.finish()
111
+ ```
112
+
113
+ Then poll from a separate terminal/process:
114
+
115
+ ```bash
116
+ trackio list alerts --project my-project --json --since "2025-01-01T00:00:00"
117
+ ```
@@ -0,0 +1,196 @@
1
+ # Trackio Alerts
2
+
3
+ Alerts let you flag important training events directly from code. They are the primary mechanism for LLM agents to diagnose runs and iterate autonomously on ML experiments.
4
+
5
+ Alerts are printed to the terminal, stored in the database, displayed in the dashboard, and optionally sent to webhooks (Slack/Discord).
6
+
7
+ ## Core API
8
+
9
+ ### trackio.alert()
10
+
11
+ ```python
12
+ trackio.alert(
13
+ title="Loss divergence", # Short title (required)
14
+ text="Loss 5.2 still high after 200 steps", # Detailed description (optional)
15
+ level=trackio.AlertLevel.WARN, # INFO, WARN, or ERROR (default: WARN)
16
+ webhook_url="https://hooks.slack.com/...", # Per-alert webhook override (optional)
17
+ )
18
+ ```
19
+
20
+ ### Alert Levels
21
+
22
+ | Level | Usage |
23
+ |-------|-------|
24
+ | `trackio.AlertLevel.INFO` | Informational milestones (checkpoints saved, eval completed) |
25
+ | `trackio.AlertLevel.WARN` | Potential issues (loss plateau, low accuracy, high gradient norm) |
26
+ | `trackio.AlertLevel.ERROR` | Critical failures (NaN loss, divergence, OOM) |
27
+
28
+ ### Webhook Support
29
+
30
+ Set a global webhook URL via `trackio.init()` or the `TRACKIO_WEBHOOK_URL` environment variable. Alerts are auto-formatted for Slack and Discord URLs.
31
+
32
+ ```python
33
+ trackio.init(
34
+ project="my-project",
35
+ webhook_url="https://hooks.slack.com/services/...",
36
+ webhook_min_level=trackio.AlertLevel.WARN, # Only send WARN+ to webhook
37
+ )
38
+ ```
39
+
40
+ Per-alert override:
41
+
42
+ ```python
43
+ trackio.alert(
44
+ title="Critical failure",
45
+ level=trackio.AlertLevel.ERROR,
46
+ webhook_url="https://hooks.slack.com/services/...", # Overrides global URL
47
+ )
48
+ ```
49
+
50
+ Environment variables:
51
+ - `TRACKIO_WEBHOOK_URL` — global webhook URL
52
+ - `TRACKIO_WEBHOOK_MIN_LEVEL` — minimum level for webhook delivery (`info`, `warn`, `error`)
53
+
54
+ ## Retrieving Alerts (CLI)
55
+
56
+ ```bash
57
+ # List all alerts for a project
58
+ trackio list alerts --project my-project --json
59
+
60
+ # Filter by run or level
61
+ trackio list alerts --project my-project --run my-run --level error --json
62
+
63
+ # Poll for new alerts since a timestamp (efficient for agents)
64
+ trackio list alerts --project my-project --json --since "2025-06-01T12:00:00"
65
+ ```
66
+
67
+ ### JSON Output Structure
68
+
69
+ ```json
70
+ {
71
+ "project": "my-project",
72
+ "run": null,
73
+ "level": null,
74
+ "since": "2025-06-01T12:00:00",
75
+ "alerts": [
76
+ {
77
+ "run": "run-name",
78
+ "title": "Loss divergence",
79
+ "text": "Loss 5.2 still high after 200 steps",
80
+ "level": "warn",
81
+ "step": 200,
82
+ "timestamp": "2025-06-01T12:05:30"
83
+ }
84
+ ]
85
+ }
86
+ ```
87
+
88
+ ## Autonomous Agent Workflow
89
+
90
+ The recommended pattern for an LLM agent running ML experiments:
91
+
92
+ ### 1. Insert Alerts Into Training Code
93
+
94
+ Add diagnostic `trackio.alert()` calls for conditions the agent should react to:
95
+
96
+ ```python
97
+ import trackio
98
+
99
+ trackio.init(project="hyperparam-sweep", config={"lr": lr, "batch_size": bs})
100
+
101
+ for step in range(num_steps):
102
+ loss = train_step()
103
+ trackio.log({"loss": loss, "step": step})
104
+
105
+ if step > 200 and loss > 5.0:
106
+ trackio.alert(
107
+ title="Loss divergence",
108
+ text=f"Loss {loss:.4f} still above 5.0 after {step} steps — learning rate may be too high",
109
+ level=trackio.AlertLevel.ERROR,
110
+ )
111
+
112
+ if step > 500 and loss_delta < 0.001:
113
+ trackio.alert(
114
+ title="Training stall",
115
+ text=f"Loss barely changed over last 100 steps (delta={loss_delta:.6f})",
116
+ level=trackio.AlertLevel.WARN,
117
+ )
118
+
119
+ if math.isnan(loss):
120
+ trackio.alert(
121
+ title="NaN loss",
122
+ text="Loss became NaN — training is broken",
123
+ level=trackio.AlertLevel.ERROR,
124
+ )
125
+ break
126
+
127
+ trackio.finish()
128
+ ```
129
+
130
+ ### 2. Monitor Alerts
131
+
132
+ Alerts are automatically printed to the terminal when fired. If the agent is watching the training script's output (e.g. running in the foreground or tailing logs), it will see alerts immediately — no polling needed.
133
+
134
+ For background or detached runs, poll for alerts via CLI:
135
+
136
+ ```bash
137
+ # Poll for alerts (run periodically)
138
+ trackio list alerts --project hyperparam-sweep --json --since "2025-06-01T00:00:00"
139
+ ```
140
+
141
+ ### 3. Inspect Metrics Around the Alert
142
+
143
+ When an alert fires, use `trackio get snapshot` to see all metrics at that point:
144
+
145
+ ```bash
146
+ # Alert fired at step 200 — get all metrics in a ±5 step window
147
+ trackio get snapshot --project hyperparam-sweep --run run-1 --around 200 --window 5 --json
148
+
149
+ # Or inspect a single metric around the alert's timestamp
150
+ trackio get metric --project hyperparam-sweep --run run-1 --metric loss --around 200 --window 10 --json
151
+ ```
152
+
153
+ ### 4. React and Iterate
154
+
155
+ Based on alerts:
156
+ - **ERROR alerts** → stop the run, adjust hyperparameters, relaunch
157
+ - **WARN alerts** → inspect metrics with `trackio get snapshot ...`, decide whether to intervene
158
+ - **INFO alerts** → note progress, continue monitoring
159
+
160
+ ### 5. Compare Across Runs
161
+
162
+ ```bash
163
+ # Check metrics from previous runs
164
+ trackio get run --project hyperparam-sweep --run run-1 --json
165
+ trackio get metric --project hyperparam-sweep --run run-1 --metric loss --json
166
+
167
+ # Launch new run with adjusted config
168
+ python train.py --lr 5e-5
169
+ ```
170
+
171
+ ## Using Alerts with Transformers / TRL
172
+
173
+ When using `report_to="trackio"`, you don't control the training loop directly. Use a `TrainerCallback` to fire alerts:
174
+
175
+ ```python
176
+ from transformers import TrainerCallback
177
+
178
+ class AlertCallback(TrainerCallback):
179
+ def on_log(self, args, state, control, logs=None, **kwargs):
180
+ if "trackio" not in args.report_to:
181
+ return
182
+ if logs and "loss" in logs:
183
+ if logs["loss"] > 5.0 and state.global_step > 100:
184
+ trackio.alert(
185
+ title="High loss",
186
+ text=f"Loss {logs['loss']:.4f} at step {state.global_step}",
187
+ level=trackio.AlertLevel.ERROR,
188
+ )
189
+
190
+ trainer = SFTTrainer(
191
+ model=model,
192
+ args=SFTConfig(output_dir="./out", report_to="trackio"),
193
+ callbacks=[AlertCallback()],
194
+ ...
195
+ )
196
+ ```