Skip to content

HF LLM Trainer

Fine-tune language or vision models on Hugging Face cloud GPUs and convert them to GGUF

Stars
11,253
Licence
Apache-2.0
Files
15 files

What it does

Teaches an AI agent how to fine-tune language models (SFT, DPO, GRPO, reward modeling) using TRL or Unsloth on rented Hugging Face cloud GPUs, so you don't need a local GPU. The agent writes the training script, submits it as a background job, saves the result to the Hugging Face Hub, and can convert the finished model to GGUF for tools like Ollama or LM Studio. It also includes helpers to check dataset format, estimate cost and time, and search benchmark leaderboards.

Great for

  • Developers who want to fine-tune an open model without setting up local GPU hardware
  • Teams with a paid Hugging Face Jobs plan who want repeatable cloud training runs
  • People who need a trained model converted to GGUF for local use with llama.cpp, Ollama or LM Studio

Skip it if

  • Users without a paid Hugging Face plan, since the skill says Jobs require Pro, Team or Enterprise
  • Anyone training on sensitive data without checking the Hub visibility and token scope, because results are pushed to the Hub and tokens are passed to jobs
  • Quick experiments that need no cloud spend, since jobs incur GPU costs and the default timeout can end runs early if misconfigured

Try asking

  • “Fine-tune Qwen2.5-0.5B on my customer-support dataset with SFT and push the result to my Hub account”
  • “Check whether this dataset is compatible with DPO training before I spend GPU money”
  • “Estimate the cost of training a 7B model for 3 epochs on an a10g-large”
  • “Convert my LoRA adapter to GGUF so I can run it in Ollama”
Step-by-step guide: how to use HF LLM TrainerInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 15 original files, the Apache-2.0 licence and an attribution note.

    huggingface-llm-trainer.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip huggingface-llm-trainer.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip huggingface-llm-trainer.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Set the job timeout to at least 1-2 hours; the skill warns the 30-minute default is too short and failed jobs lose progress
  • Always confirm push_to_hub and HF_TOKEN are set before submitting, since the training environment is ephemeral and unsaved results are lost
  • Validate unfamiliar datasets with the dataset inspector and run small demo runs on t4-small before scaling up

What's inside

  • references/gguf_conversion.md
  • references/hardware_guide.md
  • references/hub_saving.md
  • references/local_training_macos.md
  • references/reliability_principles.md
  • references/trackio_guide.md
  • references/training_methods.md
  • references/training_patterns.md
  • references/troubleshooting.md
  • references/unsloth.md
  • scripts/convert_to_gguf.py
  • scripts/dataset_inspector.py
  • scripts/estimate_cost.py
  • scripts/hf_benchmarks.py
  • SKILL.md

Redistributed unmodified from huggingface/skills under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.