loralib
PyTorch implementation of low-rank adaptation (LoRA), a parameter-efficient approach to adapt a large pre-trained deep learning model which obtains performance on-par with full fine-tuning.
What it is and what it does
loralib is a library that implements Low-Rank Adaptation, a parameter-efficient fine-tuning technique for large language models. Instead of updating all weights during fine-tuning, LoRA freezes the original model weights and trains only small rank-decomposition matrices, dramatically reducing the number of trainable parameters and storage requirements while maintaining task performance.
The library integrates with transformer architectures and enables efficient task-switching during deployment without introducing inference latency. It requires Python 3.6 or later and has no external runtime dependencies, making it lightweight to install. The package is designed for use with pre-trained models from standard model repositories.
Use it for:
- Fine-tune large language models on specific tasks while storing only a fraction of the parameters needed for full fine-tuning.
- Adapt pre-trained models to multiple downstream tasks with minimal storage overhead for each task-specific checkpoint.
- Reduce training time and memory consumption when working with models in the billions of parameters.
- Implement efficient multi-task learning where different LoRA adapters can be swapped during inference.
- Integrate parameter-efficient adaptation into production systems where model size and deployment efficiency matter.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
loralib provides PyTorch modules that implement Low-Rank Adaptation (LoRA), enabling efficient fine-tuning of large language models by training only small rank-decomposition matrices while freezing original weights.
Yes, if you are actively fine-tuning large language models and need parameter efficiency. The package is stable and well-tested on standard benchmarks. However, note that loralib has been dormant since August 2023 and may not track the latest library changes, so verify compatibility with your current dependencies before adopting it in new projects.
Install
loralib on PyPI
pip
pip install loralibuv
uv add loralibpoetry
poetry add loralibInstalling loralib
Before you install
Installation is straightforward with no runtime dependencies. The package is dormant (last release August 2023), but remains stable for its core use case; note that alternative maintained implementations now exist.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install loralib
import loralib as lora
# Replace model layers with LoRA equivalents
model.layer = lora.Linear(in_features, out_features, r=8)
# Mark only LoRA parameters as trainable
lora.mark_only_lora_as_trainable(model)
Requires a deep learning framework (PyTorch) to be installed separately; loralib provides only the LoRA layer implementations.
Verify before relying
- Whether loralib remains compatible with current PyTorch and transformer library versions given its dormant maintenance status.
- Performance characteristics and memory savings compared to other parameter-efficient fine-tuning implementations.
- Whether the package tracks breaking changes in its dependencies since the last release in August 2023.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,083 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 214,254/month — #9,422 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: loralib-0.1.2-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
adaptersAdapters adds parameter-efficient fine-tuning…
permissive · top 15,000 on PyPI
peftPEFT implements parameter-efficient fine-tuning…
permissive · top 5,000 on PyPI
lycoris-loraImplements parameter-efficient fine-tuning…
permissive · top 15,000 on PyPI
pytorch-pretrained-bertProvides PyTorch implementations of BERT, GPT,…
permissive · top 15,000 on PyPI
transformer-smaller-training-vocabReduces transformer model vocabulary to only…
permissive · top 15,000 on PyPI
llamafactoryLLaMA Factory provides a unified framework for…
permissive · top 15,000 on PyPI
setfitSetFit fine-tunes Sentence Transformers for…
permissive · top 15,000 on PyPI
adam-atan2-pytorchProvides an Adam optimizer variant using atan2…
permissive · top 15,000 on PyPI
fla-coreProvides hardware-efficient implementations of…
permissive · top 15,000 on PyPI