Data & Analysis

TRL Language Model Trainer

Train and fine-tune transformer language models with TRL’s CLI for SFT, preference alignment, and reinforcement learning.

48/ 100
Use with care

Useful, but reliability, evidence or controls still have material gaps.

See how it was scored ↓
Works as-is in
Codex · Claude Code
Stars
★ 11k
Last updated
18d ago
License
Apache-2.0
trltransformer-trainingreinforcement-learningsupervised-fine-tuning
+4dpogrpoloraaccelerate

What does this skill do, and when should you use it?

This skill helps agents use Hugging Face TRL to train and fine-tune transformer language models. It covers SFT, DPO, GRPO, RLOO, and reward-model training with executable CLI examples. It also documents LoRA adapters, YAML configuration, Accelerate-based distributed training, and troubleshooting guidance. It fits users who already have models and datasets and want a structured post-training workflow within the Hugging Face ecosystem.

Runs trl sft, trl dpo, trl grpo, trl kto, trl rloo, and trl reward; reads models and datasets from the Hugging Face Hub or local paths; configures learning rates, batch sizes, evaluation, LoRA, and output directories; launches reproducible runs from YAML files; uses Accelerate for multi-GPU, multi-node, FSDP, or DeepSpeed ZeRO training; pushes results to the Hub; and provides troubleshooting guidance for CUDA out-of-memory errors, dataset loading, model loading, slow training, and generation issues.

Good fit
  • A researcher turning a base model into an instruction-following or conversational model can use the SFT workflow and examples.
  • An alignment engineer with chosen/rejected preference pairs can use the DPO command for direct preference optimization.
  • A team evaluating generations with reward functions or an LLM judge can use GRPO.
  • A researcher seeking online generation-based reinforcement learning with custom rewards can use RLOO.
  • A team building an RLHF pipeline can use the reward command to train a reward model.
  • A resource-constrained user or experimenter needing reproducibility can combine LoRA, YAML configuration, and Accelerate.

How do you install this skill?

Before you use it
  • Before using --push_to_hub, confirm upload scope, credential permissions, repository visibility, and sensitive-data risks; rollback or revocation guidance is absent.
  • Verify installed TRL, Transformers, Accelerate, PEFT, hardware, and CLI versions before execution because examples may become invalid across releases.
  • Remote Hub access, authentication, large-model downloads, and external tracking may be constrained by network, account permissions, or resources; no mainland-China alternative is documented.
  • Validate dataset schemas, reward functions, memory use, and outputs in an isolated small run before long or distributed training.
Before you start
Your agent needs
  • Shell / CLI
  • Network access
  • Local filesystem
Install first
  • TRL
  • Hugging Face Transformers
  • Accelerate

The repository contains 26 separate skills. Following the README’s Codex method, copy or symlink skills/trl-training/ into a standard Codex .agents/skills location, such as $REPO_ROOT/.agents/skills or $HOME/.agents/skills. A compatible Agent Skills client can then discover its SKILL.md. The supplied source does not provide installation commands for TRL itself.

Generic route: install into Claude Code manually (macOS / Linux)
tmp="$(mktemp -d)"
git clone --depth 1 https://github.com/huggingface/skills.git "$tmp"
mkdir -p ~/.claude/skills
cp -R "$tmp/skills/trl-training" ~/.claude/skills/
rm -rf "$tmp"

Generated from the source repository and skill path; it copies only this skill's folder. If the author's install steps above differ, follow those first. To scope it to one project, replace ~/.claude/skills with that project's .claude/skills.

How do you use this skill?

Try saying

Once installed, send your agent any of these to trigger it:

  • Use the trl-training skill to fine-tune Qwen/Qwen2-0.5B on trl-lib/Capybara with SFT and LoRA.

After installation, give the coding agent a specific request such as: "Use the trl-training skill to fine-tune Qwen/Qwen2-0.5B on trl-lib/Capybara with SFT and LoRA." You can also run the documented commands directly, for example trl sft --config sft_config.yaml --learning_rate 1.0e-5. Before training, confirm the model, dataset schema, hardware, and appropriate training method.

What are this skill's strengths and limitations?

Pros
  • Covers SFT, DPO, GRPO, RLOO, and reward-model training.
  • Includes full-training, LoRA, configuration-file, and distributed-training examples.
  • Provides troubleshooting guidance for memory, dataset, model-loading, speed, and generation issues.
  • Builds on TRL, Transformers, and Accelerate for Hugging Face ecosystem integration.
Limitations
  • Does not document how to install TRL, Transformers, or Accelerate.
  • Examples depend on particular models, datasets, hardware, and schemas, so direct reuse is not guaranteed for every project.
  • The SKILL.md provides no test suite, benchmark results, or platform validation evidence.
  • `kto` appears in the command metadata, but the body provides no corresponding usage example or explanation.

How does this skill compare with similar options?

Side by side with related skills; every score comes from the same FSRS standard.

Skill FS score Stars Last updated License
TRL Language Model Trainer this page 48 · Use with care ★ 11k 18d ago Apache-2.0
Cosmos Reason Video QA Fine-Tuning ✓ NVIDIA · Official 53 · Use with care ★ 3.6k 12d ago Apache-2.0
Nemotron Customization Pipelines ✓ NVIDIA · Official 57 · Use with care ★ 3.6k 12d ago Apache-2.0
Book Style SFT Pipeline 36 · Not recommended ★ 18k 15d ago MIT
Azure AI Foundry Fine-Tuning ✓ Microsoft · Official 48 · Use with care ★ 2.7k 3mo ago MIT

How did FollowSkills review this skill?

FollowSkills review · FSRS-2.0
Use with care
48/ 100 5-point scale 2.4 / 5
The upstream repository has new commits since this review. The score still applies to the reviewed revision shown and may not cover the latest changes.
1Trust14 / 25 · 2.8/5

The evidence shows CLI guidance without malware or credential-theft behavior; however, examples include --push_to_hub, remote model/dataset loading, and hf auth login. Least privilege, data flows, confirmation, sensitive-data handling, dependency security, and rollback are not documented, so points are deducted.

2Reliability8 / 20 · 2.0/5

The document covers SFT, DPO, GRPO, RLOO, reward-model training, configuration, and common troubleshooting, making the happy path plausible. It provides no committed tests for key commands, compatibility matrix, input validation, or diagnostically controlled failure behavior, so the static score remains limited.

3Adaptability8 / 15 · 2.7/5

The audience and training scenarios are reasonably clear, with several post-training methods and single-node/distributed examples. Boundaries for dataset schemas, hardware, versions, and method selection are incomplete; Chinese-language support and mainland-China network reachability are not addressed, and core use depends on external Hugging Face services.

4Convention8 / 15 · 2.7/5

The SKILL.md has clear frontmatter, progressive sections, examples, configuration, distributed-training guidance, troubleshooting, and best practices. Apache-2.0, version 1.0.0, and documentation links are present, but changelog, maintenance owner, update path, installation/dependency notes, FAQs, and known limitations are missing.

5Effectiveness6 / 15 · 2.0/5

The command examples are directly useful as starting points, especially for LoRA, YAML configuration, and troubleshooting. However, the files contain no execution evidence, quality or evaluation completeness is not established, resource cost is only lightly discussed, and users must fill in important task-specific details, so the score is deducted.

6Verifiability4 / 10 · 2.0/5

The revision includes auditable source documentation, an Apache license, and CI validating generated artifacts, providing limited evidence. The CI does not exercise TRL training paths, and there are no committed tests, real outputs, or independent corroboration; therefore static verifiability is modest.

1 2 3 4 5 6

Open a dimension to read why it scored that way

Reviewed Jul 20, 2026 Reviewed revision 86cdeee824b7 Review evidence[1][2][3][4][5]

Evidence confidence:Low — Mostly static review, author material or a limited demo; useful for discovery, not high-risk decisions.

See the full review method →

FAQ

Does this skill include the training data or GPU resources?
No. It provides command and configuration guidance; users must supply models, datasets, compute, and authentication where needed.
What should I do if training runs out of CUDA memory?
The skill recommends reducing `--per_device_train_batch_size`, increasing gradient accumulation, enabling `--use_peft` or `--gradient_checkpointing`, or using a smaller model or shorter sequence length.
Is it suitable for preference-alignment training?
Yes. The body explicitly covers DPO, GRPO, RLOO, and reward-model training, but the dataset schema should be checked for the selected method.

More skills from this repository

All from huggingface/skills

Data & Analysis

Hugging Face LLM Trainer

Train, fine-tune, and preserve models on Hugging Face cloud GPUs.

★ 11k FS 48 Use with care 18d ago
Dev & Engineering

LoRA Space Demo Builder

Build and publish a tailored Gradio Space for a Hugging Face LoRA.

★ 11k FS 51 Use with care 18d ago
Data & Analysis

Hugging Face Local Evaluator

Run controlled inspect-ai or lighteval evaluations for Hugging Face Hub models on local hardware.

★ 11k FS 47 Use with care 18d ago
Data & Analysis

Sentence Transformers Training Assistant

Train retrieval, similarity, reranking, and sparse-search models with Sentence Transformers.

★ 11k FS 47 Use with care 18d ago
Data & Analysis

Transformers.js Inference Skill

Run Hugging Face models directly inside JavaScript applications.

★ 11k FS 46 Use with care 18d ago
Data & Analysis

Trackio Experiment Tracking

Log, monitor, and query machine-learning experiments with dashboards, diagnostic alerts, and automation-ready output.

★ 11k FS 43 Not recommended 18d ago
Dev & Engineering

Hugging Face Hub CLI Skill

Give agents command-line control over Hugging Face Hub models, datasets, Spaces, jobs, and infrastructure.

★ 11k FS 42 Not recommended 18d ago
Dev & Engineering

Gradio Interactive App Builder

Build Gradio web interfaces, machine-learning demos, and chat apps in Python.

★ 11k FS 40 Not recommended 18d ago
Dev & Engineering

Hugging Face ZeroGPU Builder

Build dependable Gradio AI demos and GPU workloads on Hugging Face ZeroGPU.

★ 11k FS 56 Use with care 18d ago
Automation & Ops

AWS Context Discovery

Resolve the active AWS environment before any account operation.

★ 11k FS 50 Use with care 18d ago
Automation & Ops

SageMaker Deployment Planner

Choose a practical Amazon SageMaker deployment path for your model, traffic pattern, and latency needs.

★ 11k FS 50 Use with care 18d ago
Dev & Engineering

Hugging Face Spaces Builder

Build, deploy, debug, and maintain machine-learning apps on Hugging Face Spaces.

★ 11k FS 50 Use with care 18d ago
Automation & Ops

SageMaker Python Environment Setup

Build an isolated, version-aligned Python environment for SageMaker and AWS automation.

★ 11k FS 49 Use with care 18d ago
Data & Analysis

Hugging Face Dataset Explorer

Explore, query, and extract Hugging Face datasets through the Dataset Viewer API.

★ 11k FS 49 Use with care 18d ago
Dev & Engineering

Hugging Face Paper Research Assistant

Read AI papers and retrieve structured metadata from Hugging Face paper pages.

★ 11k FS 49 Use with care 18d ago
Automation & Ops

SageMaker Serving Image Selector

Choose a compatible SageMaker serving container and retrieve the current regional image URI for a Hugging Face model.

★ 11k FS 47 Use with care 18d ago
Automation & Ops

SageMaker Production Defaults

Deploy SageMaker real-time or async endpoints with autoscaling, CloudWatch alarms, and consistent tagging built in.

★ 11k FS 46 Use with care 18d ago
Data & Analysis

Hugging Face Model Memory Estimator

Estimate inference memory without downloading model weights.

★ 11k FS 44 Not recommended 18d ago
Dev & Engineering

Hugging Face Local Model Runner

Choose compatible GGUF quantizations from Hugging Face and run them locally with llama.cpp.

★ 11k FS 44 Not recommended 18d ago
Data & Analysis

Hugging Face Vision Trainer

Train detection, classification, and segmentation models on Hugging Face Jobs GPUs and persist the results to the Hub.

★ 11k FS 43 Not recommended 18d ago

Related skills