> ## Documentation Index
> Fetch the complete documentation index at: https://docs.m-star.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Per-request LoRA adapters

> Load a named PEFT adapter and select it for an individual request.

Load several PEFT LoRA adapters into one deployment and choose an adapter per request. Different adapters and the base model can share a batch.

## Choose a supported model

| Family | Adapter targets | GPU validation |
| - | - | - |
| Qwen3.5 and Qwen3.8 | Text stack, LM head, embeddings, vision blocks, merger and patch embed | Qwen3.5 text targets measured. Other combinations unverified |
| Orpheus | Language model projections, head and embeddings | Unverified |
| Higgs Audio | Language model projections and head | Unverified |
| Qwen3-Omni | Thinker projections and head, optional per-expert targets | CPU comparisons only |
| Qwen3-TTS | Talker projections and codec head | CPU comparisons only |
| Chatterbox and Chatterbox Multilingual | T3 projections and speech head | Unvalidated. The comparison against merged weights fails on some rows. |

Phi-4 uses its built-in vision and speech adapters for media requests. Extra slots can serve a user adapter on text-only requests. See [GPU checks by model](https://github.com/mstar-project/mstar/blob/main/benchmark/lora/README.md).

## Name an adapter

In a copy of the serving config, add a `lora` entry to `resources`. Replace the sample path with a PEFT directory or safetensors file trained for the chosen checkpoint.

```yaml theme={null}
resources:
  lora:
    max_slots: 4
    max_rank: 16
    adapters:
      sql: /adapters/qwen3_5-4b-sql/adapter_model.safetensors
      chat: /adapters/qwen3_5-4b-chat   # a PEFT directory
```

Start `mstar serve qwen3_5_4b --config <your-config.yaml>`. The server validates adapter targets, rank and shapes at startup. Size `max_slots` for the number of adapters resident together and `max_rank` for the largest rank you serve.

## Check the adapter and send a request

`GET /v1/models` lists the base model and loaded adapters. Pass the configured adapter name in the OpenAI `model` field:

```bash theme={null}
curl -sS http://localhost:8000/v1/chat/completions -H 'Content-Type: application/json' \
  -d '{"model": "sql", "messages": [{"role": "user", "content": "List the tables in a library database."}]}'
```

For native `/generate`, pass `"lora_adapter": "sql"` in `model_kwargs`. To use the base weights on this route, omit `lora_adapter`. On an OpenAI route, set `model` to the base model’s name.

## Load or unload after startup

Set `runtime_updates: true` under `resources.lora` to expose the update routes. Every worker needs read access to the named path. With the default setting, both routes return 404.

```bash theme={null}
curl -X POST localhost:8000/v1/load_lora_adapter -H 'Content-Type: application/json' \
  -d '{"lora_name": "sql", "lora_path": "/adapters/qwen3_5-4b-sql"}'
curl -X POST localhost:8000/v1/unload_lora_adapter -H 'Content-Type: application/json' \
  -d '{"lora_name": "sql"}'
```

## Adapter compatibility

Match the checkpoint’s shapes and supported modules. The service refuses DoRA, `modules_to_save`, trainable tokens and bias LoRA. Qwen3-Omni requires explicit per-expert targets for expert adapters and refuses them under expert parallelism.

A vocabulary-sized target can use about 40 MB per adapter slot per GPU. A `lora:` block disables resident decode planning. At rank 16, an expert adapter slot for Qwen3-Omni holds about 1.7 GB of expert A/B matrices. With 128 experts the pool fits at most seven slots.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.