diff --git a/aider/models.py b/aider/models.py index a596c604dde..d6365d63fc0 100644 --- a/aider/models.py +++ b/aider/models.py @@ -19,47 +19,6 @@ DEFAULT_MODEL_NAME = "gpt-4o" ANTHROPIC_BETA_HEADER = "prompt-caching-2024-07-31,pdfs-2024-09-25" -OPENAI_MODELS = """ -gpt-4 -gpt-4o -gpt-4o-2024-05-13 -gpt-4-turbo-preview -gpt-4-0314 -gpt-4-0613 -gpt-4-32k -gpt-4-32k-0314 -gpt-4-32k-0613 -gpt-4-turbo -gpt-4-turbo-2024-04-09 -gpt-4-1106-preview -gpt-4-0125-preview -gpt-4-vision-preview -gpt-4-1106-vision-preview -gpt-4o-mini -gpt-4o-mini-2024-07-18 -gpt-3.5-turbo -gpt-3.5-turbo-0301 -gpt-3.5-turbo-0613 -gpt-3.5-turbo-1106 -gpt-3.5-turbo-0125 -gpt-3.5-turbo-16k -gpt-3.5-turbo-16k-0613 -""" - -OPENAI_MODELS = [ln.strip() for ln in OPENAI_MODELS.splitlines() if ln.strip()] - -ANTHROPIC_MODELS = """ -claude-2 -claude-2.1 -claude-3-haiku-20240307 -claude-3-5-haiku-20241022 -claude-3-opus-20240229 -claude-3-sonnet-20240229 -claude-3-5-sonnet-20240620 -claude-3-5-sonnet-20241022 -""" - -ANTHROPIC_MODELS = [ln.strip() for ln in ANTHROPIC_MODELS.splitlines() if ln.strip()] # Mapping of model aliases to their canonical names MODEL_ALIASES = { @@ -1143,9 +1102,9 @@ def fast_validate_environment(self): """Fast path for common models. Avoids forcing litellm import.""" model = self.name - if model in OPENAI_MODELS or model.startswith("openai/"): + if model.startswith(("gpt-", "openai/")): var = "OPENAI_API_KEY" - elif model in ANTHROPIC_MODELS or model.startswith("anthropic/"): + elif model.startswith(("claude-", "anthropic/")): var = "ANTHROPIC_API_KEY" else: return