Skip to content

vllm.lora.request

Classes:

LoRARequest

Bases: Struct

Request for a LoRA adapter.

lora_int_id must be globally unique for a given adapter. This is currently not enforced in vLLM.

If True, forces reloading the adapter even if one

with the same lora_int_id already exists in the cache. This replaces the existing adapter in-place. If False (default), only loads if the adapter is not already loaded.

Methods:

  • __eq__ –

    Compares lora_name and lora_int_id. A name loaded again at runtime

Attributes:

is_3d_lora_weight = False class-attribute instance-attribute

Whether this adapter's MoE weights are stored in the 3D fused gate_up_proj / down_proj layout (one fused tensor per layer) or the 2D per-expert split layout (separate gate_proj / up_proj / down_proj tensors per expert). Only consulted when the engine is started with enable_mixed_moe_lora_format=True; otherwise it is ignored and the on-disk format is inferred from the base model.

__eq__(value)

Compares lora_name and lora_int_id. A name loaded again at runtime gets a new lora_int_id while requests for the old one may still be running, and the engine needs both adapters active.

_TensorLoRARequest

Bases: LoRARequest

Worker-local request for internal integrations such as verl.

Construct this after the framework has received and retained the complete adapter tensors on the worker. Do not pass it through engine requests or the public add_lora RPC. The framework owns update synchronization.

Warning

Prefix cache keys use the adapter name and path, not tensor contents. Replacing weights under the same name and path can reuse stale KV cache and produce incorrect outputs, even if the adapter ID changes. The framework must invalidate the old KV cache before resuming inference; loading or removing an adapter does not do this automatically.