{"record":{"id":"98f852d56cb9b0d9","repo":"sgl-project/sglang","slug":"lora-is-not-enabled-please-set-enable-lora-to","errorCode":null,"errorMessage":"LoRA is not enabled. Please set `--enable-lora` to enable LoRA.","messagePattern":"LoRA is not enabled\\. Please set `--enable-lora` to enable LoRA\\.","errorType":"http","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/managers/tokenizer_control_mixin.py","lineNumber":613,"sourceCode":"        # Initiate the actual unloading operation at the backend processes only after all\n        # ongoing requests using this LoRA adapter are finished.\n        await self.lora_registry.wait_for_unload(lora_id)\n        result = _merge_lora_update_results(\n            await self.update_lora_adapter_communicator(obj)\n        )\n\n        return result\n\n    async def load_lora_adapter(\n        self: TokenizerManager,\n        obj: LoadLoRAAdapterReqInput,\n        _: Optional[fastapi.Request] = None,\n    ) -> LoadLoRAAdapterReqOutput:\n        self.auto_create_handle_loop()\n\n        try:\n            if not get_lora().enable_lora:\n                raise ValueError(\n                    \"LoRA is not enabled. Please set `--enable-lora` to enable LoRA.\"\n                )\n\n            assert (\n                get_parallel().dp_size == 1 or get_parallel().enable_dp_attention\n            ), \"dp_size must be 1 or dp attention must be enabled for dynamic lora loading\"\n            logger.info(\n                \"Start load Lora adapter. Lora name=%s, path=%s\",\n                obj.lora_name,\n                obj.lora_path,\n            )\n\n            async with self.lora_update_lock:\n                # Generate new uniquely identifiable LoRARef object.\n                new_adapter = LoRARef(\n                    lora_name=obj.lora_name,\n                    lora_path=obj.lora_path,\n                    pinned=obj.pinned,","sourceCodeStart":595,"sourceCodeEnd":631,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/managers/tokenizer_control_mixin.py#L595-L631","documentation":"The /load_lora_adapter HTTP/control API refuses to load a LoRA adapter because the server was not started with --enable-lora, so no LoRA support is initialized.","triggerScenarios":"Calling load_lora_adapter on a server launched without --enable-lora (or with enable_lora false in runtime config).","commonSituations":"Forgetting the launch flag when adding dynamic LoRA loading to a serving stack; config presets that drop the flag.","solutions":["Relaunch the server with --enable-lora (and set --max-lora-rank/--lora-modules as needed)","Verify get_lora().enable_lora in your runtime config before issuing the request"],"exampleFix":"# before\npython -m sglang.launch_server --model-path ...\n# after\npython -m sglang.launch_server --model-path ... --enable-lora --max-lora-rank 64","handlingStrategy":"validation","validationCode":"resp = requests.get(server + '/get_server_info')\nif not resp.json().get('enable_lora'):\n    skip_or_fail('server lacks --enable-lora')","typeGuard":null,"tryCatchPattern":"try:\n    await client.load_lora_adapter(req)\nexcept ValueError as e:\n    if 'enable-lora' in str(e):\n        raise ConfigError('relaunch server with --enable-lora') from e\n    raise","preventionTips":["Bake --enable-lora into launch templates for LoRA-serving deployments","Query server info before LoRA API calls"],"tags":["lora","config","http-api"],"backgroundTag":"feature-not-enabled","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}