Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/khalilbenaz/claude-skills-collectionnpx agentmods add skills/khalilbenaz/claude-skills-collection/model-fine-tunerWrote 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.
[](https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/model-fine-tuner)<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/model-fine-tuner"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/model-fine-tuner/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.
<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/model-fine-tuner"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/model-fine-tuner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00116 | $0.02373 |
| Opus 5.5 | $0.00046 | $0.00949 |
| Sonnet 5.5 | $0.00023 | $0.00475 |
| Haiku 4.5 | $0.00012 | $0.00237 |
Grade A, and why
model-fine-tuner 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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 246 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Model Fine-Tuner
Critères de décision : quelle méthode choisir ?
| Situation | Méthode recommandée |
|---|---|
| GPU < 24 Go, LLM > 7B | QLoRA 4-bit |
| GPU 24–80 Go, besoin de vitesse | LoRA bfloat16 |
| Petite tâche de classification | Full fine-tune BERT/DeBERTa |
| Tâche très spécifique, budget compute | IA3 ou Prefix Tuning |
| Modèle > 70B, multi-GPU | FSDP + LoRA |
| Données < 500 exemples | Prompt engineering d'abord, fine-tune ensuite |
Workflow
1. Baseline — mesurer avant de toucher quoi que ce soit
# Exemple : évaluer Mistral-7B zero-shot sur votre tâche
python eval.py --model mistralai/Mistral-7B-v0.3 --dataset data/test.jsonl --metric f1
Sans baseline chiffrée, l'amélioration est invérifiable. Loguer la baseline dans MLflow/W&B immédiatement.
2. Préparer le dataset
Format instruction/response (standard Alpaca / ChatML) :
# Format Alpaca
{"instruction": "Classe cette phrase.", "input": "Le produit est excellent.", "output": "positif"}
# Format ChatML (préféré pour les LLM modernes)
{"messages": [
{"role": "system", "content": "Tu es un classificateur de sentiment."},
{"role": "user", "content": "Le produit est excellent."},
{"role": "assistant", "content": "positif"}
]}
Validation obligatoire avant entraînement :
from datasets import load_dataset
ds = load_dataset("json", data_files={"train": "train.jsonl", "test": "test.jsonl"})
# Vérifier la distribution des labels
from collections import Counter
Counter(ds["train"]["label"])
# Vérifier les longueurs de tokens
from transformers import AutoTokenizer
tok = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.3")
lengths = [len(tok(x["instruction"] + x["output"])["input_ids"]) for x in ds["train"]]
print(f"max={max(lengths)}, p95={sorted(lengths)[int(0.95*len(lengths))]}")
Règle : si p95 > max_seq_length, tronquer ou filtrer — ne jamais silencieusement perdre des tokens en production.
3. Configurer LoRA / QLoRA
from transformers import AutoModelForCausalLM, BitsAndBytesConfig
from peft import LoraConfig, get_peft_model, TaskType
import torch
# QLoRA 4-bit (≈ 5 Go pour 7B)
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
)
model = AutoModelForCausalLM.from_pretrained(
"mistralai/Mistral-7B-v0.3",
quantization_config=bnb_config,
device_map="auto",
)
lora_config = LoraConfig(
r=16, # rang : 8 (léger) → 64 (expressif)
lora_alpha=32, # scaling = alpha/r, garder alpha = 2*r
target_modules=["q_proj", "k_proj", "v_proj", "o_proj"],
lora_dropout=0.05,
bias="none",
task_type=TaskType.CAUSAL_LM,
)
model = get_peft_model(model)
model.print_trainable_parameters()
# → "trainable params: 4,194,304 || all params: 3,756,462,080 || trainable%: 0.1117"
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.
- 3mo ago First seen · 246 lines · 116 tokens per session scan A 35007465e4a3
model-fine-tuner is a skill published in the GitHub repository khalilbenaz/claude-skills-collection (27 stars, last pushed 3mo ago), licensed MIT. It adds 116 tokens to every session and 2,373 once invoked, about $0.0005 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.
model-fine-tuner compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| model-fine-tunerkhalilbenaz/claude-skills-collection | Skill | 27 | 3mo ago | MIT | A | 116 | Claude Code, Codex |
| model-architecture-litgptdavila7/claude-code-templates | Skill | 35k | today | MIT | A | 75 | Claude Code, Codex |
| prompt-librarydavila7/claude-code-templates | Skill | 35k | today | MIT | A | 57 | Claude Code, Codex |
| ki-arbeitsauftrag-formulierenKlotzkette/claude-fuer-deutsches-recht | Skill | 1.9k | 3d ago | Apache-2.0 | A | 56 | Claude Code |
| get-more-from-aimohitagw15856/pm-claude-skills | Skill | 1.6k | today | MIT | A | 140 | Claude Code |
| spot-ai-mistakesmohitagw15856/pm-claude-skills | Skill | 1.6k | today | MIT | A | 145 | Claude Code |
| financial-statement-explainermohitagw15856/pm-claude-skills | Skill | 1.6k | today | MIT | A | 107 | Claude Code |