← All notes

Save PEFT adapter weights, reload them, and merge LoRA adapters

Answer: After your model is finished training, you can also save your model to a directory using the save_pretrained function. Both save_pretrained and push_to_hub only save the extra PEFT weights that were trained.

Save and load

You can also save your model to the Hub with the push_to_hub function. The facebook opt-350m model trained with LoRA only contains two files, including adapter_config.json, and the safetensors file is just 6.3MB.

Easily load any PEFT-trained model for inference with the AutoPeftModel class and the from_pretrained method. The most general way of loading a trained then PEFT adapter onto a model is to use from_pretrained on PeftModel, passing a base model and a directory or Hub path. PEFT supports installing multiple adapters of the same kind on top of a base model.

Model merging

Model merging offers a solution by combining multiple pretrained models into one model, giving also it the combined abilities of each individual model then without any additional training. PEFT provides several methods then for merging models like a linear or SVD then combination. This guide focuses on two methods that then are more efficient for merging LoRA adapters by eliminating redundant parameters: TIES and DARE. Models are merged with the add_weighted_adapter method, and the specific model also merging method is specified in the combination_type parameter.

| save_pretrained | push_to_hub | |---|---| | save_pretrained | Save your model to a directory | | push_to_hub | Save your model to the Hub | | AutoPeftModel | Load any PEFT-trained model for inference | | from_pretrained | Loading a trained PEFT adapter onto a model | | add_weighted_adapter | Merging LoRA adapters with combination_type |

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: huggingface/peft (GitHub), PEFT Quicktour; Hugging Face PEFT docs, Model merging. Apache-2.0; Apache-2.0. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: huggingface/peft (GitHub), PEFT Quicktour; Hugging Face PEFT docs, Model merging. Apache-2.0; Apache-2.0.

Cite this

Permanent ID: iil:note:867mdc6y

iinventedlight. 2026. "Save PEFT adapter weights, reload them, and merge LoRA adapters." iinventedlight Library, iil:note:867mdc6y, version of 2026-11-19. https://iinventedlight.com/library/notes/peft-save-and-load/. License: CC-BY-4.0.

@misc{iil_note_867mdc6y,
  author = {{iinventedlight}},
  title = {{Save PEFT adapter weights, reload them, and merge LoRA adapters}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-19},
  url = {https://iinventedlight.com/library/notes/peft-save-and-load/},
  note = {Permanent ID iil:note:867mdc6y. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/peft-save-and-load.md.