Experiment tracking

From lza6/Armor-piercing-system-prompts · View interactive version

Experiment tracking is an AI agent skill from the GitHub repository lza6/Armor-piercing-system-prompts. Instrument Python ML and data scripts with ClearML Task experiment tracking, Logger reports, artifacts, configs, models, offline mode, and tracking validation.

How to use this skill

Skill file

ClearML Experiment Tracking

Use this sub-skill when a user asks to add, review, or troubleshoot ClearML experiment tracking in a Python script. It covers Task.init, TaskTypes, connected hyperparameters/configuration, Logger reports, artifacts, model metadata, framework auto-logging, offline mode, task reuse, output_uri, and static validation.

When To Use

Route Elsewhere

Essential References

Minimal Instrumentation Pattern

Place Task.init near the start of executable code, before training starts and before framework writers, plots, or model checkpoints are created.

from clearml import Task, TaskTypes

task = Task.init(
    project_name="my-project",
    task_name="train-model",
    task_type=TaskTypes.training,
    reuse_last_task_id=False,
    output_uri=True,
)

Use reuse_last_task_id=False for most repeatable local training runs so previous outputs are not overwritten. Use continue_last_task=True only when intentionally appending to an existing task, and prefer an explicit reuse_last_task_id="<task-id>" when continuing a known task.

Connect Inputs

Report Outputs

Model Tracking

Offline And Credentials Pattern

Use offline mode when the script must run without credentials or network access:

from clearml import Task

Task.set_offline(True)
task = Task.init(project_name="offline", task_name="train")
# training and reporting here
task.close()
Task.set_offline(False)
Task.import_offline_session(task.get_offline_mode_folder())

Set offline mode before Task.init. Close the task before switching back online. Do not use Task.create for offline experiment capture.

Validation Checklist

Static Helper

Run the bundled validator against a candidate script:

python scripts/validate_tracking_script.py path/to/train.py

The helper parses the file with ast, never imports the script, never imports ClearML, and never contacts a server. Treat warnings as review prompts; it cannot prove runtime server connectivity, storage credentials, optional framework installation, or remote override behavior.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.