LoRA compression & execution

Smaller adapters. Explicit control.#

Compress LoRA factors, allocate a rank budget, and connect optional serving kernels. Built as a Python library with clear ownership, scaling, and hardware contracts.
Development release. Experimental APIs are explicitly marked alpha. Installation is from this repository; hardware coverage and numerical results are documented per feature. The footer links the published source revision.
Compress adapters

Apply spectral compression to PEFT LoRA factors and export physically compact files while preserving adapter scaling.

PEFT adapter files
Plan a budget

Allocate retained directions or caller-supplied quality curves with deterministic CPU planners. No GPU needed.

Budget allocation
Serve with explicit opt-ins

Connect SGLang and explore packaged NF4/GDN experiments with clear version, initialization, and hardware boundaries.

Experimental APIs

Start with one adapter#

Install matching GPU dependencies, then compress a local adapter:

from loraforge.adapters import compress_peft_adapter

result = compress_peft_adapter(
    "adapter-original",
    "adapter-r4",
    keep=4,
    device="cuda:0",
)

FlashTSQR is the default compression backend. The output directory is new; input files stay unchanged. Compression quality depends on the adapter and retained rank: measure it on your task before deployment.

Find your path#

Goal

Start here

Install the library and choose dependencies

Installation

Run a CPU planner or compress PEFT files

Quickstart

Understand tensor ownership and scaling

User guides

Inspect signatures and experimental status

API reference

Evaluate the recorded measurements

Experiments

Contribute or build this site

Development