@@ -48,9 +48,12 @@ def __init__(
4848 self ._creation_locks : defaultdict = defaultdict (asyncio .Lock )
4949
5050 # 共享配置(从集中配置管理读取)
51- self .ark_api_key = config .llm .api_key
52- self .ark_base_url = config .llm .base_url
53- self .ark_model = config .llm .model
51+ self .llm_api_key = config .llm .api_key
52+ self .llm_base_url = config .llm .base_url
53+ self .llm_model = config .llm .model
54+ self .vlm_model = config .llm .vlm_model
55+ self .vlm_api_key = config .llm .vlm_api_key or config .llm .api_key
56+ self .vlm_base_url = config .llm .vlm_base_url or config .llm .base_url
5457
5558 self .sf_api_key = config .embedding .api_key
5659 self .sf_base_url = config .embedding .base_url
@@ -85,9 +88,9 @@ def _create_llm_func(self, llm_config: Dict):
8588 import asyncio
8689
8790 # 从配置中提取参数(支持租户覆盖)
88- model = llm_config .get ("model" , self .ark_model )
89- api_key = llm_config .get ("api_key" , self .ark_api_key )
90- base_url = llm_config .get ("base_url" , self .ark_base_url )
91+ model = llm_config .get ("model" , self .llm_model )
92+ api_key = llm_config .get ("api_key" , self .llm_api_key )
93+ base_url = llm_config .get ("base_url" , self .llm_base_url )
9194
9295 # 获取 RateLimiter 参数(租户可配置)
9396 # 注意:这里的 max_async 是 RateLimiter 的并发控制,不是 LightRAG 的
@@ -278,9 +281,9 @@ def _create_vision_model_func(self, llm_config: Dict):
278281 import aiohttp
279282
280283 # 从配置中提取参数(支持租户覆盖)
281- model = llm_config .get ("model " , self .ark_model )
282- api_key = llm_config .get ("api_key" , self .ark_api_key )
283- base_url = llm_config .get ("base_url" , self .ark_base_url )
284+ model = llm_config .get ("vlm_model " , self .vlm_model )
285+ api_key = llm_config .get ("vlm_api_key" ) or llm_config . get ( " api_key") or self .vlm_api_key
286+ base_url = llm_config .get ("vlm_base_url" ) or llm_config . get ( " base_url") or self .vlm_base_url
284287 vlm_timeout = llm_config .get ("vlm_timeout" , self .vlm_timeout )
285288
286289 # 获取速率限制器(VLM 使用 LLM 的限制)
@@ -552,4 +555,4 @@ async def get_tenant_lightrag(tenant_id: str) -> LightRAG:
552555 LightRAG: 该租户的实例
553556 """
554557 manager = get_multi_tenant_manager ()
555- return await manager .get_instance (tenant_id )
558+ return await manager .get_instance (tenant_id )
0 commit comments