🛠️ Hugging Face Trackio
機械学習の実験状況を記録し、異常
📺 まず動画で見る(YouTube)
▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
Track ML experiments with Trackio using Python logging, alerts, and CLI metric retrieval.
🇯🇵 日本人クリエイター向け解説
機械学習の実験状況を記録し、異常
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o hugging-face-trackio.zip https://jpskill.com/download/2997.zip && unzip -o hugging-face-trackio.zip && rm hugging-face-trackio.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/2997.zip -OutFile "$d\hugging-face-trackio.zip"; Expand-Archive "$d\hugging-face-trackio.zip" -DestinationPath $d -Force; ri "$d\hugging-face-trackio.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
hugging-face-trackio.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
hugging-face-trackioフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 4
💬 こう話しかけるだけ — サンプルプロンプト
- › Hugging Face Trackio を使って、最小構成のサンプルコードを示して
- › Hugging Face Trackio の主な使い方と注意点を教えて
- › Hugging Face Trackio を既存プロジェクトに組み込む方法を教えて
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Trackio - MLトレーニングのための実験追跡
Trackioは、MLトレーニングのメトリクスをログ記録し、視覚化するための実験追跡ライブラリです。リアルタイム監視ダッシュボードのためにHugging Face Spacesと同期します。
3つのインターフェース
| タスク | インターフェース | 参照 |
|---|---|---|
| トレーニング中のメトリクス記録 | Python API | references/logging_metrics.md |
| トレーニング診断のためのアラート発火 | Python API | references/alerts.md |
| トレーニング後/トレーニング中のメトリクスとアラートの取得 | CLI | references/retrieving_metrics.md |
それぞれの使いどころ
Python API → ログ記録
トレーニングスクリプトでimport trackioを使用してメトリクスをログ記録します。
trackio.init()で追跡を初期化します。trackio.log()でメトリクスをログ記録するか、TRLのreport_to="trackio"を使用します。trackio.finish()で完了します。
重要な概念: リモート/クラウドトレーニングの場合、space_idを渡します。メトリクスはSpaceダッシュボードに同期され、インスタンスが終了した後も保持されます。
→ セットアップ、TRL統合、および設定オプションについては、references/logging_metrics.mdを参照してください。
Python API → アラート
デバッグのためにprint文を挿入するのと同様に、重要なイベントをフラグ付けするためにトレーニングコードにtrackio.alert()呼び出しを挿入します。ただし、構造化されており、クエリ可能です。
trackio.alert(title="...", level=trackio.AlertLevel.WARN)— アラートを発火します。- 3つの重大度レベル:
INFO、WARN、ERROR - アラートはターミナルに表示され、データベースに保存され、ダッシュボードに表示され、オプションでWebhook(Slack/Discord)に送信されます。
LLMエージェントの重要な概念: アラートは、自律的な実験反復のための主要なメカニズムです。エージェントは、診断条件(損失の急増、NaN勾配、低い精度、トレーニングの停滞)のためにトレーニングコードにアラートを挿入する必要があります。アラートはターミナルに表示されるため、トレーニングスクリプトの出力を監視しているエージェントはそれらを自動的に確認できます。バックグラウンドまたはデタッチされた実行の場合、エージェントは代わりにCLIを介してポーリングできます。
→ 完全なアラートAPI、Webhookのセットアップ、および自律エージェントのワークフローについては、references/alerts.mdを参照してください。
CLI → 取得
trackioコマンドを使用して、ログ記録されたメトリクスとアラートをクエリします。
trackio list projects/runs/metrics— 利用可能なものを検出します。trackio get project/run/metric— 要約と値を取得します。trackio list alerts --project <name> --json— アラートを取得します。trackio show— ダッシュボードを起動します。trackio sync— HF Spaceに同期します。
重要な概念: 自動化およびLLMエージェントに適したプログラム出力には--jsonを追加します。
→ すべてのコマンド、ワークフロー、およびJSON出力形式については、references/retrieving_metrics.mdを参照してください。
最小限のログ記録設定
import trackio
trackio.init(project="my-project", space_id="username/trackio")
trackio.log({"loss": 0.1, "accuracy": 0.9})
trackio.log({"loss": 0.09, "accuracy": 0.91})
trackio.finish()
最小限の取得
trackio list projects --json
trackio get metric --project my-project --run my-run --metric loss --json
自律ML実験ワークフロー
LLMエージェントとして自律的に実験を実行する場合、推奨されるワークフローは次のとおりです。
- アラート付きでトレーニングを設定する — 診断条件のために
trackio.alert()呼び出しを挿入します。 - トレーニングを開始する — スクリプトをバックグラウンドで実行します。
- アラートをポーリングする —
trackio list alerts --project <name> --json --since <timestamp>を使用して新しいアラートを確認します。 - メトリクスを読み取る —
trackio get metric ...を使用して特定の値を検査します。 - 反復する — アラートとメトリクスに基づいて、実行を停止し、ハイパーパラメータを調整し、新しい実行を開始します。
import trackio
trackio.init(project="my-project", config={"lr": 1e-4})
for step in range(num_steps):
loss = train_step()
trackio.log({"loss": loss, "step": step})
if step > 100 and loss > 5.0:
trackio.alert(
title="Loss divergence",
text=f"Loss {loss:.4f} still high after {step} steps",
level=trackio.AlertLevel.ERROR,
)
if step > 0 and abs(loss) < 1e-8:
trackio.alert(
title="Vanishing loss",
text="Loss near zero — possible gradient collapse",
level=trackio.AlertLevel.WARN,
)
trackio.finish()
次に、別のターミナル/プロセスからポーリングします。
trackio list alerts --project my-project --json --since "2025-01-01T00:00:00"
制限事項
- このスキルは、タスクが上記の範囲と明確に一致する場合にのみ使用してください。
- 出力を、環境固有の検証、テスト、または専門家によるレビューの代わりとして扱わないでください。
- 必要な入力、権限、安全境界、または成功基準が不足している場合は、停止して説明を求めてください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Trackio - Experiment Tracking for ML Training
Trackio is an experiment tracking library for logging and visualizing ML training metrics. It syncs to Hugging Face Spaces for real-time monitoring dashboards.
Three Interfaces
| Task | Interface | Reference |
|---|---|---|
| Logging metrics during training | Python API | references/logging_metrics.md |
| Firing alerts for training diagnostics | Python API | references/alerts.md |
| Retrieving metrics & alerts after/during training | CLI | references/retrieving_metrics.md |
When to Use Each
Python API → Logging
Use import trackio in your training scripts to log metrics:
- Initialize tracking with
trackio.init() - Log metrics with
trackio.log()or use TRL'sreport_to="trackio" - Finalize with
trackio.finish()
Key concept: For remote/cloud training, pass space_id — metrics sync to a Space dashboard so they persist after the instance terminates.
→ See references/logging_metrics.md for setup, TRL integration, and configuration options.
Python API → Alerts
Insert trackio.alert() calls in training code to flag important events — like inserting print statements for debugging, but structured and queryable:
trackio.alert(title="...", level=trackio.AlertLevel.WARN)— fire an alert- Three severity levels:
INFO,WARN,ERROR - Alerts are printed to terminal, stored in the database, shown in the dashboard, and optionally sent to webhooks (Slack/Discord)
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.
→ See references/alerts.md for the full alerts API, webhook setup, and autonomous agent workflows.
CLI → Retrieving
Use the trackio command to query logged metrics and alerts:
trackio list projects/runs/metrics— discover what's availabletrackio get project/run/metric— retrieve summaries and valuestrackio list alerts --project <name> --json— retrieve alertstrackio show— launch the dashboardtrackio sync— sync to HF Space
Key concept: Add --json for programmatic output suitable for automation and LLM agents.
→ See references/retrieving_metrics.md for all commands, workflows, and JSON output formats.
Minimal Logging Setup
import trackio
trackio.init(project="my-project", space_id="username/trackio")
trackio.log({"loss": 0.1, "accuracy": 0.9})
trackio.log({"loss": 0.09, "accuracy": 0.91})
trackio.finish()
Minimal Retrieval
trackio list projects --json
trackio get metric --project my-project --run my-run --metric loss --json
Autonomous ML Experiment Workflow
When running experiments autonomously as an LLM agent, the recommended workflow is:
- Set up training with alerts — insert
trackio.alert()calls for diagnostic conditions - Launch training — run the script in the background
- Poll for alerts — use
trackio list alerts --project <name> --json --since <timestamp>to check for new alerts - Read metrics — use
trackio get metric ...to inspect specific values - Iterate — based on alerts and metrics, stop the run, adjust hyperparameters, and launch a new run
import trackio
trackio.init(project="my-project", config={"lr": 1e-4})
for step in range(num_steps):
loss = train_step()
trackio.log({"loss": loss, "step": step})
if step > 100 and loss > 5.0:
trackio.alert(
title="Loss divergence",
text=f"Loss {loss:.4f} still high after {step} steps",
level=trackio.AlertLevel.ERROR,
)
if step > 0 and abs(loss) < 1e-8:
trackio.alert(
title="Vanishing loss",
text="Loss near zero — possible gradient collapse",
level=trackio.AlertLevel.WARN,
)
trackio.finish()
Then poll from a separate terminal/process:
trackio list alerts --project my-project --json --since "2025-01-01T00:00:00"
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (5,081 bytes)
- 📎 references/alerts.md (5,950 bytes)
- 📎 references/logging_metrics.md (4,853 bytes)
- 📎 references/retrieving_metrics.md (8,707 bytes)