diff --git a/litellm/llms/custom_httpx/http_handler.py b/litellm/llms/custom_httpx/http_handler.py index 3a67d5127b78..fef29a1b4263 100644 --- a/litellm/llms/custom_httpx/http_handler.py +++ b/litellm/llms/custom_httpx/http_handler.py @@ -657,7 +657,7 @@ def _create_aiohttp_transport( ) return LiteLLMAiohttpTransport( client=lambda: ClientSession( - connector=TCPConnector(**connector_kwargs), + connector=TCPConnector(limit=0, **connector_kwargs), trust_env=trust_env, ), ) diff --git a/tests/test_litellm/llms/custom_httpx/test_http_handler.py b/tests/test_litellm/llms/custom_httpx/test_http_handler.py index 0e31699fd831..3c7d3b09fa57 100644 --- a/tests/test_litellm/llms/custom_httpx/test_http_handler.py +++ b/tests/test_litellm/llms/custom_httpx/test_http_handler.py @@ -79,9 +79,12 @@ async def test_ssl_context_transport(): # Get the client session and verify SSL context is passed through client_session = transport._get_valid_client_session() assert isinstance(client_session, ClientSession) - assert isinstance(client_session.connector, TCPConnector) + connector = client_session.connector + assert isinstance(connector, TCPConnector) # Verify the connector has SSL context set by checking if it's using SSL - assert client_session.connector._ssl is not None + assert connector._ssl is not None + # Verify connector limit is 0 (no limit) + assert connector.limit == 0 @pytest.mark.asyncio