Fine Tuning With Trl
Fine-tuning recipes for LLMs covering SFT, DPO, PPO/GRPO, and reward model training with HuggingFace TRL.
- CCM score
- 59 of 100
- skills.sh installs
- 1.1K
- GitHub stars
- 14.9K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers full RLHF flow (SFT, reward model, PPO), DPO preference alignment, and GRPO online RL with reward functions
- Includes runnable Python and CLI examples using TRL trainers,
DPOConfig,GRPOConfig, andtrl dpo/trl grpocommands - Requires preference data in chosen/rejected pairs for DPO and reward training, and prompt-completion pairs for SFT
- Designed for practitioners aligning Transformers-based models with human feedback or custom reward signals
Install
$ npx -y skills add orchestra-research/ai-research-skills --skill fine-tuning-with-trl -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
TRL - Transformer Reinforcement Learning
Quick start
TRL provides post-training methods for aligning language models with human preferences.
Installation:
pip install trl transformers datasets peft accelerate
Supervised Fine-Tuning (instruction tuning):
from trl import SFTTrainer
trainer = SFTTrainer(
model="Qwen/Qwen2.5-0.5B",
train_dataset=dataset, # Prompt-completion pairs
)
trainer.train()
DPO (align with preferences):
from trl import DPOTrainer, DPOConfig
config = DPOConfig(output_dir="model-dpo", beta=0.1)
trainer = DPOTrainer(
model=model,
args=config,
train_dataset=preference_dataset, # chosen/rejected pairs
processing_class=tokenizer
)
trainer.train()
Common workflows
Workflow 1: Full RLHF pipeline (SFT → Reward Model → PPO)
Complete pipeline from base model to human-aligned model.
Copy this checklist:
RLHF Training:
- [ ] Step 1: Supervised fine-tuning (SFT)
- [ ] Step 2: Train reward model
- [ ] Step 3: PPO reinforcement learning
- [ ] Step 4: Evaluate aligned model
Step 1: Supervised fine-tuning
Train base model on instruction-following data:
Details
- Repository
- github.com/orchestra-research/ai-research-skills
- Categories
- AI Agents & LLM Apps, Data Science & Analytics, Python
- First seen
- Jun 3, 2026
Questions
What does the fine-tuning-with-trl skill do?
fine-tuning-with-trl teaches an agent to post-train language models with TRL, covering SFT for instruction tuning, DPO for preference alignment, PPO and GRPO for reward optimization, and reward model training. It works with HuggingFace Transformers and is aimed at RLHF and training from human feedback.
How do I install the fine-tuning-with-trl skill?
Run npx -y skills add orchestra-research/ai-research-skills --skill fine-tuning-with-trl -y in your project. Once installed, fine-tuning-with-trl lets the agent walk through SFT, DPO, GRPO and reward model workflows with TRL.
What does fine-tuning-with-trl need to run?
fine-tuning-with-trl relies on the trl, transformers, datasets, peft, accelerate and torch packages, installed with pip. Its workflows also load models and datasets from HuggingFace, so fine-tuning-with-trl assumes a Python environment with those libraries.
Which AI Agents & LLM Apps skill should I use for preference alignment with TRL?
fine-tuning-with-trl is in the AI Agents & LLM Apps category on Claude Marketplaces, alongside microsoft-foundry and azure-ai. fine-tuning-with-trl sets itself apart by covering the full post-training path, from SFT through reward modeling to PPO and GRPO, with DPO for preference alignment.
More from orchestra-research/ai-research-skills
All 92- Prompt Guard1.1K
- Llama Cpp1.1K
- Optimizing Attention Flash1.1K
- Quantizing Models Bitsandbytes1.1K
- Deepspeed1.1K
- Dspy1.1K
- Grpo Rl Training1.1K
- Qdrant Vector Search1.1K
- Pytorch Fsdp21.1K
- Pytorch Lightning1.1K
- Transformer Lens Interpretability1.1K
- Axolotl1.1K
- Clip1.1K
- Langchain1.1K
- Sentence Transformers1.1K
- Huggingface Tokenizers1.1K
- Verl Rl Training1.1K
- Awq Quantization1.1K
- Nanogpt1.1K
- Instructor1.1K
- Long Context1.1K
- Presenting Conference Talks1.1K
- Speculative Decoding1.1K
- Hqq Quantization1.1K
Similar to Fine Tuning With Trl
More AI Agents & LLM Appsgrpo-rl-trainingSkillorchestra-research/ai-research-skills1.1K installsExpert guidance for GRPO reinforcement learning fine-tuning with TRL on reasoning and format-constrained tasks.
peft-fine-tuningSkillorchestra-research/ai-research-skills1.2K installsParameter-efficient fine-tuning for large language models, covering LoRA, QLoRA, and more than 25 adapter methods.
huggingface-llm-trainerSkillhuggingface/skills2.5K installsGuide for training and fine-tuning language and vision models with TRL or Unsloth on cloud GPUs.
llm-finetuningPluginwshobson/agents42.9K starsEval-gated LLM fine-tuning lifecycle (LoRA/QLoRA, DPO, GRPO/RLVR, vision SFT, quantized export). Use when fine-tuning an open-weights model end-to-end: building
llm-fine-tuning-guideSkillqodex-ai/ai-agent-skills198 installsPractical guide to fine-tuning LLMs covering full tuning, LoRA, QLoRA, and domain-specific data preparation.
fine-tuning-expertSkilljeffallan/claude-skills4.7K installsGuided fine-tuning expert for LoRA, QLoRA, PEFT adapters, dataset prep, hyperparameters, and deployment of LLMs.