Skip to main content
skill

fine-tuning-peft — Claude Code skill: LoRA and QLoRA for LLMs

A skill that walks through fine-tuning large language models with LoRA, QLoRA and other adapter methods when GPU memory is tight.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --skill ai-research/fine-tuning-peft
Open on GitHub

What fine-tuning-peft does

The skill covers training 7B–70B models while updating under 1% of the weights. It builds on HuggingFace's PEFT library, which plugs into the transformers stack. Adapters come out in megabytes rather than gigabytes, so keeping several task-specific variants of one base model is cheaper than keeping full copies.

You get working code samples: plain LoRA through LoraConfig, QLoRA with 4-bit quantization via BitsAndBytesConfig, loading and merging adapters, picking rank and lora_alpha, plus target module lists for Llama, Mistral, Qwen, GPT-2, Falcon and BLOOM. A rank table spans 4 to 64, and the guidance suggests starting at 8 or 16.

Dependencies are peft>=0.13.0, transformers>=4.45.0, torch>=2.0.0 and bitsandbytes>=0.43.0. Skip the last one and quantization will not run. QLoRA targets a single 24GB card, at a cost of roughly 5% quality against full fine-tuning. For models under 1B parameters, or when the domain shift is large, the skill points you to full fine-tuning instead.

What it helps with

  • fine-tune a 70B model on one GPU
  • save an adapter of a few megabytes instead of a full model copy
  • choose rank and alpha for a given task
  • run several task adapters on top of one base model
  • merge a trained adapter into the base model before deployment

Example prompts for the agent

  • Set up LoRA for meta-llama/Llama-3.1-8B with rank 16 and save only the adapter
  • Show a 4-bit QLoRA config so a 70B model fits in 24GB of VRAM
  • How do I merge the adapter in ./lora-llama-adapter into the base model?

How to install fine-tuning-peft

1claude-code-templates

npx claude-code-templates@latest --skill ai-research/fine-tuning-peft

2Skills CLI (Vercel)

npx skills add davila7/claude-code-templates --skill fine-tuning-peft -a claude-code

3Manually: put the files in place

~/.claude/skills/fine-tuning-peft/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/fine-tuning-peft/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about fine-tuning-peft

How do I install fine-tuning-peft in Claude Code?

Use the templates command: npx claude-code-templates@latest --skill ai-research/fine-tuning-peft. Or run npx skills add davila7/claude-code-templates --skill fine-tuning-peft -a claude-code. The skill file lands at ~/.claude/skills/fine-tuning-peft/SKILL.md.

What does fine-tuning-peft do?

It guides adapter-based fine-tuning of LLMs: LoRA, QLoRA and more than twenty other methods. Expect configs, training examples and adapter loading built on the PEFT library.

How is QLoRA different from plain LoRA?

QLoRA adds 4-bit quantization of the base model, which lets a 70B model fit on a single 24GB GPU. In exchange, quality drops by about 5% versus full fine-tuning.

Similar skills

All skills for AI and ML →

From the same set361

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor