lorax is a free, open source machine learning infrastructure project written in Python and released under Apache-2.0. It has 3,832 GitHub stars, 324 forks and 189 open issues, and was last pushed 4 months ago. On this registry it ranks #35 of 57 tracked projects in Machine Learning Infrastructure, with 5 head-to-head comparisons available.

What is lorax?

What it is

LoRAX, short for LoRA eXchange, is an open-source Python framework for serving many fine-tuned large language models from a single GPU. It lives in machine learning infrastructure and uses base models with LoRA adapters. The base model is shared across requests, while task-specific adapter weights are loaded dynamically for each request.

The concrete problem it solves is the high cost of serving many specialized model variants. Instead of running a separate server for each fine-tuned model, LoRAX lets one server host thousands of LoRA adapters and switch between them during inference. The project aims to reduce serving cost while keeping throughput and latency stable as concurrent adapter demand grows.

Key capabilities

  • Dynamic adapter loading accepts LoRA adapters from HuggingFace, Predibase, or a local filesystem in a request and loads them just-in-time without blocking concurrent requests.
  • Adapter merging combines multiple adapters per request to create an ensemble model.
  • Heterogeneous continuous batching packs requests for different adapters into the same batch, keeping latency and throughput nearly constant as concurrent adapters increase.
  • Adapter exchange scheduling prefetches and offloads adapters between GPU and CPU memory and schedules request batching to optimize aggregate throughput.
  • Optimized inference includes tensor parallelism, pre-compiled CUDA kernels for flash-attention, paged attention, and SGMV, quantization, and token streaming.
  • Production tooling includes prebuilt Docker images, Helm charts for Kubernetes, Prometheus metrics, and Open Telemetry tracing, while the serving interface includes an OpenAI-compatible API for multi-turn chat, JSON structured output, and per-request tenant isolation.

Who uses it and how

  • Teams that need many task-specific variants of one base model can host those variants as adapters rather than as full model copies.
  • Applications that choose an adapter per request can call the REST API, Python client, or OpenAI-compatible chat API and receive streamed tokens.
  • Production platforms can deploy LoRAX on Kubernetes with Helm charts and monitor it with Prometheus metrics and Open Telemetry tracing.

Getting started

The README recommends starting with the prebuilt Docker image to avoid compiling custom CUDA kernels and other dependencies. After launching the server, users can prompt the model through the REST API, the Python client, or the OpenAI-compatible chat API.

When to use it — and when not to

LoRAX fits workloads with many LoRA adapters over a supported base model, especially when one GPU must serve many variants. It is less suitable when the needed base architecture is not supported, when adapters are not LoRA adapters trained with PEFT or Ludwig, or when a team does not want to operate GPU serving, Docker, Kubernetes, metrics, and tracing. The provided facts list 189 open issues and do not describe a hosted option, so self-hosting and operational maturity need evaluation.

project readme (upstream, from github) — read inline

LoRAX: Multi-LoRA inference server that scales to 1000s of fine-tuned LLMs

License Artifact Hub

LoRAX (LoRA eXchange) is a framework that allows users to serve thousands of fine-tuned models on a single GPU, dramatically reducing the cost of serving without compromising on throughput or latency.

📖 Table of contents

🌳 Features

  • 🚅 Dynamic Adapter Loading: include any fine-tuned LoRA adapter from HuggingFace, Predibase, or any filesystem in your request, it will be loaded just-in-time without blocking concurrent requests. Merge adapters per request to instantly create powerful ensembles.
  • 🏋️‍♀️ Heterogeneous Continuous Batching: packs requests for different adapters together into the same batch, keeping latency and throughput nearly constant with the number of concurrent adapters.
  • 🧁 Adapter Exchange Scheduling: asynchronously prefetches and offloads adapters between GPU and CPU memory, schedules request batching to optimize the aggregate throughput of the system.
  • 👬 Optimized Inference: high throughput and low latency optimizations including tensor parallelism, pre-compiled CUDA kernels (flash-attention, paged attention, SGMV), quantization, token streaming.
  • 🚢 Ready for Production prebuilt Docker images, Helm charts for Kubernetes, Prometheus metrics, and distributed tracing with Open Telemetry. OpenAI compatible API supporting multi-turn chat conversations. Private adapters through per-request tenant isolation. Structured Output (JSON mode).
  • 🤯 Free for Commercial Use: Apache 2.0 License. Enough said 😎.

🏠 Models

Serving a fine-tuned model with LoRAX consists of two components:

  • Base Model: pretrained large model shared across all adapters.
  • Adapter: task-specific adapter weights dynamically loaded per request.

LoRAX supports a number of Large Language Models as the base model including Llama (including CodeLlama), Mistral (including Zephyr), and Qwen. See Supported Architectures for a complete list of supported base models.

Base models can be loaded in fp16 or quantized with bitsandbytes, GPT-Q, or AWQ.

Supported adapters include LoRA adapters trained using the PEFT and Ludwig libraries. Any of the linear layers in the model can be adapted via LoRA and loaded in LoRAX.

🏃‍♂️ Getting Started

We recommend starting with our pre-built Docker image to avoid compiling custom CUDA kernels and other dependencies.

Requirements

The minimum system requirements need to run LoRAX include:

  • Nvidia GPU (Ampere generation or above)
  • CUDA 11.8 compatible device drivers and above
  • Linux OS
  • Docker (for this guide)

Launch LoRAX Server

Prerequisites

Install nvidia-container-toolkit Then

  • sudo systemctl daemon-reload
  • sudo systemctl restart docker
model=mistralai/Mistral-7B-Instruct-v0.1
volume=$PWD/data

docker run --gpus all --shm-size 1g -p 8080:80 -v $volume:/data \
    ghcr.io/predibase/lorax:main --model-id $model

For a full tutorial including token streaming and the Python client, see Getting Started - Docker.

Prompt via REST API

Prompt base LLM:

curl 127.0.0.1:8080/generate \
    -X POST \
    -d '{
        "inputs": "[INST] Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May? [/INST]",
        "parameters": {
            "max_new_tokens": 64
        }
    }' \
    -H 'Content-Type: application/json'

Prompt a LoRA adapter:

curl 127.0.0.1:8080/generate \
    -X POST \
    -d '{
        "inputs": "[INST] Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May? [/INST]",
        "parameters": {
            "max_new_tokens": 64,
            "adapter_id": "vineetsharma/qlora-adapter-Mistral-7B-Instruct-v0.1-gsm8k"
        }
    }' \
    -H 'Content-Type: application/json'

See Reference - REST API for full details.

Prompt via Python Client

Install:

pip install lorax-client

Run:

from lorax import Client

client = Client("http://127.0.0.1:8080")

# Prompt the base LLM
prompt = "[INST] Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May? [/INST]"
print(client.generate(prompt, max_new_tokens=64).generated_text)

# Prompt a LoRA adapter
adapter_id = "vineetsharma/qlora-adapter-Mistral-7B-Instruct-v0.1-gsm8k"
print(client.generate(prompt, max_new_tokens=64, adapter_id=adapter_id).generated_text)

See Reference - Python Client for full details.

For other ways to run LoRAX, see Getting Started - Kubernetes, Getting Started - SkyPilot, and Getting Started - Local.

Chat via OpenAI API

LoRAX supports multi-turn chat conversations combined with dynamic adapter loading through an OpenAI compatible API. Just specify any adapter as the model parameter.

from openai import OpenAI

client = OpenAI(
    api_key="EMPTY",
    base_url="http://127.0.0.1:8080/v1",
)

resp = client.chat.completions.create(
    model="alignment-handbook/zephyr-7b-dpo-lora",
    messages=[
        {
            "role": "system",
            "content": "You are a friendly chatbot who always responds in the style of a pirate",
        },
        {"role": "user", "content": "How many helicopters can a human eat in one sitting?"},
    ],
    max_tokens=100,
)
print("Response:", resp.choices[0].message.content)

See OpenAI Compatible API for details.

Next steps

Here are some other interesting Mistral-7B fine-tuned models to try out:

You can find more LoRA adapters here, or try fine-tuning your own with PEFT

readme truncated — read the full docs on github

Frequently asked questions

Is lorax free to use?

lorax is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does lorax do?

Multi-LoRA inference server that scales to 1000s of fine-tuned LLMs

What is lorax written in?

lorax is primarily written in Python. Its source is publicly available at https://github.com/predibase/lorax, and it has 3,832 GitHub stars.