1
1
---
2
2
title : Sonnet is the opposite of lazy
3
3
excerpt : Claude 3.5 Sonnet represents a step change in AI coding.
4
- # highlight_image: /assets/linting.jpg
5
- draft : true
4
+ highlight_image : /assets/sonnet-not-lazy.jpg
6
5
nav_exclude : true
7
6
---
7
+
8
+ [ ![ sonnet is the opposite of lazy] ( /assets/sonnet-not-lazy.jpg )] ( https://aider.chat/assets/sonnet-not-lazy.jpg )
9
+
8
10
{% if page.date %}
9
11
<p class =" post-date " >{{ page.date | date: "%B %d, %Y" }}</p >
10
12
{% endif %}
11
13
12
-
13
14
# Sonnet is the opposite of lazy
14
15
15
- [ ![ sonnet is the opposite of lazy] ( /assets/sonnet-not-lazy.jpg )] ( https://aider.chat/assets/sonnet-not-lazy.jpg )
16
-
17
16
Claude 3.5 Sonnet represents a step change
18
17
in AI coding.
19
18
It is so industrious, diligent and hard working that
20
19
it has caused multiple problems for aider.
20
+
21
21
It's been worth the effort to adapt aider to work well
22
22
with Sonnet,
23
23
because the result is surprisingly powerful.
24
+ Sonnet's score on
25
+ [ aider's refactoring benchmark] ( https://aider.chat/docs/leaderboards/#code-refactoring-leaderboard )
26
+ jumped from 55.1% up to 64.0%
27
+ as a result of the changes discussed below.
28
+ This moved Sonnet into second place, ahead of GPT-4o and
29
+ behind only Opus.
30
+
31
+ ## Problems
24
32
25
33
Sonnet's amazing work ethic caused a few problems:
26
34
@@ -31,7 +39,7 @@ on API responses, which truncates its coding in mid-stream.
31
39
2 . Similarly, Sonnet can specify large sequences of edits in one go,
32
40
like changing a majority of lines while refactoring a large file.
33
41
Again, this regularly triggered the 4k output limit
34
- and resulted in a failed edits.
42
+ and resulted in failed edits.
35
43
3 . Sonnet is not shy about quoting large chunks of an
36
44
existing file to perform a SEARCH & REPLACE edit across
37
45
a long span of lines.
@@ -57,7 +65,7 @@ Problem (3) does cause some real downsides.
57
65
Faced with a few small changes spread far apart in
58
66
a source file,
59
67
Sonnet would often prefer to do one giant SEARCH/REPLACE
60
- operation of the ~ entire file.
68
+ operation of almost the entire file.
61
69
This wastes a tremendous amount of tokens,
62
70
time and money -- and risks hitting the 4k output limit.
63
71
It would be far faster and less expensive to instead
@@ -76,13 +84,16 @@ has specialized support for Claude 3.5 Sonnet:
76
84
- Aider allows Sonnet to produce as much code as it wants,
77
85
by automatically and seamlessly spreading the response
78
86
out over a sequence of 4k token API responses.
79
- - Aider carefully prompts Sonnet to be concise and
80
- return only changing sections of code.
87
+ - Aider carefully prompts Sonnet to be concise when proposing
88
+ code edits .
81
89
This reduces Sonnet's tendency to waste time, tokens and money
82
90
returning large chunks of unchanging code.
83
- - Aider now uses ` claude-3-5-sonnet-20240620 ` by default if ` ANTHROPIC_API_KEY ` is set in the environment.
91
+ - Aider now uses Claude 3.5 Sonnet by default if the ` ANTHROPIC_API_KEY ` is set in the environment.
84
92
85
- You can use aider with Sonnet like this:
93
+ See
94
+ [ aider's install instructions] ( https://aider.chat/docs/install.html )
95
+ for more details, but
96
+ you can get started quickly with aider and Sonnet like this:
86
97
87
98
```
88
99
pip install aider-chat
0 commit comments