PEFT

Hugging Face library for LoRA and other methods that fine-tune large models by training few weights.

Open SourceSelf HostedOffline CapableGPU Required (8GB+ VRAM)
0.0 (0)

About

Hugging Face's PEFT library lets you adapt a large pretrained network by training a small set of added or selected weights while the original parameters stay frozen. Wrapping a Transformers model with get_peft_model and a config object injects the adapter, and the saved result is often just a few megabytes that can sit on top of the base model, be merged into it, or be swapped at runtime. Beyond LoRA and its variants such as DoRA, AdaLoRA, LoHa, LoKr and X-LoRA, the repository implements orthogonal methods like OFT and BOFT, IA3, VeRA, prefix and prompt tuning, P-tuning and dozens of newer research techniques. It plugs into Diffusers for image-model LoRAs, Accelerate and DeepSpeed for multi-GPU runs, TRL for supervised and preference fine-tuning, and bitsandbytes for QLoRA-style 4-bit training, which puts 7B-class models within reach of a single 16 GB card. Setup is pip install peft next to PyTorch. Apache-2.0, so commercial use carries no strings. Anyone fine-tuning LLMs, Whisper or Stable Diffusion on limited hardware will find it the usual starting point, and saved adapters load straight into Transformers and Diffusers.

Should you use PEFT?

Pick it when

Use it when you write your own Transformers or Diffusers training code and want to add LoRA, IA3, prompt tuning, or adapters in a few lines, or when you need an adapter method beyond the LoRA variants most fine-tuning tools expose.

Look elsewhere when

PEFT gives you adapters, not a training recipe: data formatting, the training loop, and configs are still yours. If you want those handled, Axolotl (YAML recipes) or Unsloth (memory-lean training) build on the same Hugging Face stack.

Alternatives to PEFT

  • Unsloth

    Same 8 GB listed floor, but patches Hugging Face internals to cut memory and adds a Studio UI; covers LoRA, QLoRA, and full tuning, not PEFT's wider adapter menu.

  • Axolotl

    Turns a YAML file into a full run with DPO, ORPO, KTO and more, at the cost of a 16 GB floor and difficulty 4 versus 3 here.

  • TRL

    Supplies the SFT, DPO, and GRPO trainers PEFT lacks and accepts a PEFT config directly, so you add a library rather than swap one; difficulty 4 versus 3.

  • LLaMA-Factory

    Wraps LoRA and QLoRA in a web UI with built-in dataset formatting, trading away the fine-grained control PEFT gives you in code.

Reviews (0)

Leave a Review

No reviews yet. Be the first to review!

Details

Price
Free
Platform
Local/Desktop
Difficulty
Intermediate (3/5)
License
Apache-2.0
Minimum VRAM
8 GB
Added
Jan 29, 2026

Tags