A unified library for parameter-efficient and modular transfer learning, supporting adapter methods like LoRA, Bottleneck Adapters, AdapterPlus, DoRA, and ReFT. Built on Hugging Face Transformers. Current version: 1.3.0. Release cadence: irregular, roughly every 2-3 months.
Install & Compatibility
Where this runs
tested against v1.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 248.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 12.8s · import 0.000s · 227MB
251MB installed
● package 251MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AutoAdapterModel
✓ from adapters import AutoAdapterModel
✗ from adapters import AutoAdapterModel
Load a BERT model, add a LoRA adapter, and run a forward pass.
from transformers import AutoTokenizer
from adapters import AutoAdapterModel, LoRAConfig
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = AutoAdapterModel.from_pretrained("bert-base-uncased")
# Add a LoRA adapter with configuration
config = LoRAConfig(r=8, alpha=16)
model.add_adapter("my_lora_adapter", config=config)
model.train_adapter("my_lora_adapter")
# Example: encode a sentence
inputs = tokenizer("Hello, adapters!", return_tensors="pt")
outputs = model(**inputs)
print(outputs.last_hidden_state.shape)
Audit
Dependencies
transformersrequiredCore dependency; adapters is built on top of HF Transformers