Instead of SEARCH/REPLACE, just output the new file
Issue
Just an idea and I could be missing something, but is there a reason why smaller files wouldn't just have only the updated new file content requested in the output instead of doing a SEARCH/REPLACE which spends a lot more tokens?
If the necessary changes require changing a large of a file, you can just request a full rewrite to be the output instead.
I've mostly been working this way when using 3.5 Sonnet outside of Aider and it seems to work pretty well.
Version and model info
No response
Thanks for trying aider and filing this issue.
You could try using --edit-format whole for this.
Thanks for trying aider and filing this issue.
You could try using
--edit-format wholefor this.
I should've read the docs better!
What do you think about having the option to let Sonnet choose which format to use depending on how much needs to be changed?
I have another idea. What if there was an option for the model to provide its response in a human-readable format, describing the necessary code changes instead of using the diff format? Then, a more cost-effective model, such as Claude Haiku or Gemini Flash, could generate the diff from this description. Alternatively, we could fine-tune a model specifically for this purpose. What do you think?
I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.