llm-finetuning — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited llm-finetuning (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Fine-tuning adapts a base LLM to a task or style. For almost all practitioners the right default is parameter-efficient fine-tuning (LoRA/QLoRA) — it trains <1% of weights, fits on a single GPU, and avoids catastrophic forgetting. Reach for full fine-tuning only with strong justification and budget.
Try prompting + few-shot + RAG first (see the rag-pipeline skill). Fine-tune when you need consistent format/style, lower latency/cost than long prompts, or to internalize a large example set.
| Method | Trains | VRAM | Use when |
|---|---|---|---|
| Full FT | 100% | Very high | Large data + budget, max quality |
| LoRA | ~0.1-1% | Moderate | Default for most tasks |
| QLoRA | ~0.1-1% | Low (4-bit) | Single consumer GPU |
Use the model's chat template; quality > quantity. A few thousand clean, diverse examples beat a noisy 100k dump.
def to_chat(example):
return {"messages": [
{"role": "system", "content": "You are a helpful support agent."},
{"role": "user", "content": example["question"]},
{"role": "assistant", "content": example["answer"]},
]}from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import LoraConfig
from trl import SFTTrainer, SFTConfig
import torch
bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16)
model = AutoModelForCausalLM.from_pretrained(BASE, quantization_config=bnb, device_map="auto")
peft_cfg = LoraConfig(r=16, lora_alpha=32, lora_dropout=0.05, bias="none",
task_type="CAUSAL_LM",
target_modules=["q_proj", "k_proj", "v_proj", "o_proj"])
trainer = SFTTrainer(
model=model, train_dataset=train_ds, eval_dataset=eval_ds, peft_config=peft_cfg,
args=SFTConfig(per_device_train_batch_size=2, gradient_accumulation_steps=8,
learning_rate=2e-4, num_train_epochs=2, warmup_ratio=0.03,
lr_scheduler_type="cosine", bf16=True, logging_steps=10,
eval_strategy="steps", eval_steps=100, output_dir="out"),
)
trainer.train()Merged or adapter weights + eval report, logged via experiment-tracking and deployed via model-serving.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.