[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74YM2X4TDPGBS7ES5MBT20Y":3,"skill-same:01M74YM2X4TDPGBS7ES5MBT20Y":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":37,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M74YM2X4TDPGBS7ES5MBT20Y","experiment-tracking-swanlab",null,"Tracks ML experiments with SwanLab, an open-source tool covering swanlab.init, config and metric logging, scalar charts, and media logging (images, audio, text, GIFs, point clouds, molecules), in cloud, local (mode=\"local\" with swanlab[dashboard]), or self-hosted setups. Includes integrations for PyTorch, Transformers, PyTorch Lightning, and Fastai. Use when logging metrics and hyperparameters for training runs, comparing runs across seeds, checkpoints, or hyperparameters, running an offline or self-hosted dashboard instead of managed SaaS, logging media alongside scalars, or adding tracking callbacks to a Transformers, Lightning, or Fastai training loop. Not for other trackers such as Weights & Biases or MLflow.","KalarisLabs\u002Fresearch-agent-skills","KalarisLabs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F300878568?v=4","01M74Y7MT23GXXC56VM6TVSXZY","Kalarislabs","01M74Y7MTQM9REXZX4SNXWX95C",132,"MIT","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fexperiment-tracking-swanlab\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: experiment-tracking-swanlab\ndescription: Tracks ML experiments with SwanLab, an open-source tool covering swanlab.init, config and metric logging, scalar charts, and media logging (images, audio, text, GIFs, point clouds, molecules), in cloud, local (mode=\"local\" with swanlab[dashboard]), or self-hosted setups. Includes integrations for PyTorch, Transformers, PyTorch Lightning, and Fastai. Use when logging metrics and hyperparameters for training runs, comparing runs across seeds, checkpoints, or hyperparameters, running an offline or self-hosted dashboard instead of managed SaaS, logging media alongside scalars, or adding tracking callbacks to a Transformers, Lightning, or Fastai training loop. Not for other trackers such as Weights & Biases or MLflow.\nlicense: MIT\nmetadata:\n  version: 1.0.0\n  category: ml-inference-and-ops\n  maintainer: Kalaris Labs\n  tags: MLOps, SwanLab, Experiment Tracking, Open Source, Visualization, PyTorch, Transformers, PyTorch Lightning, Fastai, Self-Hosted\n  dependencies: swanlab>=0.7.11, pillow>=9.0.0, soundfile>=0.12.0\n---\n\n# SwanLab: Open-Source Experiment Tracking\n\n## When to Use This Skill\n\nUse SwanLab when you need to:\n- **Track ML experiments** with metrics, configs, tags, and descriptions\n- **Visualize training** with scalar charts and logged media\n- **Compare runs** across seeds, checkpoints, and hyperparameters\n- **Work locally or self-hosted** instead of depending on managed SaaS\n- **Integrate** with PyTorch, Transformers, PyTorch Lightning, or Fastai\n\n**Deployment**: Cloud, local, or self-hosted | **Media**: images, audio, text, GIFs, point clouds, molecules | **Integrations**: PyTorch, Transformers, PyTorch Lightning, Fastai\n\n## Installation\n\n```bash\n# Install SwanLab plus the media dependencies used in this skill\npip install \"swanlab>=0.7.11\" \"pillow>=9.0.0\" \"soundfile>=0.12.0\"\n\n# Add local dashboard support for mode=\"local\" and swanlab watch\npip install \"swanlab[dashboard]>=0.7.11\"\n\n# Optional framework integrations\npip install transformers pytorch-lightning fastai\n\n# Login for cloud or self-hosted usage\nswanlab login\n```\n\n`pillow` and `soundfile` are the media dependencies used by the Image and Audio examples in this skill. `swanlab[dashboard]` adds the local dashboard dependency required by `mode=\"local\"` and `swanlab watch`.\n\n## Quick Start\n\n### Basic Experiment Tracking\n\n```python\nimport swanlab\n\nrun = swanlab.init(\n    project=\"my-project\",\n    experiment_name=\"baseline\",\n    config={\n        \"learning_rate\": 1e-3,\n        \"epochs\": 10,\n        \"batch_size\": 32,\n        \"model\": \"resnet18\",\n    },\n)\n\nfor epoch in range(run.config.epochs):\n    train_loss = train_epoch()\n    val_loss = validate()\n\n    swanlab.log(\n        {\n            \"train\u002Floss\": train_loss,\n            \"val\u002Floss\": val_loss,\n            \"epoch\": epoch,\n        }\n    )\n\nrun.finish()\n```\n\n### With PyTorch\n\n```python\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport swanlab\n\nrun = swanlab.init(\n    project=\"pytorch-demo\",\n    experiment_name=\"mnist-mlp\",\n    config={\n        \"learning_rate\": 1e-3,\n        \"batch_size\": 64,\n        \"epochs\": 10,\n        \"hidden_size\": 128,\n    },\n)\n\nmodel = nn.Sequential(\n    nn.Flatten(),\n    nn.Linear(28 * 28, run.config.hidden_size),\n    nn.ReLU(),\n    nn.Linear(run.config.hidden_size, 10),\n)\noptimizer = optim.Adam(model.parameters(), lr=run.config.learning_rate)\ncriterion = nn.CrossEntropyLoss()\n\nfor epoch in range(run.config.epochs):\n    model.train()\n    for batch_idx, (data, target) in enumerate(train_loader):\n        optimizer.zero_grad()\n        logits = model(data)\n        loss = criterion(logits, target)\n        loss.backward()\n        optimizer.step()\n\n        if batch_idx % 100 == 0:\n            swanlab.log(\n                {\n                    \"train\u002Floss\": loss.item(),\n                    \"train\u002Fepoch\": epoch,\n                    \"train\u002Fbatch\": batch_idx,\n                }\n            )\n\nrun.finish()\n```\n\n## Core Concepts\n\n### 1. Projects and Experiments\n\n**Project**: Collection of related experiments  \n**Experiment**: Single execution of a training or evaluation workflow\n\n```python\nimport swanlab\n\nrun = swanlab.init(\n    project=\"image-classification\",\n    experiment_name=\"resnet18-seed42\",\n    description=\"Baseline run on ImageNet subset\",\n    tags=[\"baseline\", \"resnet18\"],\n    config={\n        \"model\": \"resnet18\",\n        \"seed\": 42,\n        \"batch_size\": 64,\n        \"learning_rate\": 3e-4,\n    },\n)\n\nprint(run.id)\nprint(run.config.learning_rate)\n```\n\n### 2. Configuration Tracking\n\n```python\nconfig = {\n    \"model\": \"resnet18\",\n    \"seed\": 42,\n    \"batch_size\": 64,\n    \"learning_rate\": 3e-4,\n    \"epochs\": 20,\n}\n\nrun = swanlab.init(project=\"my-project\", config=config)\n\nlearning_rate = run.config.learning_rate\nbatch_size = run.config.batch_size\n```\n\n### 3. Metric Logging\n\n```python\n# Log scalars\nswanlab.log({\"loss\": 0.42, \"accuracy\": 0.91})\n\n# Log multiple metrics\nswanlab.log(\n    {\n        \"train\u002Floss\": train_loss,\n        \"train\u002Faccuracy\": train_acc,\n        \"val\u002Floss\": val_loss,\n        \"val\u002Faccuracy\": val_acc,\n        \"lr\": current_lr,\n        \"epoch\": epoch,\n    }\n)\n\n# Log with custom step\nswanlab.log({\"loss\": loss}, step=global_step)\n```\n\n### 4. Media and Chart Logging\n\n```python\nimport numpy as np\nimport swanlab\n\n# Image\nimage = np.random.randint(0, 255, (224, 224, 3), dtype=np.uint8)\nswanlab.log({\"examples\u002Fimage\": swanlab.Image(image, caption=\"Augmented sample\")})\n\n# Audio\nwave = np.sin(np.linspace(0, 8 * np.pi, 16000)).astype(\"float32\")\nswanlab.log({\"examples\u002Faudio\": swanlab.Audio(wave, sample_rate=16000)})\n\n# Text\nswanlab.log({\"examples\u002Ftext\": swanlab.Text(\"Training notes for this run.\")})\n\n# GIF video\nswanlab.log({\"examples\u002Fvideo\": swanlab.Video(\"predictions.gif\", caption=\"Validation rollout\")})\n\n# Point cloud\npoints = np.random.rand(128, 3).astype(\"float32\")\nswanlab.log({\"examples\u002Fpoint_cloud\": swanlab.Object3D(points, caption=\"Point cloud sample\")})\n\n# Molecule\nswanlab.log({\"examples\u002Fmolecule\": swanlab.Molecule.from_smiles(\"CCO\", caption=\"Ethanol\")})\n```\n\n```python\n# Custom chart with swanlab.echarts\nline = swanlab.echarts.Line()\nline.add_xaxis([\"epoch-1\", \"epoch-2\", \"epoch-3\"])\nline.add_yaxis(\"train\u002Floss\", [0.92, 0.61, 0.44])\nline.set_global_opts(\n    title_opts=swanlab.echarts.options.TitleOpts(title=\"Training Loss\")\n)\n\nswanlab.log({\"charts\u002Floss_curve\": line})\n```\n\nSee [references\u002Fvisualization.md](references\u002Fvisualization.md) for more chart and media patterns.\n\n### 5. Local and Self-Hosted Workflows\n\n```python\nimport os\nimport swanlab\n\n# Self-hosted or cloud login\nswanlab.login(\n    api_key=os.environ[\"SWANLAB_API_KEY\"],\n    host=\"http:\u002F\u002Fyour-server:5092\",\n)\n\n# Local-only logging\nrun = swanlab.init(\n    project=\"offline-demo\",\n    mode=\"local\",\n    logdir=\".\u002Fswanlog\",\n)\n\nswanlab.log({\"loss\": 0.35, \"epoch\": 1})\nrun.finish()\n```\n\n```bash\n# View local logs\nswanlab watch -l .\u002Fswanlog\n\n# Sync local logs later\nswanlab sync .\u002Fswanlog\n```\n\n## Integration Examples\n\n### HuggingFace Transformers\n\n```python\nfrom transformers import Trainer, TrainingArguments\n\ntraining_args = TrainingArguments(\n    output_dir=\".\u002Fresults\",\n    per_device_train_batch_size=8,\n    evaluation_strategy=\"epoch\",\n    logging_steps=50,\n    report_to=\"swanlab\",\n    run_name=\"bert-finetune\",\n)\n\ntrainer = Trainer(\n    model=model,\n    args=training_args,\n    train_dataset=train_dataset,\n    eval_dataset=eval_dataset,\n)\n\ntrainer.train()\n```\n\nSee [references\u002Fintegrations.md](references\u002Fintegrations.md) for callback-based setups and additional framework patterns.\n\n### PyTorch Lightning\n\n```python\nimport pytorch_lightning as pl\nfrom swanlab.integration.pytorch_lightning import SwanLabLogger\n\nswanlab_logger = SwanLabLogger(\n    project=\"lightning-demo\",\n    experiment_name=\"mnist-classifier\",\n    config={\"batch_size\": 64, \"max_epochs\": 10},\n)\n\ntrainer = pl.Trainer(\n    logger=swanlab_logger,\n    max_epochs=10,\n    accelerator=\"auto\",\n)\n\ntrainer.fit(model, train_loader, val_loader)\n```\n\n### Fastai\n\n```python\nfrom fastai.vision.all import accuracy, resnet34, vision_learner\nfrom swanlab.integration.fastai import SwanLabCallback\n\nlearn = vision_learner(dls, resnet34, metrics=accuracy)\nlearn.fit(\n    5,\n    cbs=[\n        SwanLabCallback(\n            project=\"fastai-demo\",\n            experiment_name=\"pets-classification\",\n            config={\"arch\": \"resnet34\", \"epochs\": 5},\n        )\n    ],\n)\n```\n\nSee [references\u002Fintegrations.md](references\u002Fintegrations.md) for fuller framework examples.\n\n## Best Practices\n\n### 1. Use Stable Metric Names\n\n```python\n# Good: grouped metric namespaces\nswanlab.log({\n    \"train\u002Floss\": train_loss,\n    \"train\u002Faccuracy\": train_acc,\n    \"val\u002Floss\": val_loss,\n    \"val\u002Faccuracy\": val_acc,\n})\n\n# Avoid mixing flat and grouped names for the same metric family\n```\n\n### 2. Initialize Early and Capture Config Once\n\n```python\nrun = swanlab.init(\n    project=\"image-classification\",\n    experiment_name=\"resnet18-baseline\",\n    config={\n        \"model\": \"resnet18\",\n        \"learning_rate\": 3e-4,\n        \"batch_size\": 64,\n        \"seed\": 42,\n    },\n)\n```\n\n### 3. Save Checkpoints Locally\n\n```python\nimport torch\nimport swanlab\n\ncheckpoint_path = \"checkpoints\u002Fbest.pth\"\ntorch.save(model.state_dict(), checkpoint_path)\n\nswanlab.log(\n    {\n        \"best\u002Fval_accuracy\": best_val_accuracy,\n        \"artifacts\u002Fcheckpoint_path\": swanlab.Text(checkpoint_path),\n    }\n)\n```\n\n### 4. Use Local Mode for Offline-First Workflows\n\n```python\nrun = swanlab.init(project=\"offline-demo\", mode=\"local\", logdir=\".\u002Fswanlog\")\n# ... training code ...\nrun.finish()\n\n# Inspect later with: swanlab watch -l .\u002Fswanlog\n```\n\n### 5. Keep Advanced Patterns in References\n\n- Use [references\u002Fvisualization.md](references\u002Fvisualization.md) for advanced chart and media patterns\n- Use [references\u002Fintegrations.md](references\u002Fintegrations.md) for callback-based and framework-specific integration details\n\n## Resources\n\n- [Official docs (Chinese)](https:\u002F\u002Fdocs.swanlab.cn)\n- [Official docs (English)](https:\u002F\u002Fdocs.swanlab.cn\u002Fen)\n- [GitHub repo](https:\u002F\u002Fgithub.com\u002FSwanHubX\u002FSwanLab)\n- [Self-hosted repo](https:\u002F\u002Fgithub.com\u002FSwanHubX\u002Fself-hosted)\n\n## See Also\n\n- [references\u002Fintegrations.md](references\u002Fintegrations.md) - Framework-specific examples\n- [references\u002Fvisualization.md](references\u002Fvisualization.md) - Charts and media logging patterns\n\n## Agent operating procedure\n\n1. **Check the environment.** Confirm hardware, framework and server versions, model format, and expected load.\n2. **Pin down the inputs.** Confirm formats, identifiers and parameters from the data or the user. Ask rather than guess any value that changes the result.\n3. **Run a small version first.** Serve or log a single request or run end to end before scaling.\n4. **Execute the full task** using the instructions and references above.\n5. **Validate the result.** Measure latency, throughput and output correctness against a reference; check resource usage and costs.\n6. **Report.** State what was run (versions, commands, parameters), what was checked, and what is still uncertain.\n\n| If this happens | Do this |\n|---|---|\n| The server fails to start or OOMs | Check model size versus memory, quantization and parallelism settings. |\n| A function, flag or endpoint in these instructions is missing in the installed version | Check the installed version's own documentation (`help()`, `--help`, official docs), adapt, and tell the user. Never invent an API. |\n| A required input, identifier or parameter is ambiguous | Ask the user, or state the assumption explicitly before running. |\n\n**Integrity rules**\n\n- Never fabricate results, parameters, identifiers, citations or statistics. If something cannot be run or verified, say so plainly.\n- Do not expose services or credentials publicly; confirm cloud costs before provisioning.\n- Treat version-specific details here as possibly outdated: confirm them against the official documentation for the installed version.\n- Ask before actions that cost money, consume shared GPUs or cloud quota, touch personal or patient data, or cannot be undone.\n","# SwanLab: Open-Source Experiment Tracking\n\n## When to Use This Skill\n\nUse SwanLab when you need to:\n- **Track ML experiments** with metrics, configs, tags, and descriptions\n- **Visualize training** with scalar charts and logged media\n- **Compare runs** across seeds, checkpoints, and hyperparameters\n- **Work locally or self-hosted** instead of depending on managed SaaS\n- **Integrate** with PyTorch, Transformers, PyTorch Lightning, or Fastai\n\n**Deployment**: Cloud, local, or self-hosted | **Media**: images, audio, text, GIFs, point clouds, molecules | **Integrations**: PyTorch, Transformers, PyTorch Lightning, Fastai\n\n## Installation\n\n```bash\n# Install SwanLab plus the media dependencies used in this skill\npip install \"swanlab>=0.7.11\" \"pillow>=9.0.0\" \"soundfile>=0.12.0\"\n\n# Add local dashboard support for mode=\"local\" and swanlab watch\npip install \"swanlab[dashboard]>=0.7.11\"\n\n# Optional framework integrations\npip install transformers pytorch-lightning fastai\n\n# Login for cloud or self-hosted usage\nswanlab login\n```\n\n`pillow` and `soundfile` are the media dependencies used by the Image and Audio examples in this skill. `swanlab[dashboard]` adds the local dashboard dependency required by `mode=\"local\"` and `swanlab watch`.\n\n## Quick Start\n\n### Basic Experiment Tracking\n\n```python\nimport swanlab\n\nrun = swanlab.init(\n    project=\"my-project\",\n    experiment_name=\"baseline\",\n    config={\n        \"learning_rate\": 1e-3,\n        \"epochs\": 10,\n        \"batch_size\": 32,\n        \"model\": \"resnet18\",\n    },\n)\n\nfor epoch in range(run.config.epochs):\n    train_loss = train_epoch()\n    val_loss = validate()\n\n    swanlab.log(\n        {\n            \"train\u002Floss\": train_loss,\n            \"val\u002Floss\": val_loss,\n            \"epoch\": epoch,\n        }\n    )\n\nrun.finish()\n```\n\n### With PyTorch\n\n```python\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport swanlab\n\nrun = swanlab.init(\n    project=\"pytorch-demo\",\n    experiment_name=\"mnist-mlp\",\n    config={\n        \"learning_rate\": 1e-3,\n        \"batch_size\": 64,\n        \"epochs\": 10,\n        \"hidden_size\": 128,\n    },\n)\n\nmodel = nn.Sequential(\n    nn.Flatten(),\n    nn.Linear(28 * 28, run.config.hidden_size),\n    nn.ReLU(),\n    nn.Linear(run.config.hidden_size, 10),\n)\noptimizer = optim.Adam(model.parameters(), lr=run.config.learning_rate)\ncriterion = nn.CrossEntropyLoss()\n\nfor epoch in range(run.config.epochs):\n    model.train()\n    for batch_idx, (data, target) in enumerate(train_loader):\n        optimizer.zero_grad()\n        logits = model(data)\n        loss = criterion(logits, target)\n        loss.backward()\n        optimizer.step()\n\n        if batch_idx % 100 == 0:\n            swanlab.log(\n                {\n                    \"train\u002Floss\": loss.item(),\n                    \"train\u002Fepoch\": epoch,\n                    \"train\u002Fbatch\": batch_idx,\n                }\n            )\n\nrun.finish()\n```\n\n## Core Concepts\n\n### 1. Projects and Experiments\n\n**Project**: Collection of related experiments  \n**Experiment**: Single execution of a training or evaluation workflow\n\n```python\nimport swanlab\n\nrun = swanlab.init(\n    project=\"image-classification\",\n    experiment_name=\"resnet18-seed42\",\n    description=\"Baseline run on ImageNet subset\",\n    tags=[\"baseline\", \"resnet18\"],\n    config={\n        \"model\": \"resnet18\",\n        \"seed\": 42,\n        \"batch_size\": 64,\n        \"learning_rate\": 3e-4,\n    },\n)\n\nprint(run.id)\nprint(run.config.learning_rate)\n```\n\n### 2. Configuration Tracking\n\n```python\nconfig = {\n    \"model\": \"resnet18\",\n    \"seed\": 42,\n    \"batch_size\": 64,\n    \"learning_rate\": 3e-4,\n    \"epochs\": 20,\n}\n\nrun = swanlab.init(project=\"my-project\", config=config)\n\nlearning_rate = run.config.learning_rate\nbatch_size = run.config.batch_size\n```\n\n### 3. Metric Logging\n\n```python\n# Log scalars\nswanlab.log({\"loss\": 0.42, \"accuracy\": 0.91})\n\n# Log multiple metrics\nswanlab.log(\n    {\n        \"train\u002Floss\": train_loss,\n        \"train\u002Faccuracy\": train_acc,\n        \"val\u002Floss\": val_loss,\n        \"val\u002Faccuracy\": val_acc,\n        \"lr\": current_lr,\n        \"epoch\": epoch,\n    }\n)\n\n# Log with custom step\nswanlab.log({\"loss\": loss}, step=global_step)\n```\n\n### 4. Media and Chart Logging\n\n```python\nimport numpy as np\nimport swanlab\n\n# Image\nimage = np.random.randint(0, 255, (224, 224, 3), dtype=np.uint8)\nswanlab.log({\"examples\u002Fimage\": swanlab.Image(image, caption=\"Augmented sample\")})\n\n# Audio\nwave = np.sin(np.linspace(0, 8 * np.pi, 16000)).astype(\"float32\")\nswanlab.log({\"examples\u002Faudio\": swanlab.Audio(wave, sample_rate=16000)})\n\n# Text\nswanlab.log({\"examples\u002Ftext\": swanlab.Text(\"Training notes for this run.\")})\n\n# GIF video\nswanlab.log({\"examples\u002Fvideo\": swanlab.Video(\"predictions.gif\", caption=\"Validation rollout\")})\n\n# Point cloud\npoints = np.random.rand(128, 3).astype(\"float32\")\nswanlab.log({\"examples\u002Fpoint_cloud\": swanlab.Object3D(points, caption=\"Point cloud sample\")})\n\n# Molecule\nswanlab.log({\"examples\u002Fmolecule\": swanlab.Molecule.from_smiles(\"CCO\", caption=\"Ethanol\")})\n```\n\n```python\n# Custom chart with swanlab.echarts\nline = swanlab.echarts.Line()\nline.add_xaxis([\"epoch-1\", \"epoch-2\", \"epoch-3\"])\nline.add_yaxis(\"train\u002Floss\", [0.92, 0.61, 0.44])\nline.set_global_opts(\n    title_opts=swanlab.echarts.options.TitleOpts(title=\"Training Loss\")\n)\n\nswanlab.log({\"charts\u002Floss_curve\": line})\n```\n\nSee [references\u002Fvisualization.md](references\u002Fvisualization.md) for more chart and media patterns.\n\n### 5. Local and Self-Hosted Workflows\n\n```python\nimport os\nimport swanlab\n\n# Self-hosted or cloud login\nswanlab.login(\n    api_key=os.environ[\"SWANLAB_API_KEY\"],\n    host=\"http:\u002F\u002Fyour-server:5092\",\n)\n\n# Local-only logging\nrun = swanlab.init(\n    project=\"offline-demo\",\n    mode=\"local\",\n    logdir=\".\u002Fswanlog\",\n)\n\nswanlab.log({\"loss\": 0.35, \"epoch\": 1})\nrun.finish()\n```\n\n```bash\n# View local logs\nswanlab watch -l .\u002Fswanlog\n\n# Sync local logs later\nswanlab sync .\u002Fswanlog\n```\n\n## Integration Examples\n\n### HuggingFace Transformers\n\n```python\nfrom transformers import Trainer, TrainingArguments\n\ntraining_args = TrainingArguments(\n    output_dir=\".\u002Fresults\",\n    per_device_train_batch_size=8,\n    evaluation_strategy=\"epoch\",\n    logging_steps=50,\n    report_to=\"swanlab\",\n    run_name=\"bert-finetune\",\n)\n\ntrainer = Trainer(\n    model=model,\n    args=training_args,\n    train_dataset=train_dataset,\n    eval_dataset=eval_dataset,\n)\n\ntrainer.train()\n```\n\nSee [references\u002Fintegrations.md](references\u002Fintegrations.md) for callback-based setups and additional framework patterns.\n\n### PyTorch Lightning\n\n```python\nimport pytorch_lightning as pl\nfrom swanlab.integration.pytorch_lightning import SwanLabLogger\n\nswanlab_logger = SwanLabLogger(\n    project=\"lightning-demo\",\n    experiment_name=\"mnist-classifier\",\n    config={\"batch_size\": 64, \"max_epochs\": 10},\n)\n\ntrainer = pl.Trainer(\n    logger=swanlab_logger,\n    max_epochs=10,\n    accelerator=\"auto\",\n)\n\ntrainer.fit(model, train_loader, val_loader)\n```\n\n### Fastai\n\n```python\nfrom fastai.vision.all import accuracy, resnet34, vision_learner\nfrom swanlab.integration.fastai import SwanLabCallback\n\nlearn = vision_learner(dls, resnet34, metrics=accuracy)\nlearn.fit(\n    5,\n    cbs=[\n        SwanLabCallback(\n            project=\"fastai-demo\",\n            experiment_name=\"pets-classification\",\n            config={\"arch\": \"resnet34\", \"epochs\": 5},\n        )\n    ],\n)\n```\n\nSee [references\u002Fintegrations.md](references\u002Fintegrations.md) for fuller framework examples.\n\n## Best Practices\n\n### 1. Use Stable Metric Names\n\n```python\n# Good: grouped metric namespaces\nswanlab.log({\n    \"train\u002Floss\": train_loss,\n    \"train\u002Faccuracy\": train_acc,\n    \"val\u002Floss\": val_loss,\n    \"val\u002Faccuracy\": val_acc,\n})\n\n# Avoid mixing flat and grouped names for the same metric family\n```\n\n### 2. Initialize Early and Capture Config Once\n\n```python\nrun = swanlab.init(\n    project=\"image-classification\",\n    experiment_name=\"resnet18-baseline\",\n    config={\n        \"model\": \"resnet18\",\n        \"learning_rate\": 3e-4,\n        \"batch_size\": 64,\n        \"seed\": 42,\n    },\n)\n```\n\n### 3. Save Checkpoints Locally\n\n```python\nimport torch\nimport swanlab\n\ncheckpoint_path = \"checkpoints\u002Fbest.pth\"\ntorch.save(model.state_dict(), checkpoint_path)\n\nswanlab.log(\n    {\n        \"best\u002Fval_accuracy\": best_val_accuracy,\n        \"artifacts\u002Fcheckpoint_path\": swanlab.Text(checkpoint_path),\n    }\n)\n```\n\n### 4. Use Local Mode for Offline-First Workflows\n\n```python\nrun = swanlab.init(project=\"offline-demo\", mode=\"local\", logdir=\".\u002Fswanlog\")\n# ... training code ...\nrun.finish()\n\n# Inspect later with: swanlab watch -l .\u002Fswanlog\n```\n\n### 5. Keep Advanced Patterns in References\n\n- Use [references\u002Fvisualization.md](references\u002Fvisualization.md) for advanced chart and media patterns\n- Use [references\u002Fintegrations.md](references\u002Fintegrations.md) for callback-based and framework-specific integration details\n\n## Resources\n\n- [Official docs (Chinese)](https:\u002F\u002Fdocs.swanlab.cn)\n- [Official docs (English)](https:\u002F\u002Fdocs.swanlab.cn\u002Fen)\n- [GitHub repo](https:\u002F\u002Fgithub.com\u002FSwanHubX\u002FSwanLab)\n- [Self-hosted repo](https:\u002F\u002Fgithub.com\u002FSwanHubX\u002Fself-hosted)\n\n## See Also\n\n- [references\u002Fintegrations.md](references\u002Fintegrations.md) - Framework-specific examples\n- [references\u002Fvisualization.md](references\u002Fvisualization.md) - Charts and media logging patterns\n\n## Agent operating procedure\n\n1. **Check the environment.** Confirm hardware, framework and server versions, model format, and expected load.\n2. **Pin down the inputs.** Confirm formats, identifiers and parameters from the data or the user. Ask rather than guess any value that changes the result.\n3. **Run a small version first.** Serve or log a single request or run end to end before scaling.\n4. **Execute the full task** using the instructions and references above.\n5. **Validate the result.** Measure latency, throughput and output correctness against a reference; check resource usage and costs.\n6. **Report.** State what was run (versions, commands, parameters), what was checked, and what is still uncertain.\n\n| If this happens | Do this |\n|---|---|\n| The server fails to start or OOMs | Check model size versus memory, quantization and parallelism settings. |\n| A function, flag or endpoint in these instructions is missing in the installed version | Check the installed version's own documentation (`help()`, `--help`, official docs), adapt, and tell the user. Never invent an API. |\n| A required input, identifier or parameter is ambiguous | Ask the user, or state the assumption explicitly before running. |\n\n**Integrity rules**\n\n- Never fabricate results, parameters, identifiers, citations or statistics. If something cannot be run or verified, say so plainly.\n- Do not expose services or credentials publicly; confirm cloud costs before provisioning.\n- Treat version-specific details here as possibly outdated: confirm them against the official documentation for the installed version.\n- Ask before actions that cost money, consume shared GPUs or cloud quota, touch personal or patient data, or cannot be undone.\n",{"name":5,"license":15,"metadata":24,"description":7},{"tags":25,"version":26,"category":27,"maintainer":28,"dependencies":29},"MLOps, SwanLab, Experiment Tracking, Open Source, Visualization, PyTorch, Transformers, PyTorch Lightning, Fastai, Self-Hosted","1.0.0","ml-inference-and-ops","Kalaris Labs","swanlab>=0.7.11, pillow>=9.0.0, soundfile>=0.12.0","main","29fe36d26127205057d5e0ed8425f6b0e9a8c13a","skills\u002Fexperiment-tracking-swanlab",16,"https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills","https:\u002F\u002Fdocs.kalarislabs.com\u002Fresearch-agent-skills","https:\u002F\u002Fgithub.com\u002FKalarisLabs","kalarislabs.com","Applied AI lab building the infrastructure for the agentic era","2026-11-14 17:49:08",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add KalarisLabs\u002Fresearch-agent-skills --skill experiment-tracking-swanlab",{"tool":46,"command":47},"bunx","bunx skills add KalarisLabs\u002Fresearch-agent-skills --skill experiment-tracking-swanlab",{"tool":49,"command":50},"pnpm","pnpm dlx skills add KalarisLabs\u002Fresearch-agent-skills --skill experiment-tracking-swanlab","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fexperiment-tracking-swanlab\u002FSKILL.md",true,[54,60],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fintegrations.md","REFERENCE","参考文档",8017,"https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fexperiment-tracking-swanlab\u002Freferences\u002Fintegrations.md",{"path":61,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fvisualization.md",5796,"https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fexperiment-tracking-swanlab\u002Freferences\u002Fvisualization.md",[65,72,79,86,93,100],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M74Z8MGT305R11SNY5G28QH5","plos","Prepare manuscripts for PLOS journals (PLOS ONE, PLOS Biology, PLOS Computational Biology, PLOS Genetics, PLOS Medicine, PLOS Pathogens, PLOS Neglected Tropical Diseases, PLOS Global Public Health and others), covering structure, abstract and author summary, Vancouver-style references, the mandatory data availability policy, ethics and financial disclosure statements, figure requirements (PACE), the PLOS LaTeX template, reporting guidelines and PLOS ONE's publication criteria. Use when targeting any PLOS journal or checking compliance with PLOS policies.","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fplos\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M74Z8CCN9APXYHNQ95V1EBGT","pkpd-modeling","Pharmacokinetic and pharmacodynamic modelling and simulation - non-compartmental analysis, compartmental and population PK, PK\u002FPD and exposure-response, TMDD, PBPK orientation, bioequivalence, allometric scaling and first-in-human dose, drug interaction prediction, and Bayesian therapeutic drug monitoring. Use when analysing concentration-time data, deriving exposure metrics, fitting PK or PD models, or evaluating dosing regimens. Triggers include \"pharmacokinetics\", \"pharmacodynamics\", \"PK\u002FPD\", \"NCA\", \"non-compartmental\", \"AUC\", \"Cmax\", \"lambda z\", \"half-life\", \"clearance\", \"volume of distribution\", \"compartmental model\", \"population PK\", \"popPK\", \"NONMEM\", \"nlmixr2\", \"Pharmpy\", \"Monolix\", \"exposure-response\", \"Emax\", \"EC50\", \"indirect response\", \"effect compartment\", \"TMDD\", \"PBPK\", \"bioequivalence\", \"RSABE\", \"ABEL\", \"allometric scaling\", \"first-in-human\", \"MABEL\", \"drug-drug interaction\", \"DDI\", \"ICH M12\", \"concentration-QTc\", \"therapeutic drug monitoring\", \"MIPD\", and \"dosing regimen\".","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpkpd-modeling\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M74Z86YHJJ1FM3X87BHN76KZ","pinecone","Guides use of Pinecone, a managed serverless vector database, through its Python client and the LangChain and LlamaIndex integrations. Covers creating indexes, upserting and querying vectors, metadata filtering, namespaces, hybrid dense and sparse search, index management, and deleting vectors. Use when building a production RAG system on a hosted vector store, adding semantic search or recommendations without running infrastructure, isolating per-user or per-tenant data with namespaces, combining dense and sparse vectors in one query, or filtering results by metadata. Do not use for self-hosted or local stores (Chroma, Weaviate) or offline similarity search (FAISS).","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpinecone\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M74Z80T6E89SAJ8MYDD0767Q","pi-agent","Build with and use Pi, the minimal terminal coding harness. Use for installing Pi, configuring providers\u002Fmodels\u002Fsettings\u002Fenvironment variables, creating Pi skills\u002Fextensions\u002Fpackages\u002Fthemes\u002Fprompt templates, embedding Pi through the SDK, integrating over RPC or JSON event streams, parsing sessions, running local models through the llama.cpp router, developing custom Pi providers and TUI components, or using ecosystem packages such as pi-subagents (delegation\u002Forchestration), pi-mcp-adapter (MCP servers), pi-interview (interactive forms), and pi-web-access (web search, fetching, video understanding).","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpi-agent\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M74Z7WF1Y8Q3VFAQPPPRAFMV","phoenix-observability","Open-source AI observability platform for LLM tracing, evaluation, and monitoring. Use when debugging LLM applications with detailed traces, running evaluations on datasets, or monitoring production AI systems with real-time insights.","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fphoenix-observability\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M74Z7HNEH1A2AVYR3G1X2QV6","peft-fine-tuning","Fine-tunes LLMs with Hugging Face PEFT, using LoRA, QLoRA, IA3, AdaLoRA, prefix tuning, and prompt tuning so that under 1% of parameters are trained. Covers rank, alpha, and target module selection, loading and merging adapters, multi-adapter serving, and integration with TRL SFTTrainer, Axolotl, and vLLM. Use when fine-tuning 7B-70B models on limited GPU memory, when running QLoRA on a single 24GB GPU, when choosing LoRA rank and alpha, when merging or swapping adapters on one base model, or when debugging CUDA OOM or an adapter that does not apply. Not for full fine-tuning of small models under 1B parameters or cases needing all weights updated.","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpeft-fine-tuning\u002FSKILL.md",[],[]]