huggingface-llm-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. 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, model selection/leaderboards and model persistence. Use for tasks
Security Assessment
About huggingface-llm-trainer
The huggingface-llm-trainer skill guides training and fine-tuning of language and vision models on Hugging Face Jobs infrastructure using TRL (Transformer Reinforcement Learning) or Unsloth, without requiring a local GPU. It solves the problem of running managed cloud training end to end: models train on cloud GPUs and results are automatically pushed to the Hugging Face Hub. It covers SFT, DPO, GRPO, and reward modeling, plus GGUF conversion for local deployment with Ollama, LM Studio, or llama.cpp.
Its capabilities include submitting jobs via the hf_jobs MCP tool with Python scripts passed directly as strings, using UV scripts with PEP 723 inline dependencies, and including Trackio for real-time monitoring in every training script. It provides guidance and example scripts for SFT, DPO, GRPO, and Unsloth training, dataset preparation and validation, hardware selection with a detailed flavor table (T4, L4, A10G, A100, and TPU options) mapped to model sizes and budgets, cost estimation, and memory optimization techniques such as LoRA/PEFT, gradient accumulation, gradient checkpointing, and mixed precision. Reference files cover training methods, hub saving, Trackio, GGUF conversion, macOS local training, Unsloth, reliability principles, and troubleshooting. It stresses that the training environment is ephemeral, so results must be pushed to the Hub or they are lost.
It targets ML engineers and researchers who want cloud fine-tuning without local infrastructure. Authentication uses an HF_TOKEN with write permissions passed through the job config's secrets mechanism, which is standard official Hugging Face tooling practice; the token references the user's own value and is used to push trained artifacts, not to exfiltrate data.
FAQ
What training methods are supported?
SFT (supervised fine-tuning), DPO (direct preference optimization), GRPO (online RL), and reward modeling via TRL, plus Unsloth for memory-efficient and faster training including vision-language models, and GGUF conversion for local deployment.
What are the prerequisites?
A paid Hugging Face plan (Pro, Team, or Enterprise) for Jobs, an authenticated login, and an HF_TOKEN with write permissions passed via the job config's secrets so trained models can be pushed to the Hub.
Why must models be pushed to the Hub?
The training environment is ephemeral. If results aren't pushed to the Hub, all training output is lost when the job ends, so the skill treats Hub push as critical.
How do I choose hardware and control cost?
A hardware guide maps model sizes and budgets to GPU flavors (T4, L4, A10G, A100) and TPUs, and recommends memory optimizations (LoRA/PEFT, gradient accumulation and checkpointing, mixed precision) plus cost estimation and starting small on a subset.
All Files
19 filesInstall huggingface-llm-trainer
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
huggingface/skills