Agent skill · software engineering · sickn33
hugging-face-model-trainer
Train or fine-tune language and vision models using TRL (Transformer Reinforcement Learning) or Unsloth with Hugging Face Jobs infrastructure. Covers SFT, DPO, GRPO and reward modeling training methods, plus GGUF conversion for local deployment.
Why this skill is useful
Adds executable scripts for training models using TRL methods on Hugging Face infrastructure, which are not available in public documentation.
What it needs
Requires uv installed locally. Requires hugging_face account access. About 2k tokens when loaded. Last updated 2026-08-07. 44,571 stars on the source repository.
What this skill does
TRL Training on Hugging Face Jobs Detailed Guide Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely. 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 deployment (Ollama, LM Studio, llama.cpp) Ensure trained models are permanently saved to the Hub Use modern workflows with optimized defaults When to Use Unsloth Use Unsloth (references/unsloth.md) instead of standard TRL when: Limited GPU memory - Unsloth uses ~60% less VRAM Speed matters - Unsloth is ~2x faster Training large models (>13B) - memory efficiency is critical Training Vision-Language Models (VLMs) - Unsloth has FastVisionModel support See references/unsloth.md for complete Unsloth documentation and scripts/unslothsftexample.py for a production-ready training script. Prerequisites Checklist Before starting any training job, verify: ✅ Account & Authentication Hugging Face Account with Pro, Team, or Enterprise plan (Jobs require paid plan) Authenticated login: Check with hfwhoami() HFTOKEN for Hub Push ⚠️ CRITICAL - Training environment is ephemeral, must push to Hub or ALL training results are lost Token must have write permissions MUST pass secrets={"HFTOKEN": "$HFTOKEN"} in job config to make token available (the $HFTOKEN syntax references your actual token value) ✅ Dataset Requirements Dataset must exist on Hub or be loadable via datasets.loaddataset() Format must match training method (SFT: "messages"/text/prompt-completion; DPO: chosen/rejected; GRPO: prompt-only) ALWAYS validate unknown datasets before GPU training to prevent format failures (see Dataset Validati …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills sickn33/hugging-face-model-trainer--e1baed