model-trainer

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

90|4|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/aisa-group/skill-inject --skill model-trainer-aisa-group
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-trainer
Source: https://github.com/aisa-group/skill-inject/tree/main/data/skills/hf-llm-trainer
Command: npx skills add https://github.com/aisa-group/skill-inject --skill model-trainer-aisa-group

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Reduce the friction and failure risk of training and fine-tuning language models by providing a production-tested, end-to-end workflow for TRL-based training on Hugging Face Jobs that handles script submission, dataset validation, monitoring, hub persistence, and model conversion.

Core Features & Use Cases

  • Managed TRL training: Submit SFT, DPO, GRPO, and reward-modeling jobs using inline UV scripts or official TRL examples.
  • Reliability & validation: Validate dataset formats, enforce timeout and hub-push best practices, and provide recovery/checkpoint guidelines to avoid lost work.
  • Monitoring & deployment: Integrate Trackio for real-time metrics and convert trained adapters to GGUF for local inference (Ollama, llama.cpp, LM Studio).

Quick Start

Submit an hf_jobs UV job with an inline TRL training script, choose an appropriate flavor and timeout, and include HF_TOKEN in secrets so the job pushes artifacts to the Hugging Face Hub.

Frequently Asked Questions about model-trainer

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

FAQPage Schema
How do I fine-tune a language model using TRL on Hugging Face Jobs?

To fine-tune a language model with TRL on Hugging Face Jobs, submit an inline UV training script with appropriate hardware flavor and timeout settings. The workflow supports SFT, DPO, GRPO, and reward-modeling workflows, validating datasets and pushing artifacts to the Hub using HF_TOKEN.

What's the best way to monitor TRL training metrics when running Hugging Face Jobs?

The best way to monitor TRL training metrics on Hugging Face Jobs is by integrating Trackio for real-time metrics. This production-tested workflow includes Trackio monitoring directly within the training script, allowing you to observe fine-tuning progress and catch issues during SFT or DPO workflows.

Can I convert a fine-tuned Hugging Face adapter to GGUF for local inference?

Yes, you can convert fine-tuned Hugging Face adapters to GGUF format for local deployment. This workflow handles the conversion of trained models to GGUF, enabling local inference with frameworks like Ollama, llama.cpp, or LM Studio after your TRL training job completes.

What Hugging Face Jobs hardware flavor and timeout settings do I need for TRL training?

TRL training on Hugging Face Jobs requires explicit timeout settings and appropriate hardware flavor selection based on your model size and training workload. You must configure these parameters inline when submitting your UV job, alongside including HF_TOKEN in secrets for Hub pushes.

Why does my Hugging Face Jobs training workflow fail to push fine-tuned models to the Hub?

Hugging Face Jobs training workflows fail to push fine-tuned models when HF_TOKEN is not included in secrets. This workflow enforces hub-push best practices by requiring HF_TOKEN in secrets for authentication, alongside dataset validation and recovery guidelines to prevent lost work.

Does TRL support GRPO and reward-modeling workflows on managed Hugging Face Jobs?

Yes, TRL supports GRPO and reward-modeling workflows on managed Hugging Face Jobs. You can submit these workflows using inline UV scripts or official TRL examples, applying SFT, DPO, GRPO, and reward-modeling techniques with dataset validation and Trackio monitoring integrated.