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
feat(pass_through_endpoints.py): raise 404 if passthrough endpoint has been deleted by the user
Krrish Dholakiab4fc7d3cfad0
diff --git a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.pyindex 5f3a49f307a..8542f87327f 100644--- a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py+++ b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py@@ -974,6 +974,11 @@ def create_pass_through_route(] = None, # if pass-through endpoint is a streaming requestsubpath: str = "", # captures sub-paths when include_subpath=True):++ from litellm.proxy.pass_through_endpoints.pass_through_endpoints import (+ InitPassThroughEndpointHelpers,+ )+# Construct the full target URL with subpath if neededfull_target = (HttpPassThroughEndpointHelpers.construct_target_url_with_subpath(@@ -981,6 +986,14 @@ def create_pass_through_route())+ if not InitPassThroughEndpointHelpers.is_registered_pass_through_route(+ route=endpoint+ ):+ raise HTTPException(+ status_code=404,+ detail=f"Pass-through endpoint {target} not found. This could have been deleted or not yet added to the proxy.",+ )+return await pass_through_request( # type: ignorerequest=request,target=full_target,