Skip to content

docs: add TRL integration guide#537

Merged
abidlabs merged 8 commits into
mainfrom
trl-docs
Apr 27, 2026
Merged

docs: add TRL integration guide#537
abidlabs merged 8 commits into
mainfrom
trl-docs

Conversation

@abidlabs
Copy link
Copy Markdown
Member

@abidlabs abidlabs commented Apr 27, 2026

  • Add a TRL integration page (docs/source/trl_integration.md) mirroring the Transformers guide, with a runnable SFTTrainer snippet and project/space configuration example.
  • Add examples/trl-integration.py, a complete end-to-end SFT example using a tiny test model that runs in well under a minute. Verified locally.
  • Rename the Integration section sidebar titles to "Running with Transformers", "Running with TRL", and "Running with RapidFire AI" so the docs are easier to find from the table of contents (per Aksel's suggestion).

For ML-Intern -- see internal context: https://huggingface.slack.com/archives/C08SW1X12C8/p1777305610753559?thread_ts=1777063926.876859&cid=C08SW1X12C8

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gradio-pr-bot
Copy link
Copy Markdown
Contributor

gradio-pr-bot commented Apr 27, 2026

🪼 branch checks and previews

Name Status URL
🦄 Changes detected! Details

@gradio-pr-bot
Copy link
Copy Markdown
Contributor

🦄 no changes detected

This Pull Request does not include changes to any packages.

__No changes detected. __



‼️ Changeset not approved. Ensure the version bump is appropriate for all packages before approving.

  • Maintainers can approve the changeset by checking this checkbox.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can create the changelog file directly.

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

HuggingFaceDocBuilderDev commented Apr 27, 2026

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview

Install Trackio from this PR (includes built frontend)

pip install "https://huggingface.co/buckets/trackio/trackio-wheels/resolve/adaeee3b8988f7ee72e419f9d478ceee1a591689/trackio-0.25.1-py3-none-any.whl"

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Comment thread docs/source/trl_integration.md Outdated
@abidlabs abidlabs marked this pull request as ready for review April 27, 2026 16:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds documentation and a runnable example demonstrating Trackio’s native integration with Hugging Face TRL trainers, and updates the docs sidebar labels to make integration guides easier to discover.

Changes:

  • Add a new TRL integration doc page with an SFTTrainer snippet and configuration example.
  • Add an end-to-end examples/trl-integration.py script intended to run quickly with a tiny test model.
  • Rename Integration section sidebar titles for better discoverability and add the TRL page to the toctree.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
examples/trl-integration.py Adds a runnable TRL SFT example configured to report to Trackio.
docs/source/trl_integration.md New TRL integration documentation page mirroring the Transformers guide structure.
docs/source/_toctree.yml Updates Integration section titles and includes the new TRL integration page.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/trl-integration.py Outdated
# "trl>=1.2.0",
# "datasets>=4.4.0",
# "transformers[torch]>=5.0.0rc2",
# "huggingface_hub>=1.0.0",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — removed. Also dropped datasets and transformers[torch] since trl already pulls them in transitively.

Copy link
Copy Markdown
Collaborator

@qgallouedec qgallouedec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool!

Comment thread docs/source/trl_integration.md Outdated
Comment thread examples/trl-integration.py Outdated
Comment thread examples/trl-integration.py Outdated
Comment thread examples/trl-integration.py Outdated
Comment thread examples/trl-integration.py Outdated
Comment on lines +5 to +6
# "datasets>=4.4.0",
# "transformers[torch]>=5.0.0rc2",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is needed: trl already depends on datasets, transformers and torch

abidlabs and others added 4 commits April 27, 2026 09:13
Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com>
Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com>
Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com>
Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@qgallouedec qgallouedec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually wait!

Addresses Copilot's note that huggingface_hub is unused, and qgallouedec's
note that datasets/transformers/torch are already pulled in via trl.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread examples/trl-integration.py Outdated
Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com>
@abidlabs
Copy link
Copy Markdown
Member Author

Thanks so much @qgallouedec for the cleanup!

@abidlabs
Copy link
Copy Markdown
Member Author

Confirmed example runs locally for me, merging when CI is green to get the docs live

@abidlabs abidlabs merged commit e3642f6 into main Apr 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants