peft
Parameter-Efficient Fine-Tuning (PEFT)
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires PyTorch and transformers installed; GPU memory requirements vary by model size but are significantly lower than full fine-tuning.
- Low friction install with a pure-Python wheel.
- Depends on torch, transformers, and accelerate—all widely used and actively maintained.
License · maintenance · safety
Apache (permissive) — 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.
last release 2026-07-28 (17 days) · last repo commit 2026-08-14 · 21,546 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 11,618,527 downloads/mo, #1,378 on PyPI
Alternatives
Verify before relying
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()- 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.
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 on it.
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
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.
Requires PyTorch and transformers installed; GPU memory requirements vary by model size but are significantly lower than full fine-tuning.
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()
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 packagesnumpypackagingpsutilpyyamltorchtransformerstqdmacceleratesafetensorshuggingface-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 |
| Classifiers | 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 |
Evidence: peft-0.20.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “fine-tune large language models efficiently”
- peftPEFT implements parameter-efficient fine-tuning methods (LoRA, QLoRA,…
- unsloth-zooUnsloth Zoo provides utilities for fine-tuning large language models…
- trlTRL provides trainer classes for post-training foundation models…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also adapters · lycoris-lora · loralib · transformer-smaller-training-vocab · llamafactory · trl · ms-swift · setfit · qudida · unsloth-zoo