diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py index 6ec8d00e37f..cacf130aeab 100644 --- a/litellm/cost_calculator.py +++ b/litellm/cost_calculator.py @@ -427,7 +427,7 @@ def cost_per_token( completion_tokens: int = 0, response_time_ms: float | None = 0.0, custom_llm_provider: str | None = None, - region_name=None, + region_name: str | None = None, ### CHARACTER PRICING ### prompt_characters: int | None = None, completion_characters: int | None = None, @@ -508,7 +508,7 @@ def _cost_per_token_from_rates( completion_tokens: int = 0, response_time_ms: float | None = 0.0, custom_llm_provider: str | None = None, - region_name=None, + region_name: str | None = None, ### CHARACTER PRICING ### prompt_characters: int | None = None, completion_characters: int | None = None, diff --git a/litellm/litellm_core_utils/streaming_chunk_builder_utils.py b/litellm/litellm_core_utils/streaming_chunk_builder_utils.py index 4cdb9004619..3a5a2cbe914 100644 --- a/litellm/litellm_core_utils/streaming_chunk_builder_utils.py +++ b/litellm/litellm_core_utils/streaming_chunk_builder_utils.py @@ -1413,8 +1413,6 @@ def _set_stream_builder_response_cost( def _stamp_streaming_usage_cost(usage: Usage, response: ModelResponse, logging_obj: Optional["Logging"]) -> None: if logging_obj is None: return - if isinstance(getattr(usage, "cost", None), (int, float)): - return computed_cost: Final = logging_obj.response_cost_calculator(result=response) if not isinstance(computed_cost, (int, float)) or computed_cost <= 0: return