From 5a2031ec5edac2f340f0204a9afa8fec36a7de7d Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 17 Sep 2026 18:45:33 +0000 Subject: [PATCH] fix(proxy): skip routability gate for endpoints that resolve their own target Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/proxy/route_llm_request.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/route_llm_request.py b/litellm/proxy/route_llm_request.py index 3605aa9c1c7..5a1bd4874ff 100644 --- a/litellm/proxy/route_llm_request.py +++ b/litellm/proxy/route_llm_request.py @@ -262,7 +262,27 @@ _VIDEO_FALLBACK_ROUTE_TYPES: Final = frozenset( } ) -_NO_MODEL_ROUTING_ROUTE_TYPES: Final = frozenset({"apply_guardrail", "call_mcp_tool"}) +_NO_MODEL_ROUTING_ROUTE_TYPES: Final = frozenset( + { + "apply_guardrail", + "call_mcp_tool", + # Files, fine-tuning, batch, and A2A endpoints resolve their own target + # (file id, job id, or agent) after pre-call processing and never reach + # _route_request_single_attempt. + "afile_content", + "afile_retrieve", + "afile_delete", + "acreate_fine_tuning_job", + "aretrieve_fine_tuning_job", + "alist_fine_tuning_jobs", + "acancel_fine_tuning_job", + "acreate_batch", + "aretrieve_batch", + "alist_batches", + "acancel_batch", + "asend_message", + } +) class ProxyModelNotFoundError(HTTPException):