skillfed

peft

Parameter-Efficient Fine-Tuning (PEFT)

peft v0.20.0 11.6M downloads/30d#1,378 on PyPI21,546
Permissive license Apache Active released

What it is and what it does

PEFT is a library for efficiently adapting large pretrained models to downstream tasks by training only a small subset of parameters—typically less than 1% of the model—rather than all weights. This dramatically cuts GPU memory and storage costs while achieving performance comparable to full fine-tuning. It integrates with transformers, Diffusers, and Accelerate, making it practical to fine-tune billion-parameter models on consumer-grade hardware.

The library provides multiple parameter-efficient methods (LoRA, QLoRA, soft prompts, IA3, and others) and handles the mechanics of wrapping base models with adapter configurations, managing training, and loading adapters for inference. You prepare a model by passing it through `get_peft_model` with a configuration, train normally, then save only the adapter weights—typically a few megabytes instead of gigabytes.

Use it for:

  • Fine-tune a 7B or 12B parameter LLM on a 16GB consumer GPU using QLoRA and 8-bit quantization.
  • Train task-specific adapters for multiple datasets without storing full model copies for each task.
  • Adapt Stable Diffusion or other diffusion models with LoRA while keeping memory footprint under 10GB.
  • Deploy inference with multiple task-specific adapters loaded from the same base model.
  • Reduce checkpoint storage from gigabytes to megabytes by saving only adapter weights.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PEFT implements parameter-efficient fine-tuning methods (LoRA, QLoRA, and others) that adapt large pretrained language models by training only a small fraction of parameters instead of all weights, dramatically reducing memory and compute requirements.

Yes. PEFT is production-stable, actively maintained, widely adopted in the Hugging Face ecosystem, has no known vulnerabilities, and solves a genuine problem—making large model fine-tuning accessible on modest hardware. Install it if you need to adapt pretrained models efficiently; skip it only if you are doing full-model training or not fine-tuning at all.

Install

peft on PyPI

pip

pip install peft

uv

uv add peft

poetry

poetry add peft

Installing peft

Before you install

Low friction install with a pure-Python wheel. Depends on torch, transformers, and accelerate—all widely used and actively maintained. The package itself is actively developed (last commit 2026-08-14) with 21546 GitHub stars and production-stable status.

License in practice

Licensed under Apache 2.0 (permissive), which allows commercial and private use without restriction. You may use, modify, and distribute PEFT freely provided you include the license notice.

Quickstart

pip install peft

from transformers import AutoModelForCausalLM
from peft import LoraConfig, TaskType, get_peft_model

model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B-Instruct")
peft_config = LoraConfig(r=16, lora_alpha=32, task_type=TaskType.CAUSAL_LM)
model = get_peft_model(model, peft_config)
model.print_trainable_parameters()

Requires PyTorch and transformers installed; GPU memory requirements vary by model size but are significantly lower than full fine-tuning.

Verify before relying

  • Specific PEFT methods supported beyond LoRA, QLoRA, and IA3 mentioned in the description.
  • Compatibility with non-transformer model architectures or custom models.
  • Performance overhead or latency impact during inference with loaded adapters.

Package facts

License Apache (permissive)
Python support supports the current Python release (>=3.10.0)
Install friction low — pure-Python wheel
Runtime dependencies 10 — numpy, packaging, psutil, pyyaml, torch, transformers, tqdm, accelerate, safetensors, huggingface-hub
Maintenance actively maintained — 17 days since the last release
Last repo commit
First released
Downloads 11,618,527/month — #1,378 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: peft-0.20.0-py3-none-any.whl

Keywords: deep, learning

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/Engineering :: Artificial Intelligence

Tags

fine-tune large language models efficientlyparameter efficient fine tuningLoRA adapter traininglow rank adaptationreduce fine tuning memorytrain LLMs on consumer hardwareefficient model adaptation
model-adaptationefficient-trainingllm-tools

More Artificial Intelligence packages

Further reading