huggingface-llm-trainer

Train and fine-tune language models with TRL or Unsloth on Hugging Face Jobs.

507|40|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/waybarrios/opencode-power-pack --skill huggingface-llm-trainer-waybarrios
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: huggingface-llm-trainer
Source: https://github.com/waybarrios/opencode-power-pack/tree/main/skills/huggingface-llm-trainer
Command: npx skills add https://github.com/waybarrios/opencode-power-pack --skill huggingface-llm-trainer-waybarrios

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires trl, peft, trackio, transformers, torch, accelerate, huggingface_hub, sentencepiece, protobuf, gguf, datasets, and includes scripts (resource) and references (resource) components.

What problem does it solve? Training or fine-tuning LLMs normally requires local GPU hardware, complex environment setup, and manual infrastructure management. This Skill submits SFT, DPO, GRPO, and reward-model training jobs to fully managed Hugging Face cloud GPUs, with automatic Hub saving, monitoring, and cost estimation. ## Core Features & Use Cases - Cloud LLM Training: Submit TRL training jobs (SFT, DPO, GRPO, reward modeling) via hf jobs uv run or the hf_jobs MCP tool with inline PEP 723 scripts—no local GPU required. - Dataset Validation & Cost Estimation: Inspect dataset format compatibility before training and estimate training time, cost, and recommended timeout with helper scripts. - GGUF Conversion: Convert fine-tuned LoRA models to quantized GGUF format for llama.cpp, Ollama, and LM Studio. - Use Case: Fine-tune Qwen2.5-0.5B on the Capybara dataset with LoRA on an a10g-large GPU, monitor with Trackio, push results to the Hub, then convert to Q4_K_M GGUF for local Ollama inference. ## Quick Start Ask the agent to fine-tune a small model like Qwen/Qwen2.5-0.5B on the trl-lib/Capybara dataset using SFT on Hugging Face Jobs and push the result to your Hub account.

Frequently Asked Questions about huggingface-llm-trainer

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

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

Submit a training job with hf jobs uv run or the hf_jobs MCP tool, passing an inline PEP 723 script that uses SFTTrainer with your dataset and model. Set a timeout above 30 minutes, enable push_to_hub, and pass HF_TOKEN as a secret so results are saved.

When should I use Unsloth instead of standard TRL training?▼

Use Unsloth when GPU memory is limited, since it uses roughly 60% less VRAM and trains about twice as fast. It is also preferred for models larger than 13B parameters and for Vision-Language Models via its FastVisionModel support.

What dataset format does DPO training require?▼

DPO requires columns named exactly prompt, chosen, and rejected. Validate unknown datasets with the dataset inspector script first, which outputs mapping code when columns use different names like preferred or winner.

Why did my Hugging Face training job lose all results?▼

Jobs run in ephemeral environments where all files are deleted when the job ends. You must set push_to_hub=True with a hub_model_id and pass secrets with HF_TOKEN so the trained model is uploaded to the Hub before the job finishes.

How do I convert a fine-tuned model to GGUF for Ollama?▼

Run the convert_to_gguf.py script as a job with ADAPTER_MODEL, BASE_MODEL, and OUTPUT_REPO environment variables. It merges the LoRA adapter, converts to FP16 GGUF via llama.cpp, creates Q4_K_M, Q5_K_M, and Q8_0 quantizations, and uploads them to the Hub.

What GPU hardware should I choose for fine-tuning a 7B model?▼

For 7B models use a10g-large with LoRA, costing roughly five dollars per hour. Full fine-tuning of 7B models needs about 140GB of memory and is not feasible, so LoRA or PEFT is required to fit within a single GPU.