mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-11 07:04:59 +00:00
copy
This commit is contained in:
parent
7396e3883e
commit
7c746fe901
2 changed files with 37 additions and 26 deletions
|
@ -1,26 +1,34 @@
|
|||
---
|
||||
title: Sonnet is the opposite of lazy
|
||||
excerpt: Claude 3.5 Sonnet represents a step change in AI coding.
|
||||
#highlight_image: /assets/linting.jpg
|
||||
draft: true
|
||||
highlight_image: /assets/sonnet-not-lazy.jpg
|
||||
nav_exclude: true
|
||||
---
|
||||
|
||||
[](https://aider.chat/assets/sonnet-not-lazy.jpg)
|
||||
|
||||
{% if page.date %}
|
||||
<p class="post-date">{{ page.date | date: "%B %d, %Y" }}</p>
|
||||
{% endif %}
|
||||
|
||||
|
||||
# Sonnet is the opposite of lazy
|
||||
|
||||
[](https://aider.chat/assets/sonnet-not-lazy.jpg)
|
||||
|
||||
Claude 3.5 Sonnet represents a step change
|
||||
in AI coding.
|
||||
It is so industrious, diligent and hard working that
|
||||
it has caused multiple problems for aider.
|
||||
|
||||
It's been worth the effort to adapt aider to work well
|
||||
with Sonnet,
|
||||
because the result is surprisingly powerful.
|
||||
Sonnet's score on
|
||||
[aider's refactoring benchmark](https://aider.chat/docs/leaderboards/#code-refactoring-leaderboard)
|
||||
jumped from 55.1% up to 64.0%
|
||||
as a result of the changes discussed below.
|
||||
This moved Sonnet into second place, ahead of GPT-4o and
|
||||
behind only Opus.
|
||||
|
||||
## Problems
|
||||
|
||||
Sonnet's amazing work ethic caused a few problems:
|
||||
|
||||
|
@ -31,7 +39,7 @@ on API responses, which truncates its coding in mid-stream.
|
|||
2. Similarly, Sonnet can specify large sequences of edits in one go,
|
||||
like changing a majority of lines while refactoring a large file.
|
||||
Again, this regularly triggered the 4k output limit
|
||||
and resulted in a failed edits.
|
||||
and resulted in failed edits.
|
||||
3. Sonnet is not shy about quoting large chunks of an
|
||||
existing file to perform a SEARCH & REPLACE edit across
|
||||
a long span of lines.
|
||||
|
@ -57,7 +65,7 @@ Problem (3) does cause some real downsides.
|
|||
Faced with a few small changes spread far apart in
|
||||
a source file,
|
||||
Sonnet would often prefer to do one giant SEARCH/REPLACE
|
||||
operation of the ~entire file.
|
||||
operation of almost the entire file.
|
||||
This wastes a tremendous amount of tokens,
|
||||
time and money -- and risks hitting the 4k output limit.
|
||||
It would be far faster and less expensive to instead
|
||||
|
@ -76,13 +84,16 @@ has specialized support for Claude 3.5 Sonnet:
|
|||
- Aider allows Sonnet to produce as much code as it wants,
|
||||
by automatically and seamlessly spreading the response
|
||||
out over a sequence of 4k token API responses.
|
||||
- Aider carefully prompts Sonnet to be concise and
|
||||
return only changing sections of code.
|
||||
- Aider carefully prompts Sonnet to be concise when proposing
|
||||
code edits.
|
||||
This reduces Sonnet's tendency to waste time, tokens and money
|
||||
returning large chunks of unchanging code.
|
||||
- Aider now uses `claude-3-5-sonnet-20240620` by default if `ANTHROPIC_API_KEY` is set in the environment.
|
||||
- Aider now uses Claude 3.5 Sonnet by default if the `ANTHROPIC_API_KEY` is set in the environment.
|
||||
|
||||
You can use aider with Sonnet like this:
|
||||
See
|
||||
[aider's install instructions](https://aider.chat/docs/install.html)
|
||||
for more details, but
|
||||
you can get started quickly with aider and Sonnet like this:
|
||||
|
||||
```
|
||||
pip install aider-chat
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue