sgl-project/sglang · error · ValueError

Adapter {nickname} not found in the pipeline. Please provide

Error message

Adapter {nickname} not found in the pipeline. Please provide lora_path to load it.

What it means

When set_lora iterates zip(lora_nicknames, lora_paths, lora_alphas), a nickname that is not already loaded (not in self.lora_adapters) must come with a lora_path; passing None for both means there is nothing to apply.

Source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/lora/pipeline.py:991

        self._reject_lora_on_packed_weights()

        # Disable layerwise offload before convert_to_lora_layers to ensure weights are accessible
        # This is critical because convert_to_lora_layers needs to save cpu_weight from actual weights,
        # not from offloaded placeholder tensors
        if not self.lora_initialized:
            with self._temporarily_disable_offload(
                target="all", use_module_names_only=True
            ):
                self.convert_to_lora_layers()

        # Check adapter presence and load missing adapters
        adapter_updated = False
        rank = dist.get_rank()

        # load required adapters
        for nickname, path, alpha in zip(lora_nicknames, lora_paths, lora_alphas):
            if nickname not in self.lora_adapters and path is None:
                raise ValueError(
                    f"Adapter {nickname} not found in the pipeline. Please provide lora_path to load it."
                )
            # Check if adapter needs to be loaded
            should_load = False
            if path is not None:
                if nickname not in self.loaded_adapter_paths:
                    should_load = True
                elif self.loaded_adapter_paths[nickname] != path:
                    should_load = True
            if should_load:
                adapter_updated = True
                self.load_lora_adapter(path, nickname, rank, lora_alpha=alpha)
            elif (
                alpha is not None and self.loaded_adapter_alphas.get(nickname) != alpha
            ):
                self.loaded_adapter_alphas[nickname] = alpha
                adapter_updated = True

View on GitHub (pinned to 0132848349)

Solutions

  1. Provide the checkpoint path: set_lora(lora_nicknames=['a'], lora_paths=['/path/to/a.safetensors'])
  2. Verify the nickname matches one previously loaded (check pipeline.lora_adapters.keys())
  3. Fix the typo in the nickname

Example fix

# before
pipeline.set_lora(lora_nicknames=['style'], lora_paths=[None])
# after
pipeline.set_lora(lora_nicknames=['style'], lora_paths=['/ckpt/style.safetensors'])
Defensive patterns

Strategy: validation

Validate before calling

for n, p in zip(nora_nicknames or [], lora_paths or []):
    if n not in pipeline.lora_adapters:
        assert p, f'{n} not loaded and no path given'

Prevention

When it happens

Trigger: Calling set_lora(lora_nicknames=['myadapter']) with no lora_paths entry (or None) when 'myadapter' was never previously loaded into the pipeline.

Common situations: Referencing an adapter by nickname expecting it to be pre-loaded, but the pipeline was restarted or the adapter load failed earlier; nickname typo so the lookup misses.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/fbe5ce51dc624a95. Report an issue: GitHub.