llm-finetuning

llm-finetuning is a skill for Claude Code, Codex from j4flmao/agent-skills. It costs 152 tokens per session (1,987 once invoked), scanned A, original, MIT.

Guidance for adapting a language model to a specific dataset using parameter-efficient fine-tuning, a way to train selected parts or small add-ons instead of the whole model. It focuses on preparing data and using PEFT or LoRA.

In plain words
What is it for?
Use it to format, clean, deduplicate, tokenize, and fine-tune instruction-based datasets, then save a trained model checkpoint.
Why use it?
It helps avoid common training problems such as inconsistent examples, duplicate data, and overfitting, where a model memorises training examples too closely.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to format, clean, deduplicate, tokenize, and fine-tune instruction-based datasets, then save a trained model checkpoint.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j4flmao/agent-skills/llm-finetuning
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.

Any agent
npx skills add j4flmao/agent-skills --skill llm-finetuning
Clone the repo
git clone --depth 1 https://github.com/j4flmao/agent-skills

Made for: Claude Code, Codex.

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 llm-finetuning

README.md
[![agentmods](https://agentmods.dev/badge/skills/j4flmao/agent-skills/llm-finetuning/github.svg)](https://agentmods.dev/skills/j4flmao/agent-skills/llm-finetuning)
Your own site
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/llm-finetuning"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/llm-finetuning/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for llm-finetuning

Your own site · 80×15
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/llm-finetuning"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/llm-finetuning.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 152 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,987 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found 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.1 $0.00152 $0.01987
Opus 5.5 $0.00061 $0.00795
Sonnet 5.5 $0.00030 $0.00397
Haiku 4.5 $0.00015 $0.00199

Measured 2d ago against content hash 9f5085678fab, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

llm-finetuning 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 2d ago.

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.

skills/ai/llm-finetuning/SKILL.md · 166 lines

How it starts

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

LLM Fine-Tuning (PEFT / LoRA)

Purpose

Fine-tuning changes model behaviour (format, style, task skill, domain language) from examples. It is the wrong tool for injecting frequently changing facts; use retrieval for that. Parameter-efficient methods such as LoRA train small low-rank adapters on frozen base weights, making single-GPU training of 7-8B models routine and letting one base model serve many adapters.

Agent Protocol

Trigger

"fine-tune", "LoRA", "QLoRA", "PEFT", "SFT", "instruction tuning", "DPO", "preference tuning", "adapter", "merge_and_unload".

Input Context

  • Goal and why prompting/RAG is insufficient (with failing examples).
  • Dataset: size, source, license, format, PII status.
  • Base model and license; GPU type/VRAM; serving target.
  • Eval set and success metric.

Output Artifact

Go/no-go decision, dataset spec, training config, eval plan, export/serving instructions.

Response Format

Decision: {fine-tune|RAG|prompting} because {reason}
Base model: {id} (license {x})  Method: {LoRA|QLoRA|full}  Stage: {SFT|DPO}
Data: {n} examples, chat format, split {train/val/test}
LoRA: r={r} alpha={a} dropout={p} targets={modules}
Train: lr={lr} epochs={e} eff_batch={b} max_len={L}
Eval: base vs tuned on {metric}; regression suite {name}
Export: {adapter|merged} -> {engine}

Completion Criteria

  • Baseline (prompted base model, RAG) measured first.
  • Held-out test set never used for tuning decisions.
  • Chat template of the base model applied consistently in training and inference.
  • Tuned model beats baseline on the target metric without regressions on general checks.

Should You Fine-Tune?

Goal Best tool
New/changing facts, citations RAG
Output format, tone, strict schema Prompting + structured outputs first; SFT if still unreliable
Narrow task at lower cost/latency SFT a smaller model (often distilled from a larger one)
Preference (helpfulness, style ranking) DPO/ORPO after SFT
Domain vocabulary/style SFT (or continued pre-training for large corpora)

Read the full file on GitHub · 166 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. 2d ago Changed · +125 lines · +131 tokens per session 9f5085678fab
  2. 2mo ago First seen · 41 lines · 21 tokens per session scan A acfcede7c298

Subscribe to this mod's changes

llm-finetuning is a skill published in the GitHub repository j4flmao/agent-skills (35 stars, last pushed 2d ago), licensed MIT. It adds 152 tokens to every session and 1,987 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.