mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-15 23:31:29 +00:00
Merge pull request #14938 from subnet-dev/bug-14937/vLLM-provider-rerank-endpoint-from-v1-rerank-to-rerank
[Bug]: vLLM provider's rerank endpoint from /v1/rerank to /rerank
This commit is contained in:
commit
d29b8be921
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