Skip to content

Commit 84292f3

Browse files
fix: thread data_residency through realtime stream cost calculation
Co-authored-by: Yassin Kortam <yassin@berri.ai>
1 parent 34908b5 commit 84292f3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

litellm/cost_calculator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,6 +1530,7 @@ def completion_cost( # noqa: PLR0915
15301530
combined_usage_object=cost_per_token_usage_object,
15311531
custom_llm_provider=custom_llm_provider,
15321532
litellm_model_name=model,
1533+
data_residency=data_residency,
15331534
)
15341535
elif call_type == _MCP_CALL_TYPE:
15351536
from litellm.proxy._experimental.mcp_server.cost_calculator import (
@@ -2451,6 +2452,7 @@ def handle_realtime_stream_cost_calculation(
24512452
combined_usage_object: Usage,
24522453
custom_llm_provider: str,
24532454
litellm_model_name: str,
2455+
data_residency: Optional[str] = None,
24542456
) -> float:
24552457
"""
24562458
Handles the cost calculation for realtime stream responses.
@@ -2481,6 +2483,7 @@ def handle_realtime_stream_cost_calculation(
24812483
model=model_name,
24822484
usage=combined_usage_object,
24832485
custom_llm_provider=custom_llm_provider,
2486+
data_residency=data_residency,
24842487
)
24852488
except Exception:
24862489
continue

0 commit comments

Comments
 (0)