model-trainer
This skill should be used when users want to train or fine-tune language models using TRL (Transformer Reinforcement Learning) on Hugging Face Jobs infrastructure. Covers SFT, DPO, GRPO and reward modeling training methods, plus GGUF conversion for local deployment. Includes guidance on the TRL Jobs package, UV scripts with PEP 723 format, dataset preparation and validation, hardware selection, cost estimation, Trackio monitoring, Hub authentication, and model persistence. Should be invoked for tasks involving cloud GPU training, GGUF conversion, or when users mention training on Hugging Face
npx skills add majiayu000/claude-skill-registry --skill hf-llm-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.
What it does
The skill instructs how to train or fine-tune language models using TRL on Hugging Face Jobs infrastructure. It covers SFT, DPO, GRPO, reward modeling, and GGUF conversion for local deployment. It provides guidance on the TRL Jobs package, UV scripts with PEP 723 format, dataset preparation and validation, hardware selection, cost estimation, Trackio monitoring, Hub authentication, and model persistence. It is intended for tasks involving cloud GPU training, GGUF conversion, or training on Hugging Face Jobs without local GPU setup.
How it works
- Always use the hf_jobs() MCP tool to submit training jobs via hf_jobs("uv", {...}) with a Python script string in the script parameter; do not use bash trl-jobs commands. If the user asks to train or fine-tune, you must create the training script and submit the job immediately using hf_jobs().
- Every training script must include Trackio for real-time monitoring, using templates from scripts/ as references.
- After submission, provide the user with the Job ID, monitoring URL, estimated time, and note that status checks can be requested later.
- Use example templates such as scripts/train_sft_example.py and scripts/train_dpo_example.py as starting points.
- For local script execution (e.g., estimate_cost.py), install dependencies with pip install -r requirements.txt.
- Follow prerequisites: HF_TOKEN must be provided via secrets in job config, and hub_model_id must be set; ensure timeout accommodates training duration; validate datasets before GPU training.
- You can leverage UV scripts that inline dependencies (PEP 723) and reference TRL-maintained or TRL example scripts.
When to use it
Use this skill when the user wants to:
- Fine-tune language models on cloud GPUs without local infrastructure
- Train with TRL methods (SFT, DPO, GRPO, etc.)
- Run training jobs on Hugging Face Jobs infrastructure
- Convert trained models to GGUF for local deployment
- Ensure trained models are permanently saved to the Hub
- Follow modern workflows with optimized defaults
What it can touch
- hf_jobs() MCP tool is required for job submission
- Script content is passed inline to hf_jobs(); no local file saves unless requested
- References to templates in scripts/ (e.g., train_sft_example.py, train_dpo_example.py) are used as starting points
- Secrets for HF_TOKEN must be provided in job configuration
Caveats
- The environment is ephemeral; all training results must be pushed to the Hub (push_to_hub) to avoid loss
- Timeout must be long enough for the training duration; default 30 minutes is insufficient for typical tasks
- Datasets must be validated before GPU training to prevent format failures
- The skill emphasizes HDR: use Trackio monitoring and hub persistence; status checks are available upon request
# TRL Training on Hugging Face Jobs ## Overview Train language models using TRL (Transformer Reinforcement Learning) on fully managed Hugging Face infrastructure. No local GPU setup required—models train on cloud GPUs and results are automatically saved to the Hugging Face Hub. **TRL provides multiple training methods:** - **SFT** (Supervised Fine-Tuning) - Standard instruction tuning - **DPO** (Direct Preference Optimization) - Alignment from preference data - **GRPO** (Group Relative Policy Optimization) - Online RL training - **Reward Modeling** - Train reward models for RLHF **For detailed TRL method documentation:** ```python hf_doc_search("your query", product="trl") hf_doc_fetch("https://huggingface.co/docs/trl/sft_trainer") # SFT hf_doc_fetch("https://huggingface.co/docs/trl/dpo_trainer") # DPO # etc. ``` **See also:** `references/training_methods.md` for method overviews and selection guidance ## When to Use This Skill Use this skill when users want to: - Fine-tune language models on cloud GPUs without local infrastructure - Train with TRL methods (SFT, DPO, GRPO, etc.) - Run training jobs on Hugging Face Jobs infrastructure - Convert trained models to GGUF for local deplo
- Overview
- When to Use This Skill
- Key Directives
- Local Script Dependencies
- Prerequisites Checklist
- ✅ Account & Authentication
- ✅ Dataset Requirements
- ⚠️ Critical Settings
- Asynchronous Job Guidelines
- Action Required
- Ground Rules
- After Submission
- Quick Start: Three Approaches
- Sequence Length Configuration
pip install -r requirements.txt huggingface-cli repo create my-training-scripts --type model huggingface-cli upload my-training-scripts ./train.py train.py hf jobs uv run --flavor a10g-large --timeout 2h --secrets HF_TOKEN "https://example.com/train.py" hf jobs run uv "https://example.com/train.py" --flavor a10g-large hf jobs uv run "https://example.com/train.py" --flavor a10g-large hf jobs uv run --secret HF_TOKEN "https://example.com/train.py" hf jobs uv run \ hf jobs ps # List all jobs hf jobs logs <job-id> # View logs
What does the model-trainer skill do?
This skill should be used when users want to train or fine-tune language models using TRL (Transformer Reinforcement Learning) on Hugging Face Jobs infrastructure. Covers SFT, DPO, GRPO and reward modeling training methods, plus GGUF conversion for local deployment. Includes guidance on the TRL Jobs package, UV scripts with PEP 723 format, dataset preparation and validation, hardware selection, cost estimation, Trackio monitoring, Hub authentication, and model persistence. Should be invoked for tasks involving cloud GPU training, GGUF conversion, or when users mention training on Hugging Face
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill hf-llm-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.
