--- id: peft version: "0.20.0" license: Apache license_treatment: permissive maintenance: active --- # peft — Parameter-Efficient Fine-Tuning (PEFT) License: permissive · Maintenance: active · Downloads: 11.6M/mo ## 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 above — 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 pip install peft uv add peft 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_current - Install friction: low - Maintenance: active - Downloads: 11.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags fine-tune large language models efficiently, parameter efficient fine tuning, LoRA adapter training, low rank adaptation, reduce fine tuning memory, train LLMs on consumer hardware, efficient model adaptation, model-adaptation, efficient-training, llm-tools [View on SkillFed](https://skillfed.io/packages/peft) · [View on PyPI](https://pypi.org/project/peft/)