Skip to content

Guide · Agent skill

How to use the HF LLM Trainer agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The huggingface-llm-trainer skill teaches an AI agent how to fine-tune language models with TRL (Transformer Reinforcement Learning) or Unsloth on Hugging Face Jobs, which run on cloud GPUs so you don't need local GPU hardware. This guide is for developers and teams who want to fine-tune an open model and understand what the agent does, what it needs and what to check before it spends money. By the end you will know how to install the skill, phrase a training request, and review the results.

HF LLM Trainerhuggingface/skills · Apache-2.0

Quick start

  1. 1Get a paid plan and token. Confirm you have a Hugging Face Pro, Team or Enterprise plan and create a token with write permission.
  2. 2Install the skill. Download the ZIP from our page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills.
  3. 3Check the dataset. Ask the agent to validate the dataset format for your training method before any GPU run.
  4. 4Describe the training goal. Give the model, method (SFT, DPO, GRPO or reward modeling), dataset and target Hub repo in one request.
  5. 5Review cost and timeout. Ask for a cost and time estimate, and set a job timeout longer than expected training time.
  6. 6Monitor and convert. Use the job link and Trackio dashboard to follow progress, then request GGUF conversion for local use.

What is an agent skill and what does this one do?

An agent skill is a folder of instructions and helper scripts that an AI agent can load when a task matches the skill's description. This one is named huggingface-llm-trainer and is built around the file SKILL.md, which tells the agent how to run training.

With the skill active, the agent can write a training script, submit it as a background job on Hugging Face Jobs, and save the finished model to the Hugging Face Hub. It supports the SFT, DPO, GRPO and reward modeling methods, and can convert a finished model to GGUF for local tools such as llama.cpp, Ollama or LM Studio.

  • SFT (supervised fine-tuning): standard instruction tuning.
  • DPO (Direct Preference Optimization): alignment from preference data.
  • GRPO (Group Relative Policy Optimization): online reinforcement learning.
  • Reward modeling: training reward models for RLHF.
  • Helper scripts for dataset inspection, cost estimation and benchmark leaderboard search.

How do you install the HF LLM Trainer skill?

Download the ZIP from our page and unzip it. For a personal setup, place the folder in ~/.claude/skills/. For a single project, place it in that project's .claude/skills/ folder.

In the Claude apps you can instead upload the skill under Settings → Capabilities → Skills.

  • Personal install: unzip into ~/.claude/skills/.
  • Project install: unzip into .claude/skills/ inside your project.
  • Claude apps: Settings → Capabilities → Skills, then upload.

What do you need before you start?

The skill depends on a paid Hugging Face plan. The source says Jobs require a Pro, Team or Enterprise plan. You also need a Hugging Face token with write permission, which is passed to jobs as the HF_TOKEN secret. Access to Hugging Face Jobs is provided through the hf_jobs MCP tool or equivalent.

Scripts use PEP 723 inline dependencies, so you need uv installed to run them locally. The scripts declare packages such as transformers, peft, torch, accelerate, huggingface_hub, sentencepiece and gguf. If you plan to convert to GGUF on your own machine, you also need cmake and a C/C++ build toolchain.

  • Hugging Face Pro, Team or Enterprise plan.
  • Hugging Face token with write permission, passed as HF_TOKEN.
  • hf_jobs MCP tool or equivalent Jobs access.
  • uv for running PEP 723 scripts.
  • cmake and a C/C++ toolchain only for local GGUF conversion.
uv run scripts/estimate_cost.py --help uv run scripts/dataset_inspector.py --help

How do you trigger the skill with a natural request?

You don't need special syntax. Describe the training goal in plain language, such as the model, the method and the data. The skill's description covers cloud GPU training, GGUF conversion and requests to train on Hugging Face Jobs without local GPU setup, so those phrases are good triggers.

The source says that when a user asks to train or fine-tune a model, the agent should create the training script and submit the job right away. Give it the dataset name and the goal so it can pick the right method and format.

  • "Fine-tune Qwen on my dataset with SFT on Hugging Face Jobs, no local GPU."
  • "Train a DPO model on this preference dataset and push it to my Hub account."
  • "Convert my trained model to GGUF so I can run it in Ollama."

What happens during a training job?

The agent writes the script with Trackio included for live monitoring and submits it using the hf_jobs tool, passing the script content directly. Jobs run in the background, so submission returns quickly and training continues without your session. The source says initial logs can take 30 to 60 seconds to appear, and the agent should wait for you to ask for status instead of polling.

After submission, expect the job ID, a monitoring link, an estimated time and a Trackio dashboard link. The results are pushed to the Hub, because the training environment is temporary and files are deleted when the job ends.

  • Set the job timeout above the expected training time. The source recommends a minimum of 1 to 2 hours, since a job that exceeds its timeout fails and loses progress.
  • Set push_to_hub=True and hub_model_id to a username/model-name value.
  • Pass the token with secrets={"HF_TOKEN": "$HF_TOKEN"}.

How do you choose hardware and check cost?

The hardware guide lists GPU flavors such as t4-small, a10g-large and a100-large, with memory and a rough hourly price for each. The source suggests t4-small with 50 to 100 examples for demos, and larger GPUs with 1K to 10K or more examples for production. Ask the agent to run the cost estimate helper before you submit a large job.

For big or memory-heavy models, the skill suggests Unsloth, which the source says uses about 60% less VRAM and runs about 2x faster. The source also notes Unsloth has FastVisionModel support for vision-language models.

  • Demo: t4-small with a small dataset.
  • Mid-size models: l4x1 or a10g-small, per the hardware guide.
  • Large models or vision-language models: consider Unsloth.

How do you convert a model to GGUF?

After training, the GGUF guide explains how to convert the model for llama.cpp, Ollama, LM Studio, Jan and GPT4All. GGUF supports quantization to 4, 5 or 8 bits to shrink the file. The guide notes that a 7B model is typically 2 to 8 GB in GGUF, compared with about 14 GB unquantized.

Conversion can run as a job or locally. Local conversion needs cmake and a C/C++ build toolchain.

  • Ask the agent to convert the finished Hub model to GGUF.
  • Choose a quantization level that fits your memory budget.
  • Load the GGUF file into Ollama or LM Studio.

What safety points should you check?

The skill runs scripts and uses the network. Results are pushed to the Hugging Face Hub, and tokens are passed to jobs. Before training on sensitive data, check the repository visibility on the Hub and make sure the token has only the scope you need.

Always validate an unfamiliar dataset before paying for GPU time. The source says the dataset format must match the method: SFT accepts messages, text or prompt-completion data; DPO needs chosen and rejected fields; GRPO needs prompts only.

  • Check whether the target Hub repo is public or private before pushing.
  • Use a token with write permission only for the work you need.
  • Run dataset validation first, using the dataset inspector helper.
  • Keep the timeout realistic so runs are not cut off early.

What people use it for

  • Fine-tuning an open model with SFT on an instruction dataset without owning a GPU.
  • Aligning a model with DPO on a preference dataset.
  • Running a GRPO training run on a cloud GPU and tracking it in Trackio.
  • Converting a trained Hub model to a quantized GGUF file for Ollama or LM Studio.
  • Searching benchmark leaderboards to pick a base model before training.

Frequently asked questions

Is the HF LLM Trainer skill free?

The skill is licensed under Apache-2.0, and its full terms are in LICENSE.txt. Hugging Face Jobs require a Pro, Team or Enterprise plan, and jobs incur GPU costs.

What do I need to use the huggingface-llm-trainer skill?

You need a Hugging Face Pro, Team or Enterprise plan, a token with write permission passed as HF_TOKEN, access to Hugging Face Jobs, and uv to run the scripts. Local GGUF conversion also needs cmake and a C/C++ toolchain.

How do I install the skill in Claude?

Download the ZIP from our page and unzip it into ~/.claude/skills/ for personal use or .claude/skills/ inside a project. In the Claude apps you can upload it under Settings → Capabilities → Skills.

Can I train without a local GPU?

Yes. The skill runs training on Hugging Face cloud GPUs through Jobs, and results are saved to the Hub. You only need a local GPU if you choose to run training yourself.

Why did my training job fail or stop early?

The most common cause in the source is a timeout shorter than the training time, since the default is too short for most runs. Also confirm that HF_TOKEN is passed as a secret and that push_to_hub is enabled, or the results will be lost.

How does this compare with using Unsloth directly?

The skill supports both TRL and Unsloth. The source says Unsloth uses about 60% less VRAM and is about 2x faster, so it suits memory-limited or large-model work, while standard TRL is the default.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits developers and teams with a paid Hugging Face plan who want repeatable cloud fine-tuning and GGUF export without local GPU hardware. If you have no paid plan, want quick experiments with no cloud spend, or need to keep sensitive data off the Hub, pick a local training workflow instead.

Download the skill