From 6d3a53f7737519ceac6157f01803fe6c37dcf187 Mon Sep 17 00:00:00 2001 From: Daniel JB Clark Date: Sat, 3 Oct 2026 13:12:40 -0400 Subject: [PATCH] fix(clinepass): register the provider with litellm's own guards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two upstream guards did not know about ClinePass, and both caught something real. `test_every_cost_map_provider_is_registered[main|backup]`: its failure message says exactly what a new provider owes — "a `_models` set in litellm/__init__.py, filled in _populate_provider_model_sets and listed in _build_models_by_provider". Adding the cost-map entry without that leaves the provider's models unreachable through `models_by_provider`. Wired at all four sites, mirroring `deepseek`. Verified with LITELLM_LOCAL_MODEL_COST_MAP=True, since `model_cost` is fetched remotely by default and the remote map naturally has no clinepass yet: `clinepass_models` and `models_by_provider["clinepass"]` both resolve to `clinepass/deepseek-v4-flash`. `test_a_provider_without_a_handler_maps_by_the_upstream_status[clinepass-403]`: expected PermissionDeniedError, got APIError. The test derives its no-handler list as `LlmProviders - PROVIDERS_WITH_A_HANDLER - aliases - openai_compatible_providers`. Removing clinepass from `openai_compatible_providers` (the P1 fix) dropped it into the no-handler bucket while the explicit `_map_openai_exception` registration gave it a handler, so the test's model of reality went stale rather than the code being wrong. `clinepass` now sits in `PROVIDERS_WITH_A_HANDLER` beside `mistral` and `runwayml` — the two providers whose registration shape this change copied. Not addressed, and not mine: `proxy-infra`'s test_every_model_in_the_prisma_schema_is_a_renderable_span_table. This branch touches no prisma schema, span, or proxy-db file — the full changed-file list is the clinepass provider, its tests, the two cost maps, the provider-support JSONs, the UI helpers and README. Co-Authored-By: Claude Opus 5 --- litellm/__init__.py | 5 +++++ .../unit/litellm_core_utils/test_exception_mapping_utils.py | 1 + 2 files changed, 6 insertions(+) diff --git a/litellm/__init__.py b/litellm/__init__.py index 40f90c4743a..83a97c6fd0e 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -644,6 +644,7 @@ gemini_models: Set = set() xai_models: Set = set() zai_models: Set = set() deepseek_models: Set = set() +clinepass_models: Set = set() tencent_models: Set = set() runwayml_models: Set = set() azure_ai_models: Set = set() @@ -866,6 +867,8 @@ def _populate_provider_model_sets(model_cost_map: Dict) -> None: fal_ai_models.add(key) elif value.get("litellm_provider") == "deepseek": deepseek_models.add(key) + elif value.get("litellm_provider") == "clinepass": + clinepass_models.add(key) elif value.get("litellm_provider") == "tencent": tencent_models.add(key) elif value.get("litellm_provider") == "runwayml": @@ -1078,6 +1081,7 @@ model_list = list( | zai_models | fal_ai_models | deepseek_models + | clinepass_models | modelscope_models | azure_ai_models | voyage_models @@ -1183,6 +1187,7 @@ def _build_models_by_provider() -> dict: "zai": zai_models, "fal_ai": fal_ai_models, "deepseek": deepseek_models, + "clinepass": clinepass_models, "tencent": tencent_models, "runwayml": runwayml_models, "mistral": mistral_chat_models, diff --git a/tests/unit/litellm_core_utils/test_exception_mapping_utils.py b/tests/unit/litellm_core_utils/test_exception_mapping_utils.py index 9de768ea47b..8a68ffd7d9b 100644 --- a/tests/unit/litellm_core_utils/test_exception_mapping_utils.py +++ b/tests/unit/litellm_core_utils/test_exception_mapping_utils.py @@ -812,6 +812,7 @@ PROVIDERS_WITH_A_HANDLER = ( "azure", "azure_ai", "bedrock", + "clinepass", "cloudflare", "cohere", "databricks",