mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-04 19:55:00 +00:00
Configure model settings, adopt litellm bugfix
This commit is contained in:
parent
f12bbf1e5b
commit
68888faa6f
4 changed files with 127 additions and 205 deletions
|
@ -570,6 +570,7 @@ def main(argv=None, input=None, output=None, force_git_root=None):
|
|||
|
||||
res = litellm.validate_environment(args.model)
|
||||
|
||||
# Is the model known and are all needed keys/params available?
|
||||
missing_keys = res.get("missing_keys")
|
||||
if missing_keys:
|
||||
io.tool_error(f"To use model {args.model}, please set these environment variables:")
|
||||
|
@ -580,6 +581,14 @@ def main(argv=None, input=None, output=None, force_git_root=None):
|
|||
io.tool_error(f"Unknown model {args.model}.")
|
||||
return 1
|
||||
|
||||
# Check in advance that we have model metadata
|
||||
try:
|
||||
litellm.get_model_info(args.model)
|
||||
except Exception as err:
|
||||
io.tool_error(f"Unknown model {args.model}.")
|
||||
io.tool_error(str(err))
|
||||
return 1
|
||||
|
||||
main_model = models.Model(args.model)
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue