From 1aa63842495eca7fc65e146a8140e0e2c5fc60ea Mon Sep 17 00:00:00 2001 From: Chesars Date: Mon, 12 Jan 2026 09:46:06 -0300 Subject: [PATCH] fix: resolve mypy type error in _is_potential_model_name_in_model_cost Add explicit str() conversion when calling _get_model_cost_key to satisfy mypy type checking. TypedDict.values() returns object type, not str. --- litellm/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/utils.py b/litellm/utils.py index 8eb7181711..a75130a31e 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -4867,7 +4867,7 @@ def _is_potential_model_name_in_model_cost( Check if the potential model name is in the model cost (case-insensitive). """ return any( - _get_model_cost_key(potential_model_name) is not None + _get_model_cost_key(str(potential_model_name)) is not None for potential_model_name in potential_model_names.values() )