The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Fix vLLM provider rerank endpoint from /v1/rerank to /rerank
Matéo Evan Mullerb12fa388ad3f
diff --git a/litellm/llms/hosted_vllm/rerank/transformation.py b/litellm/llms/hosted_vllm/rerank/transformation.pyindex c0a57c43534..4ed604e2c88 100644--- a/litellm/llms/hosted_vllm/rerank/transformation.py+++ b/litellm/llms/hosted_vllm/rerank/transformation.py@@ -42,8 +42,11 @@ class HostedVLLMRerankConfig(BaseRerankConfig):if api_base:# Remove trailing slashes and ensure clean base URLapi_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_baseraise ValueError("api_base must be provided for Hosted VLLM rerank")