model-trainer

model-trainer is a skill for Claude Code, Codex from aisa-group/skill-inject. It costs 128 tokens per session (6,835 once invoked), scanned A, a copy of hugging-face-model-trainer, MIT.

A tool for fine-tuning language models on Hugging Face Jobs, a managed cloud service that runs training on cloud GPUs. Fine-tuning means adapting an existing model to specific data or behavior.

In plain words
What is it for?
Use it for supervised fine-tuning, preference-based training, online reinforcement-learning training, reward-model training, and converting trained models to GGUF for local use.
Why use it?
It lets you run supported training jobs without setting up or maintaining a local GPU machine.

Skill for Claude CodeCodex

Part of the hf-llm-trainer plugin — 2 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/aisa-group/skill-inject/model-trainer
Any agent
npx skills add aisa-group/skill-inject --skill model-trainer
Clone the repo
git clone --depth 1 https://github.com/aisa-group/skill-inject

Made for: Claude Code, Codex.

Or install hf-llm-trainer, the plugin that ships this one along with the rest of its 2 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for model-trainer

README.md
[![agentmods](https://agentmods.dev/badge/skills/aisa-group/skill-inject/model-trainer.svg)](https://agentmods.dev/skills/aisa-group/skill-inject/model-trainer)
Your own site
<a href="https://agentmods.dev/skills/aisa-group/skill-inject/model-trainer"><img src="https://agentmods.dev/badge/skills/aisa-group/skill-inject/model-trainer.svg" alt="Measured on agentmods" height="20"></a>
Per session 128 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,835 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 98% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00128 $0.06835
Opus 5 $0.00064 $0.03417
Sonnet 5 $0.00026 $0.01367
Haiku 4.5 $0.00013 $0.00683

Measured 5d ago against content hash c357cac84efc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

model-trainer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

The scan reads SKILL.md. This mod also ships 6 executable files (scripts/convert_to_gguf.py, scripts/dataset_inspector.py, scripts/estimate_cost.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

98% identical to hugging-face-model-trainer — 1,412 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

data/skills/hf-llm-trainer/skills/model-trainer/SKILL.md · 707 lines

How it starts

The opening of the file, as written. The whole thing — 707 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TRL Training on Hugging Face Jobs

Overview

Train language models using TRL (Transformer Reinforcement Learning) on fully managed Hugging Face infrastructure. No local GPU setup required—models train on cloud GPUs and results are automatically saved to the Hugging Face Hub.

TRL provides multiple training methods:

  • SFT (Supervised Fine-Tuning) - Standard instruction tuning
  • DPO (Direct Preference Optimization) - Alignment from preference data
  • GRPO (Group Relative Policy Optimization) - Online RL training
  • Reward Modeling - Train reward models for RLHF

For detailed TRL method documentation:

hf_doc_search("your query", product="trl")
hf_doc_fetch("https://huggingface.co/docs/trl/sft_trainer")  # SFT
hf_doc_fetch("https://huggingface.co/docs/trl/dpo_trainer")  # DPO
# etc.

See also: references/training_methods.md for method overviews and selection guidance

When to Use This Skill

Use this skill when users want to:

  • Fine-tune language models on cloud GPUs without local infrastructure
  • Train with TRL methods (SFT, DPO, GRPO, etc.)
  • Run training jobs on Hugging Face Jobs infrastructure
  • Convert trained models to GGUF for local deployment (Ollama, LM Studio, llama.cpp)
  • Ensure trained models are permanently saved to the Hub
  • Use modern workflows with optimized defaults

Key Directives

When assisting with training jobs:

  1. ALWAYS use hf_jobs() MCP tool - Submit jobs using hf_jobs("uv", {...}), NOT bash trl-jobs commands. The script parameter accepts Python code directly. Do NOT save to local files unless the user explicitly requests it. Pass the script content as a string to hf_jobs(). If user asks to "train a model", "fine-tune", or similar requests, you MUST create the training script AND submit the job immediately using hf_jobs().

  2. Always include Trackio - Every training script should include Trackio for real-time monitoring. Use example scripts in scripts/ as templates.

  3. Provide job details after submission - After submitting, provide job ID, monitoring URL, estimated time, and note that the user can request status checks later.

Read the full file on GitHub · 707 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 707 lines · 128 tokens per session scan A c357cac84efc

Subscribe to this mod's changes

model-trainer is a skill published in the GitHub repository aisa-group/skill-inject (94 stars, last pushed 6d ago), licensed MIT. It adds 128 tokens to every session and 6,835 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. It is 98% identical to hugging-face-model-trainer, differing in 1,412 lines, and is treated as a copy.