---
name: "unsloth-fast-lora-finetuning"
description: "Train language models up to 5x faster with 80% less memory using Unsloth AI."
metadata:
  author: "Unsloth AI"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "fine tune with unsloth"
  - "train model 5x faster unsloth"
  - "export unsloth to gguf"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Unsloth 5x Faster LoRA Fine-Tuning

Accelerates LoRA and QLoRA model fine-tuning with Unsloth: custom manual backpropagation CUDA kernels, zero memory fragmentation, FastLanguageModel, and 1-click GGUF/Ollama export.

## When to Invoke
Invoke this skill whenever you need to:
- fine tune with unsloth
- train model 5x faster unsloth
- export unsloth to gguf

## Execution SOP & Rules
1. Initialize models using FastLanguageModel.from_pretrained(model_name, max_seq_length=2048).
2. Attach LoRA adapters with FastLanguageModel.get_peft_model(model, r=16, target_modules=[...]).
3. Train using HuggingFace SFTTrainer with Unsloth optimizations enabled automatically.
4. Export to 16bit, GGUF, or Ollama Modelfile using model.save_pretrained_gguf().

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
