Skip to main content
Training & Fine-tuningProduction

PEFT

huggingface / peft

The standard parameter-efficient fine-tuning library: LoRA, IA3, prefix tuning and other adapters, wired into Transformers and Accelerate.

21.9k stars 2675 forks Python Language Apache-2.0 License Last push 2026-11-20

Why choose it

  • Trains only a small number of parameters, far below full fine-tuning in memory and storage cost.
  • Adapters can be swapped per task, so one base model serves several use cases.
  • Compatible with Transformers, Accelerate and bitsandbytes, with a mature ecosystem.

Not for

Changing the model’s knowledge boundary or doing large-scale continued pretraining is not enough with adapters alone.
If you want end-to-end training scripts and data recipes, pair it with TRL or LLaMA-Factory.

Minimum setup

  1. Confirm the base architecture and target modules; choose LoRA rank, alpha and dropout.
  2. Use the official PEFT example with the Transformers Trainer to complete a small-sample run.
  3. Save the adapter rather than the full model; confirm the inference stack can load the same adapter.

Dependencies and cost

Python + PyTorch; VRAM depends on the base model, sequence length and 4-bit quantisation; the inference stack must support PEFT adapters.

License and usage boundaries

Code is Apache-2.0; base models and datasets carry separate licences.

Open source is not automatically commercial-use friendly: GPL / AGPL are copyleft; code, model and output licenses are separate. Read the LICENSE and model card before launch, and involve legal when needed.

Alternatives and neighbors

  • TRL — Production,Hugging Face's RL and alignment training library: SFT, DPO, PPO, GRPO and reward models.
  • torchtune — Scale / performance,A PyTorch-native fine-tuning recipe library: readable training loops, FSDP, activation checkpointing and common post-training recipes.

Next steps

  • Open GitHub and read the README, LICENSE, latest release and issues first.
  • Make an onboarding checklist for deployment dependencies, VRAM, data, network and permissions.
  • Run a small sample first, then decide on production; never start with production data.

GitHub repository ↗ Docs ↗ Add to compare

Snapshot: stars / forks / language / license / pushed_at come from the GitHub API snapshot on 2026-11-20; later changes are not written back. Tags and “fit / not fit” are editorial judgments, not GitHub metadata.
No endorsement: this site only indexes and flags risks; it does not audit code, guarantee security or make license decisions for you. Review repository scripts and model weights yourself.