fix: Handle missing litellm_provider in fuzzy model matching

This commit is contained in:
Paul Gauthier 2024-11-15 06:14:15 -08:00 committed by Paul Gauthier (aider)
parent b254afa498
commit d4d5d15e18

View file

@ -1167,7 +1167,10 @@ def fuzzy_match_models(name):
model = model.lower()
if attrs.get("mode") != "chat":
continue
provider = (attrs["litellm_provider"] + "/").lower()
provider = attrs.get("litellm_provider", "").lower()
if not provider:
continue
provider += "/"
if model.startswith(provider):
fq_model = model