Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix test

Ishaan Jaff68ae8887303a
diff --git a/litellm/types/router.py b/litellm/types/router.py
index 0423011cd58..b6049657bfc 100644
--- a/litellm/types/router.py
+++ b/litellm/types/router.py
@@ -8,10 +8,13 @@ import uuid
from typing import Any, Dict, List, Literal, Optional, Tuple, Union, get_type_hints
import httpx
+from httpx import AsyncClient, Client
from openai import AsyncAzureOpenAI, AsyncOpenAI, AzureOpenAI, OpenAI
from pydantic import BaseModel, ConfigDict, Field
from typing_extensions import Required, TypedDict
+from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler
+
from ..exceptions import RateLimitError
from .completion import CompletionRequest
from .embedding import EmbeddingRequest
@@ -154,7 +157,18 @@ class GenericLiteLLMParams(BaseModel):
configurable_clientside_auth_params: CONFIGURABLE_CLIENTSIDE_AUTH_PARAMS = None
# for passing in custom OpenAI / Azure OpenAI clients
- client: Optional[Union[OpenAI, AsyncOpenAI, AzureOpenAI, AsyncAzureOpenAI]] = None
+ client: Optional[
+ Union[
+ OpenAI,
+ AsyncOpenAI,
+ AzureOpenAI,
+ AsyncAzureOpenAI,
+ AsyncClient,
+ Client,
+ AsyncHTTPHandler,
+ HTTPHandler,
+ ]
+ ] = None
## LOGGING PARAMS ##
litellm_trace_id: Optional[str] = None
## UNIFIED PROJECT/REGION ##