diff --git a/aider/models.py b/aider/models.py index 749b2c79c..dc55e0a8a 100644 --- a/aider/models.py +++ b/aider/models.py @@ -246,6 +246,9 @@ class ModelInfoManager: if response.status_code != 200: return {} html = response.text + if f'The model "{url_part}" is not available' in html: + print(f"Error: Model '{url_part}' is not available") + sys.exit(1) import re text = re.sub(r'<[^>]+>', ' ', html) context_match = re.search(r"([\d,]+)\s*context", text)