Fine-tunes language models (SFT, DPO, GRPO, reward modeling) on managed Hugging Face Jobs cloud GPUs using TRL or Unsloth, with dataset prep, cost estimation, Trackio monitoring, and GGUF export.
---
name: huggingface-llm-trainer
description: Train or fine-tune language models with TRL or Unsloth on Hugging Face Jobs cloud GPUs - SFT, DPO, GRPO, and reward modeling - plus GGUF conversion for local deployment. Use for cloud GPU training when the user has no local GPU.
---
# LLM Training on Hugging Face Jobs
Train models on fully managed cloud GPUs; results are saved automatically to the Hub. No local GPU required.
## Workflow
1. Choose the method: SFT (instruction tuning), DPO (preference alignment), GRPO (online RL), or reward modeling.
2. Prepare and validate the dataset; estimate cost and pick hardware via the PEP 723 helper scripts (`uv run scripts/estimate_cost.py`, `dataset_inspector.py`).
3. Submit the job with the `hf_jobs("uv", {...})` MCP tool, passing the training script as a string - do not run bash `trl-jobs` commands.
4. Always include Trackio in the script for real-time monitoring; use the example scripts (`train_sft_example.py`, `train_dpo_example.py`) as templates.
5. Use Unsloth (`references/unsloth.md`) for low-VRAM, faster, or large/VLM training.
6. After submission, report job ID, monitoring URL, and ETA; convert to GGUF for Ollama/LM Studio/llama.cpp when needed.
Full skill & source: https://github.com/huggingface/skills/tree/ea9a24f38a98baf2430dab3bcb31a89753ae9e6d/skills/huggingface-llm-trainer