PEFT
huggingface / peft
The standard parameter-efficient fine-tuning library: LoRA, IA3, prefix tuning and other adapters, wired into Transformers and Accelerate.
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
- Confirm the base architecture and target modules; choose LoRA rank, alpha and dropout.
- Use the official PEFT example with the Transformers Trainer to complete a small-sample run.
- 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.