mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
fix(register_model): align membership check with stored value for openrouter models
The guard checked `key` (full key like "openrouter/gpt-4") but the set
stores `split_string[-1]` ("gpt-4"), so the duplicate check never matched.
This commit is contained in:
parent
bf3e6bb9f4
commit
77496776c1
1 changed files with 1 additions and 1 deletions
|
|
@ -2779,7 +2779,7 @@ def register_model(model_cost: Union[str, dict]): # noqa: PLR0915
|
|||
litellm.anthropic_models.add(key)
|
||||
elif value.get("litellm_provider") == "openrouter":
|
||||
split_string = key.split("/", 1)
|
||||
if key not in litellm.openrouter_models:
|
||||
if split_string[-1] not in litellm.openrouter_models:
|
||||
litellm.openrouter_models.add(split_string[-1])
|
||||
elif value.get("litellm_provider") == "vercel_ai_gateway":
|
||||
if key not in litellm.vercel_ai_gateway_models:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue