From c8c258e343e2bf88f4dcf7d52c5a77343cde49aa Mon Sep 17 00:00:00 2001 From: Harshit28j Date: Sat, 7 Mar 2026 04:42:41 +0530 Subject: [PATCH] fix(ci): filter extra_headers from AsyncHTTPHandler params extra_headers is only used for cache key generation, not as a constructor param for AsyncHTTPHandler. Filter it out like disable_aiohttp_transport to prevent TypeError. Co-Authored-By: Claude Opus 4.6 --- litellm/llms/custom_httpx/http_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/custom_httpx/http_handler.py b/litellm/llms/custom_httpx/http_handler.py index 3dfef07d426..d8d13e36fb4 100644 --- a/litellm/llms/custom_httpx/http_handler.py +++ b/litellm/llms/custom_httpx/http_handler.py @@ -1235,7 +1235,7 @@ def get_async_httpx_client( if params is not None: # Filter out params that are only used for cache key, not for AsyncHTTPHandler.__init__ - handler_params = {k: v for k, v in params.items() if k != "disable_aiohttp_transport"} + handler_params = {k: v for k, v in params.items() if k not in ("disable_aiohttp_transport", "extra_headers")} handler_params["shared_session"] = shared_session _new_client = AsyncHTTPHandler(**handler_params) else: @@ -1284,7 +1284,7 @@ def _get_httpx_client(params: Optional[dict] = None) -> HTTPHandler: if params is not None: # Filter out params that are only used for cache key, not for HTTPHandler.__init__ - handler_params = {k: v for k, v in params.items() if k != "disable_aiohttp_transport"} + handler_params = {k: v for k, v in params.items() if k not in ("disable_aiohttp_transport", "extra_headers")} _new_client = HTTPHandler(**handler_params) else: _new_client = HTTPHandler(timeout=httpx.Timeout(timeout=600.0, connect=5.0))