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:
Krish Dholakia 2025-09-27 07:50:30 -07:00 committed by GitHub
commit d29b8be921
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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")