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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
chore(techdebt): clear fresh debt from the 2026-08-29 window
Devin AI693279afb443
diff --git a/basedpyright-code-budget.json b/basedpyright-code-budget.jsonindex f8ef0ce1732..529a36d2614 100644--- a/basedpyright-code-budget.json+++ b/basedpyright-code-budget.json@@ -1,6 +1,6 @@{"reportAny": {- "limit": 16389+ "limit": 16387},"reportArgumentType": {"limit": 2229@@ -24,7 +24,7 @@"limit": 19},"reportExplicitAny": {- "limit": 5242+ "limit": 5241},"reportFunctionMemberAccess": {"limit": 7diff --git a/litellm/litellm_core_utils/model_response_utils.py b/litellm/litellm_core_utils/model_response_utils.pyindex 7bf667164ae..dc4f375daa7 100644--- a/litellm/litellm_core_utils/model_response_utils.py+++ b/litellm/litellm_core_utils/model_response_utils.py@@ -144,7 +144,6 @@ def _is_choice_non_empty(choice: StreamingChoices) -> bool:# Check model_extra for dynamically added fields on the choicechoice_extra_fields: Final[Mapping[str, object]] = choice.model_extra or {}for extra_field_name, extra_field_value in choice_extra_fields.items():- # Skip certain structural fields that are just default/None placeholdersif extra_field_name == "index" and extra_field_value == 0:continueif extra_field_name in {"finish_reason", "logprobs"} and extra_field_value is None:@@ -192,7 +191,6 @@ def _is_delta_non_empty(delta: Delta) -> bool:# Check model_extra for dynamically added fields (this is where Pydantic stores them)delta_extra_fields: Final[Mapping[str, object]] = delta.model_extra or {}for extra_field_value in delta_extra_fields.values():- # Even structural fields are meaningful if they have actual contentif _has_meaningful_content(extra_field_value):return Truediff --git a/litellm/llms/oci/chat/cohere.py b/litellm/llms/oci/chat/cohere.pyindex 384e7ec4cf8..6e9bb83b0a0 100644--- a/litellm/llms/oci/chat/cohere.py+++ b/litellm/llms/oci/chat/cohere.py@@ -9,7 +9,7 @@ response parsing, and streaming chunk parsing for models served withimport datetimeimport jsonfrom collections.abc import Iterable, Mapping, Sequence-from typing import Any, Final+from typing import Finalimport httpxfrom pydantic import JsonValue, TypeAdapter, ValidationError@@ -76,7 +76,7 @@ def _content_text(content: str | Iterable[Mapping[str, object]] | None) -> str:return str(content)-def _extract_text_content(content: Any) -> str:+def _extract_text_content(content: str | Iterable[Mapping[str, object]] | None) -> str:"""Return the plain-text representation of a message content value."""return _content_text(content)diff --git a/litellm/llms/vertex_ai/image_edit/vertex_gemini_transformation.py b/litellm/llms/vertex_ai/image_edit/vertex_gemini_transformation.pyindex 5889a8eba06..725a7f39917 100644--- a/litellm/llms/vertex_ai/image_edit/vertex_gemini_transformation.py+++ b/litellm/llms/vertex_ai/image_edit/vertex_gemini_transformation.py@@ -182,7 +182,6 @@ class VertexAIGeminiImageEditConfig(BaseImageEditConfig, VertexLLM):else None)- # Generation config with proper structure for image editinggeneration_config: Final[dict[str, object]] = {key: value for key, value in (("response_modalities", ["IMAGE"]), ("image_config", image_config)) if value}diff --git a/litellm/llms/vertex_ai/vector_stores/rag_api/transformation.py b/litellm/llms/vertex_ai/vector_stores/rag_api/transformation.pyindex eedd488ecdb..5c250fc1a7e 100644--- a/litellm/llms/vertex_ai/vector_stores/rag_api/transformation.py+++ b/litellm/llms/vertex_ai/vector_stores/rag_api/transformation.py@@ -203,7 +203,6 @@ class VertexVectorStoreConfig(BaseVectorStoreConfig, VertexBase):if value is not None}- # Build the request body for Vertex AI RAG APIquery_body: Final[Mapping[str, object]] = {key: valuefor key, value in (("text", query), ("rag_retrieval_config", rag_retrieval_config or None))@@ -294,7 +293,6 @@ class VertexVectorStoreConfig(BaseVectorStoreConfig, VertexBase):# Add metadata if providedmetadata: Final = vector_store_create_optional_params.get("metadata")- # Build the request body for Vertex AI RAG Corpus creationrequest_body: Final[dict[str, object]] = {key: valuefor key, value in (diff --git a/litellm/proxy/guardrails/guardrail_hooks/headroom/headroom.py b/litellm/proxy/guardrails/guardrail_hooks/headroom/headroom.pyindex daa15fb5e5f..d8c8c2f4974 100644--- a/litellm/proxy/guardrails/guardrail_hooks/headroom/headroom.py+++ b/litellm/proxy/guardrails/guardrail_hooks/headroom/headroom.py@@ -433,7 +433,7 @@ class HeadroomGuardrail(CustomGuardrail):payload["model"] = modeltry:- raw_response: HttpxResponse = await self.async_handler.post( # pyright: ignore[reportUnknownMemberType]+ raw_response: HttpxResponse = await self.async_handler.post( # pyright: ignore[reportUnknownMemberType] # AsyncHTTPHandler.post is untypedurl=f"{self.headroom_api_base}/v1/compress",json=payload,headers=self._request_headers(),@@ -570,7 +570,7 @@ class HeadroomGuardrail(CustomGuardrail):params["query"] = querytry:- raw_response: HttpxResponse = await self.async_handler.get( # pyright: ignore[reportUnknownMemberType]+ raw_response: HttpxResponse = await self.async_handler.get( # pyright: ignore[reportUnknownMemberType] # AsyncHTTPHandler.get is untypedurl=f"{self.headroom_api_base}/v1/retrieve/{hash_value}",params=params,headers=self._request_headers(),diff --git a/litellm/proxy/guardrails/guardrail_hooks/repelloai/repelloai.py b/litellm/proxy/guardrails/guardrail_hooks/repelloai/repelloai.pyindex d842a9b9b6a..8925cc5b3a6 100644--- a/litellm/proxy/guardrails/guardrail_hooks/repelloai/repelloai.py+++ b/litellm/proxy/guardrails/guardrail_hooks/repelloai/repelloai.py@@ -197,7 +197,7 @@ class RepelloAIGuardrail(CustomGuardrail):repelloai_response: RepelloAIAnalyzeResponse | None = Nonetry:verbose_proxy_logger.debug("RepelloAI Argus request: %s", request)- response: Final[HttpxResponse] = await self.async_handler.post( # pyright: ignore[reportUnknownMemberType]+ response: Final[HttpxResponse] = await self.async_handler.post( # pyright: ignore[reportUnknownMemberType] # AsyncHTTPHandler.post is untypedurl=endpoint,headers={"X-API-Key": self.repelloai_api_key},json=request,diff --git a/litellm/rag/ingestion/vertex_ai_ingestion.py b/litellm/rag/ingestion/vertex_ai_ingestion.pyindex 07f9f346d08..eff8ad1b8cb 100644--- a/litellm/rag/ingestion/vertex_ai_ingestion.py+++ b/litellm/rag/ingestion/vertex_ai_ingestion.py@@ -186,7 +186,6 @@ class VertexAIRAGIngestion(BaseRAGIngestion, VertexBase):base_url: Final = get_vertex_base_url(self.location)url: Final = f"{base_url}/v1beta1/projects/{self.project_id}/locations/{self.location}/ragCorpora"- # Build request body with camelCase keys (Vertex AI API format)vector_db_config: Final = self.vector_store_config.get("vector_db_config")embedding_model: Final = self.vector_store_config.get("embedding_model")embedding_model_config: Final = (@@ -447,7 +446,6 @@ class VertexAIRAGIngestion(BaseRAGIngestion, VertexBase):# Add max embedding requests per minute if specifiedmax_embedding_qpm: Final = self.vector_store_config.get("max_embedding_requests_per_min")- # Build request body with camelCase keys (Vertex AI API format)chunking_config: Final = ({"chunkSize": chunk_size or 1024, "chunkOverlap": chunk_overlap or 200}if chunk_size or chunk_overlapdiff --git a/ruff-strict-budget.json b/ruff-strict-budget.jsonindex fce91d57d88..5d0e7b617cb 100644--- a/ruff-strict-budget.json+++ b/ruff-strict-budget.json@@ -24,7 +24,7 @@"limit": 133},"ANN401": {- "limit": 597+ "limit": 596},"ASYNC230": {"limit": 11@@ -231,7 +231,7 @@"limit": 5},"TID251": {- "limit": 1111+ "limit": 1110},"TRY002": {"limit": 524diff --git a/type-discipline-budget.json b/type-discipline-budget.jsonindex bb02618b11e..9c805bd7b61 100644--- a/type-discipline-budget.json+++ b/type-discipline-budget.json@@ -9,7 +9,7 @@"limit": 269},"LIT004": {- "limit": 43+ "limit": 40},"LIT005": {"limit": 0