From 627d70affd18b735f309df40487cb93511c9a63f Mon Sep 17 00:00:00 2001 From: Shivam Rawat Date: Sat, 11 Apr 2026 14:46:02 -0700 Subject: [PATCH] Potential fix for pull request finding 'CodeQL / Module-level cyclic import' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .../pass_through_endpoints/llm_passthrough_endpoints.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py b/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py index 6e354290fe4..165c7b24cba 100644 --- a/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py +++ b/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py @@ -37,7 +37,6 @@ from litellm.proxy.common_utils.http_parsing_utils import ( from litellm.proxy.pass_through_endpoints.common_utils import get_litellm_virtual_key from litellm.proxy.pass_through_endpoints.pass_through_endpoints import ( HttpPassThroughEndpointHelpers, - LITELLM_PASS_THROUGH_CUSTOM_BODY_STATE_KEY, create_pass_through_route, create_websocket_passthrough_route, websocket_passthrough_request, @@ -89,6 +88,14 @@ def is_passthrough_request_streaming(request_body: dict) -> bool: return request_body.get("stream", False) +def _get_litellm_pass_through_custom_body_state_key() -> str: + from litellm.proxy.pass_through_endpoints.pass_through_endpoints import ( + LITELLM_PASS_THROUGH_CUSTOM_BODY_STATE_KEY, + ) + + return LITELLM_PASS_THROUGH_CUSTOM_BODY_STATE_KEY + + async def llm_passthrough_factory_proxy_route( custom_llm_provider: str, endpoint: str,