OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

X-LoRA

X-LoRA is a Python library that combines fine-tuned LoRA adapters for Hugging Face Transformers models by learning scaling values that gate the adapters as a mixture of experts. The project describes dense, layer-wise combinations and token-by-token scalings, while keeping the base model and adapters frozen during its low-parameter fine-tuning approach.

Independent OpenViST project profile, based on linked sources.

X-LoRA — Adapter-based model development where the base model and LoRA weights remain frozen
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use X-LoRA when a Transformers language-model workflow needs to combine multiple fine-tuned LoRA experts through learned scaling rather than selecting a single adapter.

Who it is for

  • Language-model developers combining multiple task-specific LoRA checkpoints
  • Researchers exploring learned gating and mixtures of LoRA experts
  • Developers who want to load or inspect trained X-LoRA models in a Transformers workflow

Documented uses

  • Combine multiple LoRA adapters through learned gating values.
  • Add X-LoRA configuration to a loaded Transformers model.
  • Load a saved X-LoRA model alongside its base model.
  • Log scaling values and inspect trainable parameter counts.
Before you choose

Requirements & limits

The repository is public and lists an Apache-2.0 license. The README documents installation from the Git repository and says a pip release is pending.

  • The workflow requires a base Transformers model and adapter checkpoints; X-LoRA supplies the learned gating mechanism.
  • The README's conversion example specifies CUDA, while the project record lists Linux, Windows, and macOS as platforms.
  • Mistral.rs is a separate inference framework identified by the README as supporting X-LoRA.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Add X-LoRA to a Transformers model

Configure a loaded Transformers model with multiple LoRA adapter checkpoints.

Before you start

  • Python environment with X-LoRA, PyTorch, and Hugging Face Transformers
  • A Transformers base model and local adapter checkpoint paths
  • A device value for the model and X-LoRA configuration

Steps

  1. Load the base model with Transformers AutoModelForCausalLM and load its configuration with AutoConfig.

  2. Create an X-LoRA configuration using the model hidden size, base model ID, device, and adapter checkpoint paths.

  3. Pass the model and configuration to xlora.add_xlora_to_model.

Expected outcome

The loaded model is converted to an X-LoRA model configured with the specified adapters.

Guide limitations

  • The example is a model-conversion setup, not a complete training or inference procedure.
  • The README's example uses a CUDA device; it does not establish compatibility for every model or device.
Source-based practical guide

Load a saved X-LoRA model

Load a trained X-LoRA model using a base Transformers model.

Before you start

  • Python environment with X-LoRA, PyTorch, and Hugging Face Transformers
  • A base model ID and a saved X-LoRA model path
  • A device for loading the model

Steps

  1. Load the base model with Transformers AutoModelForCausalLM.

  2. Call xlora.from_pretrained with the saved X-LoRA model path, base model object, and device.

Expected outcome

The example returns a model loaded with the saved X-LoRA configuration.

Guide limitations

  • The README example does not provide a subsequent inference or evaluation procedure.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
21 November 2026
Original website title
EricLBuehler/xlora · Official homepage title · retained in its source language