peft-fine-tuning

Fine-tune LLMs with LoRA, QLoRA, and adapter methods using HuggingFace PEFT.

1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/kaminocorp/hermes-alpha-hunter --skill peft-fine-tuning-kaminocorp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: peft-fine-tuning
Source: https://github.com/kaminocorp/hermes-alpha-hunter/tree/main/skills/mlops/training/peft
Command: npx skills add https://github.com/kaminocorp/hermes-alpha-hunter --skill peft-fine-tuning-kaminocorp

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Full fine-tuning of large language models (7B-70B parameters) requires expensive GPU clusters and produces multi-gigabyte checkpoints. This Skill enables parameter-efficient fine-tuning that trains less than 1% of model parameters, fitting a 70B model on a single 24GB GPU and producing adapters of only a few megabytes. ## Core Features & Use Cases - LoRA and QLoRA Fine-Tuning: Train low-rank adapters on consumer GPUs, with 4-bit quantization via bitsandbytes for memory-constrained environments. - 25+ PEFT Methods: Includes AdaLoRA, IA3, Prefix Tuning, Prompt Tuning, DoRA, LoftQ, and rsLoRA with guidance on rank, alpha, and target module selection per architecture. - Multi-Adapter Serving: Load, switch, merge, and compose multiple adapters on one base model, with integration patterns for TRL, Axolotl, and vLLM. - Use Case: Fine-tune Llama 3.1 70B on a single RTX 4090 using QLoRA with rank-64 adapters, then serve task-specific adapters through vLLM without duplicating the base model. ## Quick Start Fine-tune Llama 3.1 8B on my instruction dataset using LoRA with rank 16 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, create a LoraConfig with rank 8-16 and target modules like q_proj and v_proj, then wrap the model with get_peft_model. Train with the standard Trainer and save only the adapter weights, which are a few megabytes instead of gigabytes.

What is the difference between LoRA and QLoRA?

QLoRA combines LoRA adapters with 4-bit quantization of the base model via bitsandbytes, reducing memory from around 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 NF4 quantization, double quantization, and gradient checkpointing allows a 70B model to fit on a single 24GB GPU. Use a higher rank such as 64 and target all linear layers for best results.

How do I serve multiple LoRA adapters with vLLM?

Initialize vLLM with enable_lora=True and max_loras set to the number of concurrent adapters. Pass a LoRARequest with each generation call specifying the adapter name and path, allowing one base model to serve many fine-tuned variants.

Why is my LoRA training loss not decreasing?

Common causes are a learning rate that is too high, inactive adapters, or incorrect target modules for the model architecture. Verify trainable parameters with print_trainable_parameters, lower the learning rate to 1e-4, and confirm target modules match the model's layer names.

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 requires updating all weights. PEFT is better for large models, limited GPU memory, and multi-adapter deployment.