mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
fix(clinepass): register the provider with litellm's own guards
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 `<provider>_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 <noreply@anthropic.com>
This commit is contained in:
parent
cb9aeab01d
commit
6d3a53f773
2 changed files with 6 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -812,6 +812,7 @@ PROVIDERS_WITH_A_HANDLER = (
|
|||
"azure",
|
||||
"azure_ai",
|
||||
"bedrock",
|
||||
"clinepass",
|
||||
"cloudflare",
|
||||
"cohere",
|
||||
"databricks",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue