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
refactor(proxy): type the post_call deferral helpers' request-state parameters
mateo-berri071f83980c31
diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.pyindex e48bd3851fb..e653ca6b62c 100644--- a/litellm/proxy/utils.py+++ b/litellm/proxy/utils.py@@ -544,7 +544,7 @@ def _guardrails_outside_pipeline(policy_name: str, pipeline: "GuardrailPipeline"def _without_names(- bucket: dict, # mutable-ok: the applied_* header slots live in the request-state dict every hook writes in place+ bucket: dict[str, object], # mutable-ok: the applied_* header slots live in the request-state dict hooks writeslot: str,names: frozenset[str],) -> None:@@ -561,7 +561,7 @@ def _without_names(def _withdraw_deferred_claims(- data: dict, # mutable-ok: same request-payload shape as post_call_success_hook's data+ data: dict[str, object], # mutable-ok: same request-payload shape as post_call_success_hook's datadeferred: Sequence[tuple[str, "GuardrailPipeline"]],) -> None:outside_by_policy: Final = MappingProxyType(@@ -586,7 +586,7 @@ def _withdraw_deferred_claims(def _defer_post_call_pipelines(- data: dict, # mutable-ok: same request-payload shape as post_call_success_hook's data+ data: dict[str, object], # mutable-ok: same request-payload shape as post_call_success_hook's dataresponse: ResponsesAPIResponse,) -> None:deferred: Final = _post_call_pipelines(data)@@ -2990,7 +2990,7 @@ class ProxyLogging:async def _run_post_call_pipelines(self,- data: dict, # mutable-ok: same request-payload shape as post_call_success_hook's data+ data: dict[str, object], # mutable-ok: same request-payload shape as post_call_success_hook's datauser_api_key_dict: UserAPIKeyAuth,response: LLMResponseTypes,) -> LLMResponseTypes | None: