esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

How Do You Serve Many LoRA Adapters?

How one shared base model serves many LoRA adapters: loading on demand, batching across adapters, memory limits and trade-offs, for your AI interview.

In short

Keep one copy of the base model loaded, keep the small LoRA adapters in memory, load on demand the ones a request needs, and batch requests for different adapters together. Serving systems such as vLLM and S-LoRA are built for this.

11 min readAdvancedOccasional · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

I keep one copy of the base model on the GPU and treat each LoRA adapter as a small add-on. The adapters wait in memory, and the ones a request needs are loaded when it arrives. Requests for different adapters go into the same batch, so the GPU stays busy. The limits are GPU memory, the delay of a cache miss, and one busy customer crowding out the rest. Systems like vLLM and S-LoRA are built for this.

What is serving many LoRA adapters, in plain words?

A LoRA adapter (short for low-rank adaptation) is a small add-on of learned changes that sits on top of a base model. The base model is the big shared model, and its weights stay as they are. Each adapter teaches it one job, such as answering auto claim questions or home claim questions.

Serving means answering live requests from users. A made-up insurer with 120 adapters could run a full model for each one, but that uses a lot of GPU memory. The better design loads the base model once and brings in each adapter when a request needs it.

Think of a claims office with one senior adjuster who knows the whole job, and a short note for each claim type. The adjuster keeps the same knowledge for every claim and reads only the note that matches the file on the desk. In the AI version, the base model is the adjuster and each LoRA adapter is one of those notes.

The 2021 LoRA paper froze the base weights and trained only small added grids of numbers, called matrices. That is why one base model can carry many adapters.

Key words

Base model
The big shared model. Every adapter sits on top of the same copy.
LoRA adapter
A small add-on file of learned changes, loaded on top of the base model.
Batch
A group of requests the GPU works on together in one pass.
Cache miss
A request needs an adapter that is not on the GPU yet, so it must be loaded first.

Why not one full model per adapter?

Full copies are the simple option, and that is the trap. Each copy holds all the base weights, so memory runs out quickly. Two research papers make the point.

  • “deploying independent instances of fine-tuned models, each with 175B parameters, is prohibitively expensive”

    LoRA paper, 2021

  • “This allows a GPU to hold only a single copy of the underlying pre-trained model when serving multiple, different LoRA models”

    Punica paper, 2023

Traffic is uneven, and the mix matters. In the made-up insurer, auto and home claims make up most calls, so a few adapters are busy while the rest get a call now and then. The chart compares the two designs side by side.

Two ways to serve 120 adapters

One full model per adapter

120 model copies

each holds all the base weights

One base, many adapters

1 base model

small adapters sit on top of it

Memory runs out fast

most copies sit idle most of the time

Only busy adapters on GPU

hot adapters load, the rest wait

  1. 1Each adapter gets a full copy, so GPU memory fills up.
  2. 2One base serves them all, and only the adapters in use are loaded.
Two ways to serve the same made-up set of 120 adapters. Full copies fill GPU memory with models that sit idle. One shared base loads only the adapters in use.

vLLM serves adapters per request with minimal overhead. S-LoRA describes itself as "a system designed for the scalable serving of many LoRA adapters".

How does one server answer requests for different adapters?

Three things happen, in order. First, each request names its adapter in the model field, the same way it would name any other model. Second, the server groups waiting requests into a batch, even when they use different adapters. Third, the GPU runs that batch in one pass with custom code, called a kernel. Punica built one for this.

One base model, adapters loaded on demand

Auto claim question

asks for the auto adapter

Home claim question

asks for the home adapter

Batch builder

groups requests into one batch

Adapter store

every adapter, kept in CPU memory

One GPU

Adapter cache

hot adapters kept in GPU memory

Base model

loaded once, frozen

Answers

each from its own adapter

  1. 1The auto claim question asks for the auto adapter by name.
  2. 2The home claim question asks for the home adapter by name.
  3. 3On a cache miss, the adapter is copied from CPU memory to the GPU.
  4. 4One mixed batch runs on the shared base model, each row with its own adapter.
  5. 5Each user gets an answer from their own adapter.
A request names its adapter, and the batch builder groups requests for one base model. A cache miss copies the adapter in from CPU memory first. Each answer comes from its own adapter.
  1. 1

    Adapter already on the GPU

    The request joins the shared batch at once, with no extra wait.

  2. 2

    Adapter in CPU memory

    This is a cache miss. The adapter is copied to the GPU first, which adds delay to that request. S-LoRA keeps all adapters in main memory and fetches the ones in use to the GPU.

  3. 3

    GPU memory is full

    Drop the least recently used adapter to make room. It is a common rule, not the only one.

vLLM's docs say requests for an adapter run in parallel with base model requests, and potentially with other adapter requests when max_loras is set high enough. That setting is one of several LoRA limits the server accepts.

Here is the cache idea in plain Python, with a made-up morning of claim traffic. The GPU has room for three adapters, and the rest wait in CPU memory.

Python
# Simplified adapter cache. The GPU has room for 3 adapters; the rest wait in CPU memory.
from collections import OrderedDict

GPU_SLOTS = 3
gpu = OrderedDict()  # adapter name -> loaded, least recently used first
loads = 0

def serve(adapter):
    global loads
    if adapter in gpu:
        gpu.move_to_end(adapter)  # mark as recently used
        return f"{adapter}: on GPU"
    loads += 1  # a cache miss: copy the adapter from CPU memory to the GPU
    evicted = ""
    if len(gpu) == GPU_SLOTS:
        old, _ = gpu.popitem(last=False)  # drop the least recently used one
        evicted = f", evicted {old}"
    gpu[adapter] = True
    return f"{adapter}: loaded from CPU{evicted}"

traffic = ["claims-auto", "claims-home", "claims-auto", "claims-travel",
           "claims-pet", "claims-auto", "claims-home"]
for name in traffic:
    print(serve(name))
print("cache misses:", loads)

Output

claims-auto: loaded from CPU
claims-home: loaded from CPU
claims-auto: on GPU
claims-travel: loaded from CPU
claims-pet: loaded from CPU, evicted claims-home
claims-auto: on GPU
claims-home: loaded from CPU, evicted claims-travel
cache misses: 5

The printout shows five cache misses in seven requests. Real traffic is different, so the hit rate depends on how skewed the adapter mix is. Measure it.

What limits do you have to plan for?

  1. 1

    GPU memory is shared

    The base weights, the loaded adapters and the working memory of each running request all compete for the same GPU.

  2. 2

    Set the maximum rank

    Rank sets how big each adapter's small added matrices are. In vLLM, set --max-lora-rank to the largest rank you actually use. Going much higher wastes memory.

  3. 3

    Cache misses cost time

    Each miss adds load time to the one request that triggers it. Watch the miss rate, and keep the busiest adapters hot.

  4. 4

    One busy customer

    Set a limit per customer, and watch the wait time for each adapter, not only the average.

  5. 5

    Adapters can change while it runs

    vLLM can load an adapter through an API, with a POST request to /v1/load_lora_adapter, while the server runs. First set the environment variable VLLM_ALLOW_RUNTIME_LORA_UPDATING to True. The docs warn that this feature has security risks and should not be used in production unless the environment is isolated and fully trusted.

Tip

Asked about limits, don't stop at GPU memory. Name the cache miss and the busy customer, then say what you would measure first.

How would you add a new adapter for one customer without slowing the others?

Load the new adapter next to the others and send it a small share of traffic. Watch its cache misses, its wait time and its errors before you widen the share.

Check its rank against the server's maximum. If it keeps pushing busy adapters out of the cache, either the cache is too small or the mix is too wide for one GPU. That is a capacity decision for the team.

What does the interviewer want to hear?

A strong answer covers

  • A plain definition: small adapters on one shared base model.
  • Why not a full model per adapter: memory runs out.
  • How requests name an adapter and share a batch.
  • Cache misses, and how the busy adapters stay on the GPU.
  • The limits: GPU memory, adapter rank, and one busy customer.
  • What you would measure before you trust the setup.

Common traps

  • Trap"Give every adapter its own model copy. It's the simplest."

    BetterIt's simple at ten adapters and costly at a hundred. Keep one base and load the adapters into it.

  • Trap"Merge all the adapters into the base weights, then serve one model."

    BetterMerging removes the extra adapter step at inference, but gives one fixed model, so you lose the choice of adapter per request.

  • Trap"Adapters are tiny, so they cost nothing to keep."

    BetterThey are small, but each loaded one takes GPU memory that the batches and the cache also need.

Can you spot the problem?

Spot the problem

Your gateway knows three registered adapters: claims-auto, claims-home and claims-pet. It gets four requests. Which one should it reject before the GPU sees it?

Quick check

An insurer has 120 adapters, uneven traffic and one GPU budget. Which setup fits best?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q284What is LoRA?10 min
  2. Q286What does LoRA rank mean?10 min
  3. Q305Prompt/prefix tuning vs LoRA?11 min
  4. Q314Static vs continuous batching?12 min
  5. Q320Serving engines (vLLM, SGLang, TensorRT-LLM, llama.cpp)?11 min
  6. Q055What is the KV cache, and why does it speed up generation?12 min

Last updated on 27 November 2026

Serving many fine-tuned models for your product?

I design and build AI products and agents, including the system behind them. Book a short call and tell me how many adapters you run, how busy each one is, and what a slow answer costs you.