← Open Source
adapter-hub

adapters

A Unified Library for Parameter-Efficient and Modular Transfer Learning.

Model DevelopmentFine-tuningPython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
2.83k
Stars
373
Forks
+1
This week
18
Contributors
Created 2020-04-21 · Updated 2026-10-12 · #8337 today
Top developers
calptlenglaenderTimoImhof

adapter-hub/adapters is ranked 8,337 with 2,832 stars.

Same-category comparison

adapter-hub/adapters is ranked 8,337 among these 8 peers; rosinality/stylegan2-pytorch is ranked 8,335.

Same-category comparison
NameRankMetrics
TeamHG-Memex/eli58,326
Language:
Jupyter Notebook
Stars:
2,852
Forks:
327
Description:
A library for debugging/inspecting machine learning classifiers and explaining their predictions.
huggingface/nanotron8,331
Language:
Python
Stars:
2,843
Forks:
337
Description:
Minimalistic large language model 3D-parallelism training.
OpenPipe/OpenPipe8,334
Language:
TypeScript
Stars:
2,834
Forks:
177
Description:
Turn expensive prompts into cheap fine-tuned models.
rosinality/stylegan2-pytorch8,335
Language:
Python
Stars:
2,834
Forks:
622
Description:
Implementation of Analyzing and Improving the Image Quality of StyleGAN (StyleGAN 2) in PyTorch.
datachain-ai/datachain8,340
Language:
Python
Stars:
2,826
Forks:
169
Description:
The Context Layer for unstructured data: typed, versioned datasets over S3, GCS, Azure.
huggingface/knockknock8,341
Language:
Python
Stars:
2,825
Forks:
223
Description:
🚪✊Knock Knock: Get notified when your training ends with only two additional lines of code.
mll-lab-nu/RAGEN8,344
Language:
Python
Stars:
2,824
Forks:
228
Description:
Agent RL framework for LLM agents: multi-turn reinforcement learning with StarPO and reasoning-collapse diagnostics.
huawei-noah/HEBO8,350
Language:
Jupyter Notebook
Stars:
2,812
Forks:
472
Description:
Bayesian optimisation & Reinforcement Learning library developed by Huawei Noah's Ark Lab.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryModel Development
SubcategoryFine-tuning
KeywordsPEFT
Stars2,832
Forks373
Contributors18
Created date2020-04-21
Updated date2026-10-12
Stars in 1 day0
Stars in 7 days1
Rank8,337
Previous rank8,389
Rank change52
7-day stars rank9,292
Previous 7-day stars rank9,345
7-day stars rank change53
Total stars rank4,774
Previous total stars rank4,771
Total stars rank change-3
CountryGermany
README summary

Adapters A Unified Library for Parameter-Efficient and Modular Transfer Learning _Adapters_ is an add-on library to HuggingFace's Transformers, integrating 10+ adapter methods into 20+ state-of-the-art Transformer models with minimal coding overhead for training and inference. _Adapters_ provides a unified interface for efficient fine-tuning and modular transfer learning, supporting a myriad of features like full-precision or quantized training (e. Q-LoRA, Q-Bottleneck Adapters, or Q-PrefixTuning), adapter merging via task arithmetics or the

composition of multiple adapters via composition blocks, allowing advanced research in parameter-efficient transfer learning for NLP tasks. **Note**: The _Adapters_ library has replaced the package. All previously trained adapters are compatible with the new library. For transitioning, please read: Installation currently supports **Python 3. After installing PyTorch, you can install from PyPI . or from source by cloning the repository: Quick Tour Load pre-trained adapters: **Learn More** Adapt existing model setups: **Learn More** Flexibly configure adapters: **Learn More** Easily

compose adapters in a single model: **Learn More** Useful Resources HuggingFace's great documentation on getting started with _Transformers_ can be found here. is fully compatible with _Transformers_. (2019) Bapna and Firat (2019) Steitz and Roth (2024) | Quickstart, Notebook | | AdapterFusion | Pfeiffer et al. (2021) | Docs: Training, Notebook | | MAD-X, Invertible adapters | Pfeiffer et al. (2020) | Notebook | | AdapterDrop | Rücklé et al. (2021) | Docs: Embeddings, Notebook | | Prefix Tuning | Li and Liang (2021) | Docs | | Parallel adapters, Mix-and-Match adapters | He et al

. (2021) | Docs | | Compacter | Mahabadi et al. (2021) | Docs | | MTL-LoRA | Yang et al. (2022) | Docs | | Vera | Kopiczko et al. (2022) | Docs | | Prompt Tuning | Lester et al. (2021) | Docs | | QLoRA | Dettmers et al. (2024) | Docs | | Adapter Task Arithmetics | Chronopoulou et al. (2023) | Docs, Notebook| Supported Models We currently support the PyTorch versions of all models listed on the **Model Overview page** in our documentation. Developing & Contributing To get started with developing on _Adapters_ yourself and learn more about ways to contribute

, please see Citation If you use _Adapters_ in your work, please consider citing our library paper: Adapters: A Unified Library for Parameter-Efficient and Modular Transfer Learning Alternatively, for the predecessor , the Hub infrastructure and adapters uploaded by the AdapterHub team, please consider citing our initial paper: AdapterHub: A Framework for Adapting Transformers

Frequently asked questions

How many stars and forks are recorded?

adapter-hub/adapters has 2,832 stars and 373 forks.

What is the repository rank?

adapter-hub/adapters is ranked 8,337.

What language and category are recorded?

adapter-hub/adapters has 2,832 stars, uses Python and belongs to Model Development.

Which repository is closest in rank?

adapter-hub/adapters is compared with rosinality/stylegan2-pytorch, ranked 8,335 with 2,834 stars.

README

Adapters

A Unified Library for Parameter-Efficient and Modular Transfer Learning

[Website](https://adapterhub.ml)
  •  
[Documentation](https://docs.adapterhub.ml)
  •  
[Paper](https://arxiv.org/abs/2311.11077)

Adapters is an add-on library to HuggingFace's Transformers, integrating 10+ adapter methods into 20+ state-of-the-art Transformer models with minimal coding overhead for training and inference.

Adapters provides a unified interface for efficient fine-tuning and modular transfer learning, supporting a myriad of features like full-precision or quantized training (e.g. Q-LoRA, Q-Bottleneck Adapters, or Q-PrefixTuning), adapter merging via task arithmetics or the composition of multiple adapters via composition blocks, allowing advanced research in parameter-efficient transfer learning for NLP tasks.

Note: The Adapters library has replaced the adapter-transformers package. All previously trained adapters are compatible with the new library. For transitioning, please read: https://docs.adapterhub.ml/transitioning.html.

Installation

adapters currently supports Python 3.9+ and PyTorch 2.0+. After installing PyTorch, you can install adapters from PyPI ...

pip install -U adapters

... or from source by cloning the repository:

git clone https://github.com/adapter-hub/adapters.git
cd adapters
pip install .

Quick Tour

Load pre-trained adapters:

from adapters import AutoAdapterModel
from transformers import AutoTokenizer

model = AutoAdapterModel.from_pretrained("roberta-base")
tokenizer = AutoTokenizer.from_pretrained("roberta-base")

model.load_adapter("AdapterHub/roberta-base-pf-imdb", source="hf", set_active=True)

print(model(**tokenizer("This works great!", return_tensors="pt")).logits)

Learn More

Adapt existing model setups:

import adapters
from transformers import AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained("t5-base")

adapters.init(model)

model.add_adapter("my_lora_adapter", config="lora")
model.train_adapter("my_lora_adapter")

# Your regular training loop...

Learn More

Flexibly configure adapters:

from adapters import ConfigUnion, PrefixTuningConfig, ParBnConfig, AutoAdapterModel

model = AutoAdapterModel.from_pretrained("microsoft/deberta-v3-base")

adapter_config = ConfigUnion(
    PrefixTuningConfig(prefix_length=20),
    ParBnConfig(reduction_factor=4),
)
model.add_adapter("my_adapter", config=adapter_config, set_active=True)

Learn More

Easily compose adapters in a single model:

from adapters import AdapterSetup, AutoAdapterModel
import adapters.composition as ac

model = AutoAdapterModel.from_pretrained("roberta-base")

qc = model.load_adapter("AdapterHub/roberta-base-pf-trec")
sent = model.load_adapter("AdapterHub/roberta-base-pf-imdb")

with AdapterSetup(ac.Parallel(qc, sent)):
    print(model(**tokenizer("What is AdapterHub?", return_tensors="pt")))

Learn More

Useful Resources

HuggingFace's great documentation on getting started with Transformers can be found here. adapters is fully compatible with Transformers.

To get started with adapters, refer to these locations:

  • Colab notebook tutorials, a series notebooks providing an introduction to all the main concepts of (adapter-)transformers and AdapterHub
  • https://docs.adapterhub.ml, our documentation on training and using adapters with adapters
  • https://adapterhub.ml to explore available pre-trained adapter modules and share your own adapters
  • Examples folder of this repository containing HuggingFace's example training scripts, many adapted for training adapters

Implemented Methods

Currently, adapters integrates all architectures and methods listed below:

Method Paper(s) Quick Links
Bottleneck adapters Houlsby et al. (2019)
Bapna and Firat (2019)
Steitz and Roth (2024) Quickstart, Notebook
AdapterFusion Pfeiffer et al. (2021) Docs: Training, Notebook
MAD-X,
Invertible adapters Pfeiffer et al. (2020) Notebook
AdapterDrop Rücklé et al. (2021) Notebook
MAD-X 2.0,
Embedding training Pfeiffer et al. (2021) Docs: Embeddings, Notebook
Prefix Tuning Li and Liang (2021) Docs
Parallel adapters,
Mix-and-Match adapters He et al. (2021) Docs
Compacter Mahabadi et al. (2021) Docs
LoRA Hu et al. (2021) Docs
MTL-LoRA Yang et al., 2024 Docs
(IA)^3 Liu et al. (2022) Docs
Vera Kopiczko et al., 2024 Docs
DoRA Liu et al., 2024 Docs
UniPELT Mao et al. (2022) Docs
Prompt Tuning Lester et al. (2021) Docs
QLoRA Dettmers et al. (2023) Notebook
ReFT Wu et al. (2024) Docs
Adapter Task Arithmetics Chronopoulou et al. (2023)
Zhang et al. (2023) Docs, Notebook

Supported Models

We currently support the PyTorch versions of all models listed on the Model Overview page in our documentation.

Developing & Contributing

To get started with developing on Adapters yourself and learn more about ways to contribute, please see https://docs.adapterhub.ml/contributing.html.

Citation

If you use Adapters in your work, please consider citing our library paper: Adapters: A Unified Library for Parameter-Efficient and Modular Transfer Learning

@inproceedings{poth-etal-2023-adapters,
    title = "Adapters: A Unified Library for Parameter-Efficient and Modular Transfer Learning",
    author = {Poth, Clifton  and
      Sterz, Hannah  and
      Paul, Indraneil  and
      Purkayastha, Sukannya  and
      Engl{\"a}nder, Leon  and
      Imhof, Timo  and
      Vuli{\'c}, Ivan  and
      Ruder, Sebastian  and
      Gurevych, Iryna  and
      Pfeiffer, Jonas},
    booktitle = "Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
    month = dec,
    year = "2023",
    address = "Singapore",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2023.emnlp-demo.13",
    pages = "149--160",
}

Alternatively, for the predecessor adapter-transformers, the Hub infrastructure and adapters uploaded by the AdapterHub team, please consider citing our initial paper: AdapterHub: A Framework for Adapting Transformers

@inproceedings{pfeiffer2020AdapterHub,
    title={AdapterHub: A Framework for Adapting Transformers},
    author={Pfeiffer, Jonas and
            R{\"u}ckl{\'e}, Andreas and
            Poth, Clifton and
            Kamath, Aishwarya and
            Vuli{\'c}, Ivan and
            Ruder, Sebastian and
            Cho, Kyunghyun and
            Gurevych, Iryna},
    booktitle={Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations},
    pages={46--54},
    year={2020}
}
Nearby in the ranking
Similar items