mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
Fix vLLM provider rerank endpoint from /v1/rerank to /rerank
This commit is contained in:
parent
2f3155c2ee
commit
b12fa388ad
1 changed files with 5 additions and 2 deletions
|
|
@ -42,8 +42,11 @@ class HostedVLLMRerankConfig(BaseRerankConfig):
|
|||
if api_base:
|
||||
# Remove trailing slashes and ensure clean base URL
|
||||
api_base = api_base.rstrip("/")
|
||||
if not api_base.endswith("/v1/rerank"):
|
||||
api_base = f"{api_base}/v1/rerank"
|
||||
# Preserve backward compatibility
|
||||
if api_base.endswith("/v1/rerank"):
|
||||
api_base = api_base.replace("/v1/rerank", "/rerank")
|
||||
elif not api_base.endswith("/rerank"):
|
||||
api_base = f"{api_base}/rerank"
|
||||
return api_base
|
||||
raise ValueError("api_base must be provided for Hosted VLLM rerank")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue