hugging-face-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 hugging-face-model-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
Instructs the agent to train or fine-tune language models using TRL on Hugging Face Jobs infrastructure, covering SFT, DPO, GRPO, and Reward Modeling, plus GGUF conversion for local deployment. Ensures training results are saved to the Hub and uses Trackio for monitoring.
How it works
- Always use the hf_jobs() MCP tool to submit training jobs, passing a Python script via the script parameter as a string; do not save to local files unless requested. If the user asks to train or fine-tune, create the training script and submit immediately using hf_jobs().
- Include Trackio in every training script for real-time monitoring, using templates from scripts/ as references.
- Provide job details after submission: job ID, monitoring URL, estimated time, and note that status checks can be requested later.
- Reference example templates such as scripts/train_sft_example.py and scripts/train_dpo_example.py as starting points.
- For local cost estimation, use scripts/estimate_cost.py with appropriate model and dataset parameters.
When to use it
Use this skill when users want to fine-tune on cloud GPUs with TRL methods (SFT, DPO, GRPO, Reward Modeling), run training jobs on Hugging Face Jobs infrastructure, or convert trained models to GGUF for local deployment, including pushing results to the Hub.
What it can touch
- hf_jobs() MCP tool to submit training scripts inline (no local file saves unless requested)
- Training scripts that include Trackio and Hub push configuration
- Hub access via HF_TOKEN provided in secrets for authentication
Caveats
- Training is asynchronous and can take hours; ensure timeout is sufficient (default 30 minutes is too short).
- Ephemeral environment requires pushing to Hub (must set push_to_hub and hub_model_id; secrets HF_TOKEN needed).
- Requires HF_TOKEN with write permissions and proper hub_model_id in configuration.
# 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 hugging-face-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 hugging-face-model-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.
