mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
refactor: Reorder model listing and expand fuzzy matching
This commit is contained in:
parent
40cc155aad
commit
ccacc09ff0
2 changed files with 9 additions and 6 deletions
|
@ -714,11 +714,6 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||||
if args.check_update:
|
if args.check_update:
|
||||||
check_version(io, verbose=args.verbose)
|
check_version(io, verbose=args.verbose)
|
||||||
|
|
||||||
if args.list_models:
|
|
||||||
models.print_matching_models(io, args.list_models)
|
|
||||||
analytics.event("exit", reason="Listed models")
|
|
||||||
return 0
|
|
||||||
|
|
||||||
if args.git:
|
if args.git:
|
||||||
git_root = setup_git(git_root, io)
|
git_root = setup_git(git_root, io)
|
||||||
if args.gitignore:
|
if args.gitignore:
|
||||||
|
@ -738,6 +733,11 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||||
register_models(git_root, args.model_settings_file, io, verbose=args.verbose)
|
register_models(git_root, args.model_settings_file, io, verbose=args.verbose)
|
||||||
register_litellm_models(git_root, args.model_metadata_file, io, verbose=args.verbose)
|
register_litellm_models(git_root, args.model_metadata_file, io, verbose=args.verbose)
|
||||||
|
|
||||||
|
if args.list_models:
|
||||||
|
models.print_matching_models(io, args.list_models)
|
||||||
|
analytics.event("exit", reason="Listed models")
|
||||||
|
return 0
|
||||||
|
|
||||||
# Process any command line aliases
|
# Process any command line aliases
|
||||||
if args.alias:
|
if args.alias:
|
||||||
for alias_def in args.alias:
|
for alias_def in args.alias:
|
||||||
|
|
|
@ -975,7 +975,10 @@ def fuzzy_match_models(name):
|
||||||
name = name.lower()
|
name = name.lower()
|
||||||
|
|
||||||
chat_models = set()
|
chat_models = set()
|
||||||
for orig_model, attrs in litellm.model_cost.items():
|
model_metadata = list(litellm.model_cost.items())
|
||||||
|
model_metadata += list(model_info_manager.local_model_metadata.items())
|
||||||
|
|
||||||
|
for orig_model, attrs in model_metadata:
|
||||||
model = orig_model.lower()
|
model = orig_model.lower()
|
||||||
if attrs.get("mode") != "chat":
|
if attrs.get("mode") != "chat":
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue