File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -55,14 +55,14 @@ def match_model_provider_string(model: str) -> str:
55
55
lowercase_to_canonical_case = {
56
56
k .lower (): k for k in litellm .models_by_provider [provider ]
57
57
}
58
- candidate_model_names = []
58
+ candidate_model_names = set ()
59
59
for name in [model_name , normalize_canonical_model_name (model_name )]:
60
- candidate_model_names .append ("/" .join ([provider , name .lower ()]))
60
+ candidate_model_names .add ("/" .join ([provider , name .lower ()]))
61
61
# ...and Azure AI Foundry openai models are not listed there, but under Azure OpenAI
62
62
if provider == "azure_ai" :
63
- for model in candidate_model_names :
64
- candidate_model_names .append (model .replace ("azure_ai/" , "azure/" ))
65
- matched_models = set ( candidate_model_names ) & set (lowercase_to_canonical_case )
63
+ for model in candidate_model_names . copy () :
64
+ candidate_model_names .add (model .replace ("azure_ai/" , "azure/" ))
65
+ matched_models = candidate_model_names & set (lowercase_to_canonical_case )
66
66
if len (matched_models ) == 0 :
67
67
raise NoModelsFoundError (model )
68
68
if len (matched_models ) > 1 :
You can’t perform that action at this time.
0 commit comments