TRL documentation

Trackio Integration

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.23.0).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Trackio Integration

Trackio is a lightweight, free experiment tracking library built on top of 🤗 Datasets and 🤗 Spaces. It is the recommended tracking solution for TRL and comes natively integrated with all trainers.

To enable logging, simply set report_to="trackio" in your training config:

from trl import SFTConfig  # works with any trainer config (e.g. DPOConfig, GRPOConfig, etc.)

training_args = SFTConfig(
    ...,
    report_to="trackio",  # enable Trackio logging
)

Organizing Your Experiments with Run Names and Projects

By default, Trackio will generate a name to identify each run. However, we highly recommend setting a descriptive run_name to make it easier to organize experiments. For example:

from trl import SFTConfig

training_args = SFTConfig(
    ...,
    report_to="trackio",
    run_name="sft_qwen3-4b_lr2e-5_bs128",  # descriptive run name
)

You can also group related experiments by project by setting the following environment variable:

export TRACKIO_PROJECT="my_project"

Hosting Your Logs on 🤗 Spaces

Trackio has local-first design, meaning your logs stay on your machine. If you’d like to host them and deploy a dashboard on 🤗 Spaces, set:

export TRACKIO_SPACE_ID="username/space_id"

Running the following example:

import os
from trl import SFTConfig, SFTTrainer
from datasets import load_dataset

os.environ["TRACKIO_SPACE_ID"] = "trl-lib/trackio"
os.environ["TRACKIO_PROJECT"] = "trl-documentation"

trainer = SFTTrainer(
    model="Qwen/Qwen3-0.6B",
    train_dataset=load_dataset("trl-lib/Capybara", split="train"),
    args=SFTConfig(
        report_to="trackio",
        run_name="sft_qwen3-0.6b_capybara",
    ),
)
trainer.train()

will give you a hosted dashboard at https://huggingface.co/spaces/trl-lib/trackio.

< > Update on GitHub