Skip to content

Commit

Permalink
feat: Add --reasoning-effort CLI parameter to control model reasoning…
Browse files Browse the repository at this point in the history
… effort
  • Loading branch information
paul-gauthier committed Jan 31, 2025
1 parent f4f4761 commit 3fa7963
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions aider/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ def get_parser(default_config_files, git_root):
default=2,
help="Multiplier for map tokens when no files are specified (default: 2)",
)
group.add_argument(
"--reasoning-effort",
type=float,
help="Control how much effort the model spends on reasoning (0.0-1.0)",
)

##########
group = parser.add_argument_group("History Files")
Expand Down
11 changes: 7 additions & 4 deletions aider/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,10 +778,13 @@ def get_io(pretty):
)

# add --reasoning-effort cli param
# defaults to None
# if present, set main_model.extra_params["extra_body"]["reasoning_effort"] = <val>
# be careful, not all those dicts will be initialized
# ai!
if args.reasoning_effort is not None:
if not hasattr(main_model, 'extra_params'):
main_model.extra_params = {}
if 'extra_body' not in main_model.extra_params:
main_model.extra_params['extra_body'] = {}
main_model.extra_params['extra_body']['reasoning_effort'] = args.reasoning_effort

if args.copy_paste and args.edit_format is None:
if main_model.edit_format in ("diff", "whole"):
main_model.edit_format = "editor-" + main_model.edit_format
Expand Down

0 comments on commit 3fa7963

Please sign in to comment.