Skip to main content
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

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.

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.
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:
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.

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.