peft-fine-tuning

Fine-tune large language models with LoRA and QLoRA adapters on limited GPU memory.

16|Updated Sep 22, 2026
One-click install
npx skills add https://github.com/igniteenow/robo --skill peft-fine-tuning-igniteenow
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: peft-fine-tuning
Source: https://github.com/igniteenow/robo/tree/main/optional-skills/mlops/peft
Command: npx skills add https://github.com/igniteenow/robo --skill peft-fine-tuning-igniteenow

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires peft, transformers, torch, bitsandbytes, and includes references (resource) components.

What problem does it solve? Full fine-tuning of 7B-70B parameter LLMs requires 60+ GB of GPU memory, which is out of reach for most consumer hardware. This Skill trains less than 1% of model parameters using LoRA, QLoRA, and other adapter methods, producing 6MB adapter files instead of 14GB full model checkpoints. ## Core Features & Use Cases - LoRA and QLoRA Fine-Tuning: Train adapters on models from Llama 3.1 8B up to 70B on a single 24GB GPU using 4-bit NF4 quantization and gradient checkpointing. - Parameter Selection Guidance: Choose rank, alpha scaling, and target modules per architecture (Llama, Mistral, GPT-2, Falcon, BLOOM) with benchmark-backed memory and quality tables. - Multi-Adapter Serving: Load, switch, merge, and compose multiple task-specific adapters at runtime, with integration patterns for TRL, Axolotl, and vLLM. - Use Case: Fine-tune Llama 3.1 70B on a single RTX 4090 for a domain-specific chatbot, then serve three task adapters from one base model in vLLM. ## Quick Start Fine-tune Llama 3.1 8B with LoRA rank 16 on my instruction dataset and save the adapter to ./lora-adapter.

Frequently Asked Questions about peft-fine-tuning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fine-tune a Llama model with LoRA?▼

Load the base model with transformers, apply a LoraConfig with rank 8-16 and target attention modules via get_peft_model, then train with the standard Trainer. Save only the adapter weights with save_pretrained, producing a roughly 6MB file instead of a full checkpoint.

What is the difference between LoRA and QLoRA?▼

QLoRA combines LoRA adapters with 4-bit NF4 quantization of the base model, cutting memory from 18GB to 6GB for an 8B model. Use QLoRA when memory is the primary constraint, accepting roughly a 5% quality trade-off versus full fine-tuning.

Can I fine-tune a 70B model on a single 24GB GPU?▼

Yes, QLoRA with 4-bit quantization, double quantization, and gradient checkpointing fits a 70B model on one 24GB GPU. Use a higher rank such as 64 and target all linear layers for best results.

How do I fix CUDA out of memory during LoRA training?▼

Enable gradient checkpointing with prepare_model_for_kbit_training, reduce per-device batch size while increasing gradient accumulation, or switch to QLoRA 4-bit quantization. Lowering the LoRA rank and targeting fewer modules also reduces memory.

When should I use full fine-tuning instead of PEFT?▼

Use full fine-tuning for models under 1B parameters, when maximum quality is required and compute budget allows, or when significant domain shift demands updating all weights. PEFT suits 7B-70B models and multi-adapter deployment scenarios.