From b5f6bffd25cc29332c828e738ddc3fa013b0ec89 Mon Sep 17 00:00:00 2001 From: hedging8563 Date: Sat, 3 Oct 2026 05:47:56 +0800 Subject: [PATCH] fix(tokenlab): add the model set without new type findings The lint job failed on the basedpyright budget: the new provider branch passed an untyped key to an untyped set, which counts as one more reportUnknownArgumentType. The set is now Set[str] and the branch narrows the key with isinstance, so the TokenLab lines add no unknown-argument, unknown-variable or missing-type-argument findings. Model cost map keys are always strings, so behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 --- litellm/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/__init__.py b/litellm/__init__.py index 69da370bc06..ab14dce3502 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -687,7 +687,7 @@ qwen_ai_platform_models: Set = set() moonshot_models: Set = set() publicai_models: Set = set() darkbloom_models: Set = set() -tokenlab_models: Set = set() +tokenlab_models: Set[str] = set() v0_models: Set = set() morph_models: Set = set() lambda_ai_models: Set = set() @@ -953,7 +953,7 @@ def _populate_provider_model_sets(model_cost_map: Dict) -> None: publicai_models.add(key) elif value.get("litellm_provider") == "darkbloom": darkbloom_models.add(key) - elif value.get("litellm_provider") == "tokenlab": + elif value.get("litellm_provider") == "tokenlab" and isinstance(key, str): tokenlab_models.add(key) elif value.get("litellm_provider") == "v0": v0_models.add(key)