Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

trl-training

Skill by waybarrios

Guides an AI assistant through training and fine-tuning transformer language models with the TRL library. It covers SFT, DPO, GRPO, RLOO and reward model training via CLI commands, for ML developers.

  • Score 83
  • 558 stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install trl-training

Built from the published package, never by AI.

git clone --depth 1 https://github.com/waybarrios/opencode-power-pack /tmp/opencode-power-pack && mkdir -p ~/.claude/skills && cp -r /tmp/opencode-power-pack/skills/trl-training ~/.claude/skills/trl-training

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install trl-training in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

The trl-training skill tells an AI assistant how to use the TRL (Transformers Reinforcement Learning) library to train and fine-tune large language models. It covers the trl CLI commands for supervised fine-tuning (SFT), Direct Preference Optimization (DPO), GRPO, RLOO and reward model training. Each command comes with example invocations, including options for LoRA adapters.

The skill also explains YAML config files for reproducible runs, distributed training through Accelerate with predefined configs such as zero2 and fsdp2, and troubleshooting for memory, dataset, model loading and slow training issues. The source notes that TRL is built on Hugging Face Transformers and Accelerate. It is aimed at developers and ML practitioners who want to post-train foundation models.

Written from the project's SKILL.md and checked against it.

What it can do

  • trl sftSupervised fine-tuning on instruction-following or conversational datasets, with optional LoRA.
  • trl dpoDirect Preference Optimization using chosen and rejected preference pairs.
  • trl grpoGroup Relative Policy Optimization using reward functions or LLM-as-a-judge.
  • trl rlooReinforce Leave One Out online RL training with generation-based rewards.
  • trl rewardTrain reward models for RLHF, with optional LoRA using SEQ_CLS task type.
  • YAML config filesRun training from a config file and override individual values on the command line.
  • Distributed trainingMulti-GPU and multi-node runs via Accelerate, including zero1 to zero3, fsdp1 and fsdp2 configs.
  • Troubleshooting guidanceAdvice for CUDA out-of-memory errors, dataset and model loading problems, and slow training.

What you need

  • TRL library with the trl command-line tool
  • Hugging Face Hub access for datasets and models
  • Hugging Face account authentication for gated models
  • Hub access token for --push_to_hub

Try asking

  • Write a trl sft command to fine-tune Qwen2-0.5B with LoRA adapters.
  • Set up a DPO training run on ultrafeedback_binarized with LoRA.
  • Create a YAML config for trl sft and run it with zero2 Accelerate config.

Good to know

  • Gated models require Hugging Face authentication before training.
  • Example settings target small models such as Qwen2-0.5B and are meant as starting points.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/trl-training/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md8 KB

Alternatives to trl-training

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

trl-training: common questions

What training methods does the trl-training skill cover?

The skill covers SFT, DPO, GRPO, RLOO and reward model training, each run through a trl CLI command. The source also lists KTO in its description, but the body does not document a separate kto command.

Does it support LoRA training?

Yes. The examples for sft, dpo and reward include a --use_peft option with LoRA settings such as --lora_r and --lora_alpha.

How does it handle multi-GPU training?

TRL integrates with Accelerate. The skill lists predefined configs including single_gpu, multi_gpu, fsdp1, fsdp2, zero1, zero2 and zero3.

How do I install trl-training?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is trl-training free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is trl-training safe to use?

It scores 83 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to trl-training?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

trl-training Install

Add to stack

Loading.