Log metrics

July 24, 2026 · View on GitHub

SwanLab

An Professional, Modern-Designed AI Training Analysis Platform
For Model Training Teams, Integrated with 50+ Leading AI Training Frameworks, Easily Combined with Your Experimental Code

🔥SwanLab Online · 📃 Documentation · Report Issues · Feedback · Changelog · SKILL


中文 / English / 日本語 / Русский

👋 Join our WeChat Group

Table of Contents


🌟 Recent Updates

  • 2026.06.16: 📊 Added HTML charts, supporting pages embedded after LLM Vibe Coding; the Kubernetes deployment Prometheus log monitoring solution is now available;

  • 2026.06.05: ⚡️ The refactored SDK (v0.8.0) is now available, significantly improving metric logging performance for large-scale training; SwanLab CLI and Skill are now available for the AutoResearch paradigm;

  • 2026.05.18: 📒 Logs now support global filtering, so you can quickly find the log snippets you need across the entire workspace; added chart copy feature; chart search now includes search history; chart details now show relative time;

  • 2026.04.28: 🪨 Project Pinning is now live — place the projects your team cares about most in the most prominent spot; improved the metric panel display when hovering over line charts;

  • 2026.03.25: 📊 Experiment Pinning is now live — pin your best experiments to the most accessible position with one click; Baseline comparison is now available, supporting comparison of experiments against a baseline with percentage difference display, accelerating the search for optimal parameters;

https://github.com/user-attachments/assets/964380e0-feb2-480d-b1ca-eba1be239ebb

  • 2026.03.19: 📊 Added experiment duplication feature, supporting the creation of experiment copies to different projects and teams; parallel mode is now available, supporting multiple processes recording metrics to the same experiment at the same time; experiment ID can now be customized;

  • 2026.02.06: 🔥swanlab.Api is now available, providing a more powerful, object-oriented open API interface, documentation; ECharts.Table supports CSV download; now supports one-click placement of charts at the top of sections;

Full Changelog
  • 2026.01.28: ⚡️ LightningBoard V2 is now available, significantly improving dashboard performance;

  • 2026.01.16: ⚡️ LightningBoard (Lightning Dashboard) V1 is now available, designed for extremely large chart number scenarios; added chart embedding link, now you can embed your charts into online documents (such as Notion, Lark, etc.);

  • 2026.01.02: 🥳 Added support for AMD ROCm and Iluvatar GPU hardware monitoring; SDK added heartbeat package feature, implementing more robust cloud/offline connection;

  • 2025.12.15: 🎉 Kubernetes Version of SwanLab is now available! Deployment Documentation; NVIDIA NeMo RL framework is now integrated with SwanLab, documentation;

  • 2025.12.01: 🕰 Added detailed line chart information display, when hovering over the line chart, clicking Shift will activate Detailed Mode, allowing the display of the log point time; 📊 Chart grouping supports MIN/MAX area range display;

  • 2025.11.17: 📊 Global chart configuration now supports X-axis data source selection and hover mode functionality, enhancing chart analysis experience; added SWANLAB_WEBHOOK functionality, documentation

  • 2025.11.06: 🔪 Experiment Grouping is live — supports grouping management for large batches of experiments; Workspace page upgraded to allow quick switching between multiple organizations; significantly improved line-chart rendering performance; swanlab.init now supports group and job_type parameters;

  • 2025.10.15: 📊 Line chart configuration now supports X-axis data source selection; sidebar now supports displaying pinned columns in table view, enhancing experiment data alignment capabilities;

  • 2025.09.22: 📊 New UI launched; table view now supports global sorting and filtering; unified data level for table view and chart view.

  • 2025.09.12: 🔢 Added support for scalar chart, flexibly displaying the statistical values of experiment indicators; organization management page has been upgraded, providing more powerful permission control and project management capabilities;

  • 2025.08.19: 🤔 Optimized chart rendering performance, allowing researchers to focus more on experiment analysis; integrated excellent MLX-LM and SpecForge frameworks, providing more training scenarios;

  • 2025.08.06: 👥 Training Collaboration is now available, supporting inviting project collaborators, sharing project links and QR codes; the workspace now supports list view, and project Tags are now displayed;

  • 2025.07.29: 🚀 Added support for experiment filtering and sorting in the sidebar; 📊 Added column control panel to the table view, allowing easy hiding and displaying of columns; 🔐 Added support for managing multiple API Keys, making your data more secure; swanlab sync now supports training crash log files; PR curve, ROC curve, confusion matrix are now available, documentation;

  • 2025.07.17: 📊 Added support for line chart configuration, supporting flexible configuration of line type, color, thickness, grid, legend position, etc.; 📹 Added support for swanlab.Video data type, supporting recording and visualizing GIF format files; Global chart dashboard now supports configuring Y-axis and maximum number of experiments displayed.

  • 2025.07.10: 📚 Added support for text view, supporting Markdown rendering and direction key switching, which can be created by swanlab.echarts.table and swanlab.Text, Demo

  • 2025.07.06: 🚄 Added support for resume training; new plugin File Logger; integrated ray framework, documentation; integrated ROLL framework, thanks to @PanAndy, documentation

  • 2025.06.27: Added support for small line chart zooming; added support for configuring single line chart smoothing; significantly improved the interaction effect of image charts after zooming.

  • 2025.06.20: 🤗 Integrated the accelerate framework, PR, documentation, enhancing the experience of recording and analyzing experiments in distributed training.

  • 2025.06.18: 🐜 Integrated the AREAL framework, thanks to @xichengpro, PR, documentation; 🖱 Added support for highlighting corresponding curves when hovering the mouse over sidebar experiments; Added support for cross-group comparison line charts; Added support for setting experiment name trimming rules;

  • 2025.06.11: 📊 Added support for swanlab.echarts.table data type, supporting pure text chart display; added support for stretch interaction for groups, allowing more charts to be displayed at the same time; added maximum/minimum value options for table views;

  • 2025.06.08: ♻️ Added support for storing complete experiment log files locally and uploading them to the cloud/private deployment via swanlab sync; Hardware monitoring now supports Hygon DCU;

  • 2025.06.01: 🏸 Added support for chart free dragging; added support for ECharts custom chart; added support for PaddleNLP framework; hardware monitoring supports MetaX GPU;

  • 2025.05.25: Logging now supports capturing the standard error stream, allowing better recording of output from frameworks like PyTorch Lightning; hardware monitoring now includes support for Moore Threads; added a security feature for logging runtime commands, where API Keys will be automatically hidden.

  • 2025.05.14: Added support for experiment tags; added support for Log Scale for line charts; added support for group dragging; significantly optimized the experience of uploading a large number of metrics.

  • 2025.05.09: Added support for line chart creation; enhanced the chart configuration feature with data source selection, enabling a single chart to display different metrics; introduced the ability to generate GitHub badges for training projects.

  • 2025.04.23: Added support for editing line charts, allowing free configuration of X and Y axis data ranges and title styles; chart search now supports regular expressions; added hardware detection and monitoring for Kunlun Core XPU.

  • 2025.04.11: Added support for local selection for line charts; supports the step range of the current graph.

  • 2025.04.08: Added support for the swanlab.Molecule data type, enabling recording and visualization of biochemical molecular data; also supports saving the state of sorting, filtering, and column order changes in table views.

  • 2025.04.07: We completed joint integration with EvalScope. Now you can use SwanLab in EvalScope to evaluate LLM performance.

  • 2025.03.30: Added support for the swanlab.Settings method, enabling more precise control over experiment behavior; added support for Cambricon MLU hardware monitoring; integrated Slack notifications and Discord notifications.

  • 2025.03.21: 🎉🤗 HuggingFace Transformers has officially integrated SwanLab (version >=4.50.0), #36433; Added Object3D chart support, now you can track and visualize 3D point clouds, docs; Hardware monitoring supports the recording of GPU memory (MB), disk utilization, and network sent and received.

  • 2025.03.12: 🎉🎉 The Privatized Deployment Edition of SwanLab is now available!! 🔗 Deployment Documentation; SwanLab now supports plugin extensions, such as Email Notification and Lark Notification.

  • 2025.03.09: Added experiment sidebar width support; added external Git code button; added sync_mlflow feature, supporting synchronization with mlflow framework.

  • 2025.03.06: We completed integration with DiffSynth Studio. Now you can use SwanLab in DiffSynth Studio to track and visualize Diffusion model text-to-image/video experiments. Usage Guide

  • 2025.03.04: Added MLFlow feature, supporting conversion of MLFlow experiments to SwanLab experiments. Usage Guide

  • 2025.03.01: Added move experiment feature, now you can move experiments to different projects in different organizations.

  • 2025.02.24: We completed integration with EasyR1. Now you can use SwanLab in EasyR1 to track and visualize large model fine-tuning experiments. Usage Guide.

  • 2025.02.18: We completed integration with Swift. Now you can use SwanLab in Swift's CLI/WebUI to track and visualize large model fine-tuning experiments. Usage Guide.

  • 2025.02.16: Added chart moving group and create group features.

  • 2025.02.09: We completed integration with veRL. Now you can use SwanLab in veRL to track and visualize large model reinforcement learning experiments. Usage Guide.

  • 2025.02.05: swanlab.log supports nested dictionaries #812, adapting Jax framework features; supports name and notes parameters.

  • 2025.01.22: Added sync_tensorboardX and sync_tensorboard_torch features, supporting synchronization of experiment tracking with these two TensorBoard frameworks.

  • 2025.01.17: Added sync_wandb feature, docs, supporting synchronization with Weights & Biases experiment tracking; significantly improved log rendering performance.

  • 2025.01.11: The cloud version enhanced project table performance with drag-and-drop, sorting, and filtering support.

  • 2025.01.01: Added persistent smoothing for line charts and drag-to-resize functionality for line charts, improving chart browsing experience.

  • 2024.12.22: We completed integration with LLaMA Factory. Now you can use SwanLab in LLaMA Factory to track and visualize large model fine-tuning experiments. Usage Guide.

  • 2024.12.15: Hardware Monitoring (0.4.0) is now available, supporting system-level information recording and monitoring for CPU, NPU (Ascend), and GPU (Nvidia).

  • 2024.12.06: Added integration with LightGBM and XGBoost; increased the limit for single-line log length.

  • 2024.11.26: Environment tab - Hardware section now supports identifying Huawei Ascend NPU and Kunpeng CPU; cloud provider section now supports identifying QingCloud Jishi Computing.


👋🏻 What is SwanLab

SwanLab is an open-source, lightweight AI model training tracking and visualization tool, providing a platform for tracking, recording, comparing, and collaborating on experiments.

SwanLab is designed for AI researchers, offering a friendly Python API and a beautiful UI interface, and providing features such as training visualization, automatic logging, hyperparameter recording, experiment comparison, and multi-user collaboration. With SwanLab, researchers can identify training issues through intuitive visual charts, compare multiple experiments to find research inspiration, and break down team communication barriers through online web sharing and multi-user collaborative training within organizations, improving organizational training efficiency.

https://github.com/user-attachments/assets/7965fec4-c8b0-4956-803d-dbf177b44f54

Here is a list of its core features:

1. 📊 Experiment Metrics and Hyperparameter Tracking: Minimal code integration into your machine learning pipeline to track and record key training metrics.

swanlab-architecture

  • 🌸 Visualizing the Training Process: By visualizing experiment tracking data through the UI interface, trainers can intuitively observe the results at each step of the experiment, analyze metric trends, and determine which changes led to improved model performance—ultimately enhancing the overall efficiency of model iteration.

swanlab-table

  • Supports hyperparameter recording and table display.

  • Supported metadata types: Scalar metrics, images, audio, text, 3D point clouds, biological chemical molecules, Echarts custom chart...

  • Resume Training Record: Supports recording new metrics data to the same experiment after training is completed/interrupted.

swanlab-molecule

  • Supported chart types: Line charts, media charts (images, audio, text, 3D point clouds, biological chemical molecules), Bar charts, Scatter charts, Box plots, Heat maps, Pie charts, Radar charts, Custom charts...

swanlab-echarts

  • Text Chart: A text chart for large language model training, supporting Markdown rendering.

text-chart

  • Automatic background logging: Logging, hardware environment, Git repository, Python environment, Python library list, project runtime directory.

2. ⚡️ Comprehensive Framework Integration: PyTorch, 🤗HuggingFace Transformers, PyTorch Lightning, 🦙LLaMA Factory, MMDetection, Ultralytics, PaddleDetection, LightGBM, XGBoost, Keras, Tensorboard, Weights&Biases, Swift, XTuner, Stable Baseline3, Hydra, and more, totaling 30+ frameworks.

3. 💻 Hardware Monitoring: Supports real-time recording and monitoring of system-level hardware metrics for CPU, NPU (Ascend), GPU (Nvidia), AMD (ROCm), MLU (Cambricon), XLU (Kunlunxin), DCU (Hygon), MetaX GPU (Moxing), Moore Threads GPU (Moore Threads), Iluvatar GPU (Iluvatar), and memory.

4. 📦 Experiment Management: Through a centralized dashboard designed for training scenarios, quickly overview and manage multiple projects and experiments.

5. 🆚 Result Comparison: Compare hyperparameters and results of different experiments through online tables and comparison charts to uncover iteration insights.

6. 👥 Online Collaboration: Collaborate with your team on training, supporting real-time synchronization of experiments under a single project. You can view team training records online and provide feedback and suggestions based on results.

7. ✉️ Share Results: Copy and send persistent URLs to share each experiment, easily send to partners, or embed in online notes.

8. 💻 Self-Hosting Support: Supports offline usage, and the self-hosted community edition also allows viewing dashboards and managing experiments.

9. 🔌 Plugin Extensions: Supports extending SwanLab's usage scenarios through plugins, such as Lark Notifications, Slack Notifications, CSV Logger, etc.

Important

Star the project to receive all release notifications from GitHub without delay ~ ⭐️

star-us


📃 Online Demo

Check out SwanLab's online demos:

ResNet50 Cat-Dog ClassificationYolov8-COCO128 Object Detection
Track a simple ResNet50 model training on a cat-dog dataset for image classification.Use Yolov8 on the COCO128 dataset for object detection, tracking training hyperparameters and metrics.
Qwen2 Instruction Fine-TuningLSTM Google Stock Prediction
Track Qwen2 large language model instruction fine-tuning for simple instruction following.Use a simple LSTM model on Google stock price dataset to predict future stock prices.
ResNeXt101 Audio ClassificationQwen2-VL COCO Dataset Fine-Tuning
Progressive experimental process from ResNet to ResNeXt on audio classification tasks.Fine-tune Qwen2-VL multimodal large model on COCO2014 dataset using Lora.
EasyR1 multimodal LLM RL TrainingQwen2.5-0.5B GRPO Training
Use EasyR1 framework for multimodal LLM RL trainingFine-tune Qwen2.5-0.5B model on GSM8k dataset using GRPO.

More Examples


🏁 Quick Start

1. Installation

pip install swanlab
Install from Source

If you want to experience the latest features, you can install from the source code.

# Method 1
git clone https://github.com/SwanHubX/SwanLab.git
pip install -e .

# Method 2
pip install git+https://github.com/SwanHubX/SwanLab.git
Dashboard Extension Installation

Dashboard Extension Documentation

pip install 'swanlab[dashboard]'

2. Login and Get API Key

  1. Register for free at SwanLab.

  2. Log in, and copy your API Key from User Settings > API Key.

  3. Open the terminal and enter:

swanlab login

When prompted, enter your API Key, press Enter, and complete the login.

3. Integrate SwanLab with Your Code

import swanlab

# Initialize a new SwanLab experiment
swanlab.init(
    project="my-first-ml",
    config={'learning-rate': 0.003},
)

# Log metrics
for i in range(10):
    swanlab.log({"loss": i, "acc": i})

Done! Head over to SwanLab to view your first SwanLab experiment.


💻 Self-Hosted

The self-hosted community edition supports offline viewing of the SwanLab dashboard.

swanlab-kubernetes

Detailed deployment documentation:


🔥 Tutorials

Excellent Open-Source Tutorial Projects Using SwanLab:

  • happy-llm: A tutorial on the principles and practice of large language models from scratch. GitHub Repo stars
  • self-llm: "A Cookbook for Open-Source Large Models" - A tutorial tailored for Chinese users on quickly fine-tuning (full-parameter/LoRA) and deploying domestic and international open-source Large Language Models (LLMs) / Multi-modal Large Models (MLLMs) in a Linux environment. GitHub Repo stars
  • Minimind: 🌏 Train a 26M-parameter GPT from scratch in just 2h! GitHub Repo stars
  • unlock-deepseek: Interpretation, extension, and reproduction of the DeepSeek series of works. GitHub Repo stars
  • Qwen3-SmVL: The visual head of SmolVLM2 was concatenated and fine-tuned with the Qwen3-0.6B model. GitHub Repo stars
  • OPPO/Agent_Foundation_Models: Chain-of-Agents: A chain-of-agents model through multi-agent distillation and agent RL. GitHub Repo stars
  • Tree-GRPO: [ICLR 2026] Tree Search for LLM Agent Reinforcement Learning GitHub Repo stars
  • llm-agent-rl-lab: Reproducing and studying RL algorithms for LLM agents, including PPO, GRPO, GSPO, DAPO, OPD and beyond. GitHub Repo stars

Excellent Research Papers Using SwanLab:

Tutorial Articles:


🚗 Framework Integration

Use your favorite frameworks with SwanLab!
Below is a list of frameworks we have integrated. Feel free to submit an Issue to request integration for your desired framework.

Basic Frameworks

LLM Training Frameworks

LLM Reinforcement Learning Frameworks

Robot Frameworks

Text-to-Image/Video Training Frameworks

Deep Learning Frameworks

Computer Vision Frameworks

Machine Learning Frameworks

Evaluation Frameworks

Traditional Reinforcement Learning Frameworks

Other Frameworks:

More Integrations


🔌 Plugins

Enhance your experiment management experience by extending SwanLab's functionality through plugins!


🎮 Hardware Monitoring

SwanLab records the hardware information and resource usage during AI training. Below is a table of supported hardware:

HardwareInfo LoggingResource MonitoringScript
NVIDIA GPUnvidia.py
AMD GPUamd.py
Ascend NPUascend.py
Cambricon MLUcambricon.py
Kunlunxin XPUkunlunxin.py
MooreThread GPUmoorethreads.py
MetaX GPUmetax.py
Iluvatar GPUiluvatar.py
Hygon DCUhygon.py
CPUcpu.py
Memorymemory.py

If you wish to document other hardware, feel free to submit an Issue or PR!


🆚 Comparison with Familiar Tools

Tensorboard vs SwanLab

  • ☁️ Online Support: SwanLab allows convenient cloud-based synchronization and storage of training experiments, enabling remote viewing of training progress, managing historical projects, sharing experiment links, sending real-time notifications, and multi-device experiment viewing. Tensorboard, on the other hand, is an offline experiment tracking tool.

  • 👥 Multi-User Collaboration: SwanLab facilitates multi-user, cross-team machine learning collaboration by easily managing team training projects, sharing experiment links, and enabling cross-space discussions. Tensorboard is primarily designed for individual use, making multi-user collaboration and experiment sharing difficult.

  • 💻 Persistent, Centralized Dashboard: Regardless of where you train your models—on a local computer, a lab cluster, or a public cloud GPU instance—your results are recorded in the same centralized dashboard. TensorBoard requires time-consuming copying and management of TFEvent files from different machines.

  • 💪 More Powerful Tables: SwanLab tables allow you to view, search, and filter results from different experiments, making it easy to review thousands of model versions and identify the best-performing models for different tasks. TensorBoard is not suitable for large-scale projects.

Weights and Biases vs SwanLab

  • Weights and Biases is a closed-source MLOps platform that requires an internet connection.

  • SwanLab not only supports online usage but also offers an open-source, free, self-hosted version.


👥 Community

Repositories

  • self-hosted: The repository for private deployment scripts.
  • SwanLab-Docs: The official documentation repository.
  • SwanLab-Dashboard: The offline dashboard repository, which contains the web code for the lightweight offline dashboard opened by swanlab watch.

Community and Support

  • GitHub Issues: Errors and issues encountered while using SwanLab.
  • Email Support: Feedback and questions about using SwanLab.
  • WeChat Group: Discuss SwanLab usage and share the latest AI technologies.

SwanLab README Badge

If you enjoy using SwanLab in your work, please add the SwanLab badge to your README:

[![](https://raw.githubusercontent.com/SwanHubX/assets/main/badge2.svg)](your experiment url)
[![](https://raw.githubusercontent.com/SwanHubX/assets/main/badge1.svg)](your experiment url)

More design materials: assets

Citing SwanLab in Papers

If you find SwanLab helpful in your research journey, please consider citing it in the following format:

@software{Zeyilin_SwanLab_2023,
  author = {Zeyi Lin, Shaohong Chen, Kang Li, Qiushan Jiang, Zirui Cai,  Kaifang Ji and {The SwanLab team}},
  doi = {10.5281/zenodo.11100550},
  license = {Apache-2.0},
  title = {{SwanLab}},
  url = {https://github.com/swanhubx/swanlab},
  year = {2023}
}

Contributing to SwanLab

Considering contributing to SwanLab? First, take a moment to read the Contribution Guide.

We also greatly appreciate support through social media, events, and conference sharing. Thank you!


Contributors


📃 License

This repository is licensed under the Apache 2.0 License.

Star History

Star History Chart