Skip to content

Guide · Agent skill

How to use the LoRA & QLoRA Recipes agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The lora-qlora-recipes skill is a set of instructions that lets an AI agent produce a concrete LoRA or QLoRA supervised fine-tuning configuration. It is for ML engineers and developers who have demonstration-style data and need sensible starting values for rank, alpha, learning rate, target modules and batch size. After this guide you will know how to install the skill, how to ask for it in plain language, and what it will and won't do.

LoRA & QLoRA Recipeswshobson/agents · MIT

Quick start

  1. 1Download and unzip. Download the skill ZIP from this page and unzip it so the lora-qlora-recipes folder contains SKILL.md and the references folder.
  2. 2Place the folder. Move the folder into ~/.claude/skills/ for personal use or into .claude/skills/ in your project. Alternatively upload it under Settings → Capabilities → Skills.
  3. 3Check your environment. Confirm Python with PyTorch, plus Unsloth or Hugging Face TRL and PEFT, is installed, and run the bf16 check on your GPU.
  4. 4Describe your task. Ask in plain language, naming your model size class, dataset type (demonstrations) and GPU memory.
  5. 5Review the config values. Check the rank, lora_alpha (2 times rank), learning rate and effective batch size the agent returns against the reference tables.
  6. 6Adjust only with a reason. Move rank up a row only if the lower rank underfits on held-out evaluation, and move to QLoRA only if memory forces it.

What the skill makes the agent do

Without the skill, an agent answering a fine-tuning question tends to give general advice. With the skill installed, the agent follows a fixed recipe and returns a configuration of values. The recipe covers which layers to adapt (all-linear modules, including the MLP layers gate_proj, up_proj and down_proj), how to set lora_alpha as 2 times the rank, and a LoRA learning rate about 10 times the equivalent full fine-tune rate, with 2e-4 as the QLoRA starting point.

The skill also helps you decide between LoRA, QLoRA and full fine-tuning. It treats LoRA as the default, suggests QLoRA only when the base model does not fit in bf16 at the target rank, and reserves full fine-tuning for injecting dense new knowledge.

  • Target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
  • Rank by task: 1–32 for RL adapters, 16–32 as the general default, up to about 256 for SFT at scale
  • Keep effective batch size under 32
  • Fixed Unsloth defaults such as lora_dropout=0, bias="none" and optim="adamw_8bit"
target_modules = [ "q_proj", "k_proj", "v_proj", "o_proj", # attention "gate_proj", "up_proj", "down_proj", # MLP ]

Install the skill

Download the ZIP of the skill from this page and unzip it. The skill is a folder containing SKILL.md, plus references/hyperparameters.md and references/unsloth-trl-mapping.md. Place the folder in ~/.claude/skills/ to make it available to you across projects, or in a project's .claude/skills/ folder to limit it to that project.

If you use the Claude apps instead, open Settings → Capabilities → Skills and upload the skill there.

  • Personal install: ~/.claude/skills/lora-qlora-recipes/
  • Project install: .claude/skills/lora-qlora-recipes/ inside your project
  • Claude apps: Settings → Capabilities → Skills, then upload

Trigger the skill with natural requests

You do not need to type a command. The skill is chosen from its description, which covers writing or reviewing a LoRA/QLoRA training configuration, choosing rank, alpha or target modules, and deciding between LoRA, QLoRA and full fine-tuning. Ask in those terms and name your model size class and hardware where you can.

Requests that match well include a config review, a request for a starting rank, or a question about whether QLoRA is needed on your GPU.

  • Write a LoRA config for a small instruction-following dataset on one 24GB GPU.
  • Review this QLoRA training config and tell me if the rank and learning rate are sensible.
  • Should I use LoRA, QLoRA or full fine-tuning for adding domain behaviour to a mid-size model?
  • Which modules should I target for LoRA, and what should lora_alpha be for rank 16?

Work with the output

The skill outputs kwarg values rather than free-form advice. For Unsloth users, the values appear on a get_peft_model call. For plain TRL and PEFT users, the reference file references/unsloth-trl-mapping.md maps each Unsloth kwarg to its peft.LoraConfig or TRL equivalent. The full tables and a worked SFTConfig example are in references/hyperparameters.md.

The skill says it is designed to be used alongside other skills. Dataset preparation is handled by dataset-curation, routing between training methods by finetuning-method-selection, and the training script by llm-finetuning-training-engineer.

  • Read references/hyperparameters.md for rank, alpha and learning rate tables
  • Read references/unsloth-trl-mapping.md when you need plain TRL or PEFT names

Check your hardware before choosing a dtype

The skill recommends bf16 wherever the hardware supports it, and warns that fp16 on GPUs without solid BF16 support can cause loss spikes and silent divergence. Run this check before you pick a dtype:

  • If the output is True, set bf16=True.
  • If it is False, do not fall back to fp16 as if it were equivalent; check your hardware first.
python -c "import torch; print(torch.cuda.is_bf16_supported())"

Safety notes: scripts and network

The skill does not run scripts and does not use the network, according to its listing. Its only command is the torch check above, which you run yourself. Because it does not execute code, the agent's configuration values still need to be read and checked by you before a real training run.

Requirements: Python with PyTorch, Unsloth and/or Hugging Face TRL and PEFT, and a CUDA GPU is implied by the memory and bf16 guidance. The skill assumes familiarity with Hugging Face, PEFT and GPU memory, so it is not a setup guide.

  • Runs scripts: no
  • Uses network: no
  • Needs: Python, PyTorch, Unsloth and/or TRL and PEFT, a CUDA GPU

What people use it for

  • Writing a first LoRA config for an instruction-tuning dataset of demonstrations on a single GPU.
  • Reviewing a colleague's QLoRA config to check rank, alpha and learning rate against the recipe.
  • Deciding whether QLoRA is needed when the base model does not fit in bf16 at the target rank.
  • Translating an Unsloth config into plain TRL and PEFT names using the mapping reference.

Frequently asked questions

Is the LoRA & QLoRA Recipes skill free?

The skill is published under the MIT licence, as listed on this page. Check the repository licence file for the full terms before reuse.

What do I need to use this skill?

You need Python with PyTorch, Unsloth and/or Hugging Face TRL and PEFT, and a CUDA GPU for the memory and bf16 guidance. The skill assumes you already know Hugging Face, PEFT and GPU memory.

How do I install the lora-qlora-recipes skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps you can upload it under Settings → Capabilities → Skills.

Does the skill run code or access the internet?

No. The listing says it runs no scripts and uses no network. The only command it mentions is a torch check for bf16 support, which you run yourself.

Can I use it for preference or reinforcement learning training?

No. The skill assumes supervised demonstration data. For preference-based or RL methods it points elsewhere, and the routing decision is handled by another skill, finetuning-method-selection.

Should I use LoRA, QLoRA or full fine-tuning?

The skill's default is LoRA. Use QLoRA only when the base model does not fit in bf16 at your target rank, and reserve full fine-tuning for injecting dense new knowledge.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you are an ML engineer or developer with demonstration data who wants a concrete, validated LoRA or QLoRA starting config and a clear rule for choosing between LoRA, QLoRA and full fine-tuning. Pick something else if you need a complete beginner setup, preference-based or reinforcement-learning training, or a dense knowledge-injection workflow.

Download the skill