hugging-face-model-trainer

Train and fine-tune language models on Hugging Face Jobs using TRL methods.

10.9k|724|Updated Nov 24, 2025
One-click install
npx skills add https://github.com/huggingface/skills --skill hugging-face-model-trainer-huggingface
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hugging-face-model-trainer
Source: https://github.com/huggingface/skills/tree/main/skills/hugging-face-model-trainer
Command: npx skills add https://github.com/huggingface/skills --skill hugging-face-model-trainer-huggingface

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires trl>=0.12.0, peft>=0.7.0, transformers>=4.36.0, accelerate>=0.24.0, trackio, unsloth, datasets, huggingface_hub[hf_transfer], tensorboard, transformers==4.57.3, gguf, sentencepiece>=0.1.99, protobuf>=3.20.0, numpy, torch>=2.0.0, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables researchers and engineers to train and fine-tune language models on Hugging Face Jobs using TRL (Transformer Reinforcement Learning), simplifying cloud-based experimentation and deployment pipelines.

Core Features & Use Cases

  • Support for TRL training methods: SFT, DPO, GRPO, and reward modeling, plus GGUF conversion for local deployment.
  • End-to-end guidance covering dataset preparation, hardware selection, cost estimation, Trackio monitoring, and Hub authentication.
  • Suitable for cloud GPU training, model alignment workflows, and converting trained models to GGUF for edge or CPU inference.

Quick Start

Use this skill to initiate a TRL-based training job on Hugging Face Jobs, push results to the Hub, and optionally prepare a GGUF artifact for local deployment.

Frequently Asked Questions about hugging-face-model-trainer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fine-tune an LLM using TRL on Hugging Face Jobs?

Fine-tune an LLM using TRL on Hugging Face Jobs by running inline Python scripts with PEP 723 headers. This Skill supports SFT, DPO, and GRPO methods, requiring a valid hub_model_id and Hub token to persist results.

Can I convert my trained Hugging Face model to GGUF for local deployment?

Convert your trained Hugging Face model to GGUF for local deployment using this Skill's built-in GGUF conversion functionality. This enables edge or CPU inference after completing TRL training on cloud GPUs.

What prerequisites do I need to run TRL training methods on Hugging Face Jobs?

Running TRL training methods on Hugging Face Jobs requires Python dependencies including trl, peft, transformers, and torch. You also need Hub token-based authentication and a valid hub_model_id to execute and persist results.

Does Hugging Face Jobs support Trackio monitoring for LLM training workflows?

Trackio monitoring is supported for LLM training workflows on Hugging Face Jobs. This Skill integrates Trackio alongside Tensorboard to track cloud GPU training progress and cost estimation across SFT, DPO, and GRPO runs.

Is unsloth compatible with TRL for fine-tuning language models on cloud GPUs?

Unsloth is compatible with TRL for fine-tuning language models on cloud GPUs. This Skill includes unsloth as a dependency to optimize training workflows alongside accelerate and peft for Hugging Face Jobs.

What is the best way to prepare datasets for DPO and SFT on Hugging Face?

The best way to prepare datasets for DPO and SFT on Hugging Face is using the datasets library integrated within this Skill. It provides end-to-end guidance covering dataset preparation, hardware selection, and cost estimation for TRL alignment workflows.