From 2f6d18e6bcabe535214835c1bdd4a0bb17090b38 Mon Sep 17 00:00:00 2001 From: shin-bot-litellm Date: Sat, 31 Jan 2026 09:51:16 -0800 Subject: [PATCH] fix(proxy): use get_async_httpx_client for logo download (#20155) Replace direct AsyncHTTPHandler instantiation with get_async_httpx_client to avoid +500ms latency per request from creating new async clients. Added httpxSpecialProvider.UI for UI-related HTTP requests like logo downloads. --- litellm/proxy/proxy_server.py | 8 ++++++-- litellm/types/llms/custom_http.py | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index a00f1f605a..ffa2da4cfb 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -10164,9 +10164,13 @@ async def get_image(): if logo_path.startswith(("http://", "https://")): try: # Download the image and cache it - from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler + from litellm.llms.custom_httpx.http_handler import get_async_httpx_client + from litellm.types.llms.custom_http import httpxSpecialProvider - async_client = AsyncHTTPHandler(timeout=5.0) + async_client = get_async_httpx_client( + llm_provider=httpxSpecialProvider.UI, + params={"timeout": 5.0}, + ) response = await async_client.get(logo_path) if response.status_code == 200: # Save the image to a local file diff --git a/litellm/types/llms/custom_http.py b/litellm/types/llms/custom_http.py index ca348bad97..32f3dc2efa 100644 --- a/litellm/types/llms/custom_http.py +++ b/litellm/types/llms/custom_http.py @@ -26,6 +26,7 @@ class httpxSpecialProvider(str, Enum): RAG = "rag" A2A = "a2a" PromptManagement = "prompt_management" + UI = "ui" VerifyTypes = Union[str, bool, ssl.SSLContext]