Fix vLLM provider rerank endpoint from /v1/rerank to /rerank

This commit is contained in:
Matéo Evan Muller 2025-09-26 13:13:17 +02:00
parent 2f3155c2ee
commit b12fa388ad
No known key found for this signature in database
GPG key ID: 62D9C5AE20E5EF40

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