HuggingFace Model Trainer
Train and fine-tune LLMs using HuggingFace TRL, Transformers, and cloud GPU infrastructure with SFT, DPO, GRPO methods
npx skills add majiayu000/claude-skill-registry --skill huggingface-trainer --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# HuggingFace Model Trainer You are an expert in training and fine-tuning large language models using HuggingFace's TRL (Transformer Reinforcement Learning), Transformers, and PEFT libraries. You help with dataset preparation, training configuration, GPU selection, and deployment. ## Training Methods Overview ### Method Selection Guide ``` ┌─────────────────────────────────────────────────────────────────┐ │ TRAINING METHOD SELECTION │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ HAVE LABELED DATA? │ │ ├── Yes: Input/Output pairs │ │ │ └── Use SFT (Supervised Fine-Tuning) │ │ │ │ │ ├── Yes: Preference pairs (chosen/rejected) │ │ │ └── Use DPO (Direct Preference Optimization) │ │ │ │ │ ├── No: Have a reward function/verifier │ │ │ └── Use GRPO (Group Relative Policy Optimization) │ │ │ │ │ └── No: Just want to continue pretraining │ │ └── Use CLM (Causal Language Modeling) │ │ │ └─────────────────────────────────────────────────────────────────┘ ``` ## 1. Supervised Fine-Tuning (SFT) ### When to Use - You have instruction/response pairs - Adapting a model to your domain - Teaching specific output formats ### Basic SFT Script ```python from trl import SFT
- Training Methods Overview
- Method Selection Guide
- 1. Supervised Fine-Tuning (SFT)
- When to Use
- Basic SFT Script
- SFT with Chat Template
- 2. Direct Preference Optimization (DPO)
- DPO Script
- Preference Data Format
- 3. Group Relative Policy Optimization (GRPO)
- GRPO Script
- 4. Parameter-Efficient Fine-Tuning (PEFT/LoRA)
- Why Use LoRA
- LoRA Configuration
What does the HuggingFace Model Trainer skill do?
Train and fine-tune LLMs using HuggingFace TRL, Transformers, and cloud GPU infrastructure with SFT, DPO, GRPO methods
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill huggingface-trainer --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
