Registry / ai-ml / alora
library0.3.0pypypi✓ verified 80d ago

Activated LoRA (aLoRA) is a low rank adapter architecture that allows reusing existing base model KV cache, built on top of PEFT. Version 0.3.0 is current; pre-1.0 release cadence is intermittent.

pip install alora
INSTALL
IMPORT
SIG · ALORA
A
alora
ai-mlpythonv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AloraConfig
import alora
from alora import AloraConfig

Instantiate aLoraConfig, wrap a base model with AloraModel, and generate text.

from transformers import AutoModelForCausalLM, AutoTokenizer from alora import AloraConfig, AloraModel model_name = "gpt2" model = AutoModelForCausalLM.from_pretrained(model_name) tokenizer = AutoTokenizer.from_pretrained(model_name) alora_config = AloraConfig( r=8, lora_alpha=16, target_modules=["q_proj", "v_proj"], use_activated_lora=True ) model = AloraModel(model, alora_config) inputs = tokenizer("Hello, I'm", return_tensors="pt") outputs = model.generate(**inputs, max_new_tokens=20) print(tokenizer.decode(outputs[0]))
Debug
Known issues
breakingv0.3.0 changed base class from PEFT's LoraModel to PeftModel. Custom subclasses of AloraModel may break if they rely on LoraModel internals.
fix
Update any custom subclass to use PeftModel instead of LoraModel, or pin alora==0.2.0.
affects: 0.2.0 -> 0.3.0
deprecatedbitsandbytes import path changed in PEFT; direct bnb imports are deprecated. Alora uses peft.utils for bnb-related modules.
fix
Ensure bitsandbytes is installed and use from peft.import_utils import is_bnb_available instead of direct bnb imports.
affects: >=0.2.0
gotchaAloraModel expects a HuggingFace model as the first argument, not model id. Passing a string causes AttributeError.
fix
Always call with an instantiated model object: AloraModel(model, config), not AloraModel('model_name', config).
affects: all
Upgrade
Version history
0.3.0latest on PyPI · released Jun 9, 2025
Audit
Dependencies
peftrequiredaLoRA subclasses PEFT models and requires bitsandbytes integration
torchrequiredUnderlying tensor operations and model loading
bitsandbytesoptionalRequired for quantization support (bnb import from PEFT)
Agent activity
59 hits · last 30 days
node
50
OpenAI (training)
2
Amazon
1
Perplexity
1
Resources
alora — pip install alora · libregistry