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
merge: litellm_internal_staging into litellm_fix_nova_sonic_realtime_user_asr_usage
mateo-berri8a6f47a6d4be
diff --cc litellm/llms/bedrock/realtime/handler.pyindex 0891379ef8c,3bda8dd8359..ecd143dd087--- a/litellm/llms/bedrock/realtime/handler.py+++ b/litellm/llms/bedrock/realtime/handler.py@@@ -7,14 -7,14 +7,16 @@@ This uses aws_sdk_bedrock_runtime for bimport asyncioimport contextlibimport json- from typing import Any, Final+ from typing import Final, Protocol- from pydantic import TypeAdapter+ from pydantic import JsonValue, TypeAdapterfrom litellm._logging import _redact_string, verbose_proxy_logger+ from litellm.litellm_core_utils.aws_partition import get_aws_dns_suffixfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLogging+from litellm.litellm_core_utils.logging_worker import GLOBAL_LOGGING_WORKER+from litellm.types.llms.openai import OpenAIRealtimeEvents+ from litellm.types.realtime import RealtimeResponseTransformInputfrom ..base_aws_llm import BaseAWSLLMfrom ..common_utils import BedrockError@@@ -156,9 -205,6 +207,7 @@@ class BedrockRealtime(BaseAWSLLM)))- logged_events: Final[- list[OpenAIRealtimeEvents]- ] = [] # mutable-ok: events accumulate across stream loop iterations for spend logging++ logged_events: Final[list[OpenAIRealtimeEvents]] = [] # mutable-ok: filled across the stream loopbedrock_to_client_task: Final = asyncio.create_task(self._forward_bedrock_to_client(bedrock_stream,@@@ -262,8 -303,7 +312,8 @@@transformation_config: BedrockRealtimeConfig,model: str,logging_obj: LiteLLMLogging,- session_state: dict,- logged_events: "list[OpenAIRealtimeEvents] | None" = None,+ session_state: RealtimeResponseTransformInput,++ logged_events: "list[OpenAIRealtimeEvents] | None" = None, # mutable-ok: caller-owned spend log accumulator):"""Forward messages from Bedrock stream to client WebSocket."""try: