LookupError: Model(bge-reranker-v2-m3) not authorized
问题: 如何获取rerank_id?
所做工作:
- 浏览器访问v1/models输出: {"object":"list","data":[{"id":"bge-reranker-v2-m3","object":"model","created":1765166385,"owned_by":"vllm","root":"/model","parent":null,"max_model_len":8192,"permission":[{"id":"modelperm-45224c9ca3bd41e8bff883d8bdefdf47","object":"model_permission","created":1765166385,"allow_create_engine":false,"allow_sampling":true,"allow_logprobs":true,"allow_search_indices":false,"allow_view":true,"allow_fine_tuning":false,"organization":"*","group":null,"is_blocking":false}]}]}
调用的python api: rag_object.retrieve(question=item["search_query"],dataset_ids=dataset_ids,similarity_threshold=0.4,top_k=30,rerank_id="bge-reranker-v2-m3")
报错:
File "/ragflow/api/apps/sdk/doc.py", line 1453, in retrieval_test
rerank_mdl = LLMBundle(kb.tenant_id, LLMType.RERANK, llm_name=req["rerank_id"])
File "/ragflow/api/db/services/llm_service.py", line 87, in __init__
super().__init__(tenant_id, llm_type, llm_name, lang, **kwargs)
File "/ragflow/api/db/services/tenant_llm_service.py", line 256, in __init__
self.mdl = TenantLLMService.model_instance(tenant_id, llm_type, llm_name, lang=lang, **kwargs)
File "/ragflow/.venv/lib/python3.10/site-packages/peewee.py", line 3128, in inner
return fn(*args, **kwargs)
File "/ragflow/api/db/services/tenant_llm_service.py", line 138, in model_instance
model_config = TenantLLMService.get_model_config(tenant_id, llm_type, llm_name)
File "/ragflow/.venv/lib/python3.10/site-packages/peewee.py", line 3128, in inner
return fn(*args, **kwargs)
File "/ragflow/api/db/services/tenant_llm_service.py", line 132, in get_model_config
raise LookupError("Model({}) not authorized".format(mdlnm))
LookupError: Model(bge-reranker-v2-m3) not authorized
Hi @github-eliviate! I'm Dosu and I’m helping the ragflow team.
你的报错是因为 rerank_id 没有被正确注册或授权给当前 tenant。rerank_id 必须和后台注册的模型名称完全一致,通常需要带上厂商后缀,比如 bge-reranker-v2-m3@VLLM 或 bge-reranker-v2-m3___VLLM,而不是直接用 bge-reranker-v2-m3。你可以在 UI 的“Retrieval Testing”页面的“Rerank model”下拉菜单里看到所有有效的 rerank_id,只有这些才是被授权的模型 ID【参考1】。
如果你用的是自定义或本地部署的模型,需要管理员在后台(比如通过 /add_llm 接口或管理界面)为当前 tenant 注册并启用 rerank 模型,指定正确的 llm_factory(如 VLLM)和 llm_name(如 bge-reranker-v2-m3___VLLM),并确保 status=1 才能被授权【参考2】。
常见问题包括:rerank_id 拼写不一致、缺少厂商后缀、tenant_llm 表里有冲突或失效的记录等。可以尝试用带后缀的 rerank_id,如果还是不行,建议让管理员检查 tenant_llm 表或重新注册模型。
参考:
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
I think dosu is correct
I think dosu is correct
![]()
你这个正确,昨天同事也是从这里帮我找到的,但是我不懂前端,目前还不知道是否能通过其它渠道得到这个rerank_id
Retrieval Testing”页面的“Rerank model”下拉菜单里看到所有有效的 rerank_id
传菜单的不对,缺少后缀
厂商后缀 厂商也不对,我用vllm部署的,实际上rerank_id是 bge-reranker-v2-m3___OpenAI-API@OpenAI-API-Compatible
建议应该有一个类似界面的东西,可以查询rerank_id,复制过来可以直接用的那种
Yeah, I strongly suggest you to raise a feature request to show dataset_id, document_id, chat_id, session_id, agent_id ... all these ids that we need in Http api and python sdk.