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(proxy): expose url join helper at module level for websocket route
mateo-berri4ba9d6b136fc
diff --git a/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py b/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.pyindex d9c76aaeae3..96e32ccf827 100644--- a/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py+++ b/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py@@ -2086,7 +2086,7 @@ class BaseOpenAIPassThroughHandler:# Construct the full target URL by properly joining the base URL and endpoint pathbase_url: Final = httpx.URL(base_target_url)- updated_url: Final = BaseOpenAIPassThroughHandler._join_url_paths(+ updated_url: Final = _join_url_paths(base_url=base_url,path=encoded_endpoint,custom_llm_provider=custom_llm_provider,@@ -2145,10 +2145,6 @@ class BaseOpenAIPassThroughHandler:request=request,)- @staticmethod- def _join_url_paths(base_url: httpx.URL, path: str, custom_llm_provider: litellm.LlmProviders) -> str:- return _join_url_paths(base_url=base_url, path=path, custom_llm_provider=custom_llm_provider)-@router.api_route("/cursor/{endpoint:path}",diff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py b/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.pyindex 8080ca71773..9e6a2d42757 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py@@ -19,6 +19,7 @@ import litellmfrom litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (BaseOpenAIPassThroughHandler,RouteChecks,+ _join_url_paths,azure_proxy_route,bedrock_llm_proxy_route,create_pass_through_route,@@ -74,7 +75,7 @@ class TestBaseOpenAIPassThroughHandler:# Test joining base URL with no path and a pathbase_url = httpx.URL("https://api.example.com")path = "/v1/chat/completions"- result = BaseOpenAIPassThroughHandler._join_url_paths(+ result = _join_url_paths(base_url, path, litellm.LlmProviders.OPENAI.value)print(f"Base URL with no path: '{base_url}' + '{path}' → '{result}'")@@ -83,7 +84,7 @@ class TestBaseOpenAIPassThroughHandler:# Test joining base URL with path and another pathbase_url = httpx.URL("https://api.example.com/v1")path = "/chat/completions"- result = BaseOpenAIPassThroughHandler._join_url_paths(+ result = _join_url_paths(base_url, path, litellm.LlmProviders.OPENAI.value)print(f"Base URL with path: '{base_url}' + '{path}' → '{result}'")@@ -92,7 +93,7 @@ class TestBaseOpenAIPassThroughHandler:# Test with path not starting with slashbase_url = httpx.URL("https://api.example.com/v1")path = "chat/completions"- result = BaseOpenAIPassThroughHandler._join_url_paths(+ result = _join_url_paths(base_url, path, litellm.LlmProviders.OPENAI.value)print(f"Path without leading slash: '{base_url}' + '{path}' → '{result}'")@@ -101,7 +102,7 @@ class TestBaseOpenAIPassThroughHandler:# Test with base URL having trailing slashbase_url = httpx.URL("https://api.example.com/v1/")path = "/chat/completions"- result = BaseOpenAIPassThroughHandler._join_url_paths(+ result = _join_url_paths(base_url, path, litellm.LlmProviders.OPENAI.value)print(f"Base URL with trailing slash: '{base_url}' + '{path}' → '{result}'")