mirror of
https://github.com/Aider-AI/aider
synced 2026-04-26 01:25:17 +02:00
Compare commits
990 Commits
v0.81.2.de
...
v0.86.2.de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59250e070e | ||
|
|
b8b521f143 | ||
|
|
07e25599e9 | ||
|
|
2b98a9ecf0 | ||
|
|
450a535548 | ||
|
|
5761b087b5 | ||
|
|
da45632087 | ||
|
|
0a88f7ce34 | ||
|
|
9fda5c93cc | ||
|
|
2f5bb772b5 | ||
|
|
5a3b2f34b6 | ||
|
|
a7d3fdc23b | ||
|
|
0862128d36 | ||
|
|
01a9b88df1 | ||
|
|
a4be6ccd87 | ||
|
|
4cd71acebe | ||
|
|
3d8290cdef | ||
|
|
b782437918 | ||
|
|
f3d5f20ad7 | ||
|
|
f57c0f624a | ||
|
|
071d177309 | ||
|
|
4e7c9f2fcd | ||
|
|
a14cb222c0 | ||
|
|
3b919646a5 | ||
|
|
9702b1c199 | ||
|
|
7440a01015 | ||
|
|
3a6f217dcd | ||
|
|
ceb81369ea | ||
|
|
ad49e56b24 | ||
|
|
53c14329bf | ||
|
|
0b13b27b51 | ||
|
|
d9d13f23b3 | ||
|
|
8c982f83ce | ||
|
|
ac7e274fe0 | ||
|
|
c23ebfe688 | ||
|
|
9d778bfdac | ||
|
|
70f2bbb796 | ||
|
|
6c7870dbcf | ||
|
|
ece9803fdc | ||
|
|
ad39fdb2d1 | ||
|
|
8904e2966d | ||
|
|
3c9e180b54 | ||
|
|
ac40a4c5cb | ||
|
|
1af0e59149 | ||
|
|
3402b151f7 | ||
|
|
f38200c511 | ||
|
|
89ad2ba2cb | ||
|
|
9d6ddcd0fc | ||
|
|
915ebffc8e | ||
|
|
b336dee9b0 | ||
|
|
853532c48c | ||
|
|
1a0ef64011 | ||
|
|
fe3f77176e | ||
|
|
2a18a186b4 | ||
|
|
102f6ef284 | ||
|
|
90dffa9eae | ||
|
|
63d3dbcc9b | ||
|
|
c3f0bdd391 | ||
|
|
c24c2c862d | ||
|
|
7bc2e4e911 | ||
|
|
f7870b6d03 | ||
|
|
bd78b9fe9d | ||
|
|
eab51242bb | ||
|
|
6a28864c22 | ||
|
|
ef59ecbcd8 | ||
|
|
6c16498de1 | ||
|
|
f22fbf9b3a | ||
|
|
1a57730884 | ||
|
|
0967024304 | ||
|
|
456db697f0 | ||
|
|
3db4d378eb | ||
|
|
02c27732af | ||
|
|
966cf2b9fb | ||
|
|
ac46e14ce4 | ||
|
|
9c9c6fe0b8 | ||
|
|
59a5190267 | ||
|
|
302b0cb5f9 | ||
|
|
f4605b2a86 | ||
|
|
3fec90340b | ||
|
|
531838096b | ||
|
|
540b27b577 | ||
|
|
4f4f00f37c | ||
|
|
a544112ff3 | ||
|
|
e0e2cb109a | ||
|
|
66cdfdefd5 | ||
|
|
d5785b57a4 | ||
|
|
ae539fb1f5 | ||
|
|
f5a512ba65 | ||
|
|
c48fea64a1 | ||
|
|
68f05f5b4f | ||
|
|
323910be11 | ||
|
|
19a7864168 | ||
|
|
320ee06cc3 | ||
|
|
8fe52d7b0d | ||
|
|
338cfb46e4 | ||
|
|
63c92771f2 | ||
|
|
a0ffc5761c | ||
|
|
d47cb40518 | ||
|
|
d9e3ede000 | ||
|
|
ba97c83be6 | ||
|
|
22cdacc8e2 | ||
|
|
15806aa6ab | ||
|
|
74ee340101 | ||
|
|
63a7d261ae | ||
|
|
e2d3fc4594 | ||
|
|
14af218ea2 | ||
|
|
5b317e5ec0 | ||
|
|
75f1a33292 | ||
|
|
32cdb7cfad | ||
|
|
d022f4ac63 | ||
|
|
b787e17924 | ||
|
|
5e9daa3c56 | ||
|
|
d5ae9eff88 | ||
|
|
856d94c1dc | ||
|
|
fb4d2f90c1 | ||
|
|
d85078a610 | ||
|
|
f695e71398 | ||
|
|
d90936662b | ||
|
|
6a00d8ff5f | ||
|
|
c4b9f14b90 | ||
|
|
a785b0f463 | ||
|
|
90ecde4da9 | ||
|
|
37b7a7b44f | ||
|
|
89356e897e | ||
|
|
05ca9e5c24 | ||
|
|
7c9cff2f6e | ||
|
|
f9fc2c6a44 | ||
|
|
20429b6852 | ||
|
|
52d04430db | ||
|
|
f16110717b | ||
|
|
a2d345fe3d | ||
|
|
1bdd4f0269 | ||
|
|
9188cedc72 | ||
|
|
fdb49e18cd | ||
|
|
ae927d85f0 | ||
|
|
a1c2eeb88a | ||
|
|
caf212c8d1 | ||
|
|
a29ae3ef37 | ||
|
|
90f9c813a0 | ||
|
|
9fdc6d4a44 | ||
|
|
bb1b9e8e2d | ||
|
|
0c480b7ea4 | ||
|
|
3cb120e0a9 | ||
|
|
1677db3ca7 | ||
|
|
ae94521242 | ||
|
|
f8855ebc58 | ||
|
|
262117d124 | ||
|
|
72c23800a9 | ||
|
|
e91efda8fe | ||
|
|
1daeb01ff0 | ||
|
|
2df4beb6e9 | ||
|
|
e54ac087cb | ||
|
|
17d40a62c9 | ||
|
|
67e190c8d1 | ||
|
|
5562caae0c | ||
|
|
d55beb5f24 | ||
|
|
df5b780d6c | ||
|
|
3e07d068ad | ||
|
|
47ddce3e1b | ||
|
|
e256ffd2c6 | ||
|
|
7a83f038d8 | ||
|
|
990a0566bb | ||
|
|
0ac6068e1d | ||
|
|
1953c9815a | ||
|
|
cc8be1453f | ||
|
|
789aab8417 | ||
|
|
226e23f06d | ||
|
|
150711d7e0 | ||
|
|
8d48def24d | ||
|
|
4c50fc6d69 | ||
|
|
e67c9327fd | ||
|
|
837b8a93e9 | ||
|
|
4c161f9e12 | ||
|
|
f827f22f7a | ||
|
|
3064477cb8 | ||
|
|
a7ccdaf279 | ||
|
|
2bc71cfd71 | ||
|
|
6b7a0565e9 | ||
|
|
8c1ae95f87 | ||
|
|
c0509add21 | ||
|
|
77472e5913 | ||
|
|
836aaece4f | ||
|
|
c4fcc5ad70 | ||
|
|
b259226770 | ||
|
|
db0f7d158d | ||
|
|
b9a9b4cf61 | ||
|
|
29874f1222 | ||
|
|
7897d027d4 | ||
|
|
09b2d49f11 | ||
|
|
295122fc97 | ||
|
|
fa0aa9459b | ||
|
|
c67f6905a5 | ||
|
|
3266eaca91 | ||
|
|
bfaad12cac | ||
|
|
395188043b | ||
|
|
484b8a3603 | ||
|
|
6eaf75f760 | ||
|
|
91f34e37f7 | ||
|
|
7ffd9c1859 | ||
|
|
0bb0f169d2 | ||
|
|
45ad3cdf47 | ||
|
|
fc30409f74 | ||
|
|
6d872b6dc0 | ||
|
|
6fdc956b9e | ||
|
|
196721d27d | ||
|
|
e331a967a6 | ||
|
|
48376e59c2 | ||
|
|
52510c7da5 | ||
|
|
c24798c44f | ||
|
|
6085be5883 | ||
|
|
05c56fe904 | ||
|
|
a7afbd0708 | ||
|
|
3f2c403cf0 | ||
|
|
d7504bed21 | ||
|
|
119a44debe | ||
|
|
87dee0a5f2 | ||
|
|
1d0e463d83 | ||
|
|
8304029b92 | ||
|
|
ef2986a231 | ||
|
|
b79a777936 | ||
|
|
9c9eedd9c5 | ||
|
|
ebaad9d865 | ||
|
|
d922023815 | ||
|
|
acebc11237 | ||
|
|
214b811ef9 | ||
|
|
de9df51b47 | ||
|
|
3194a35230 | ||
|
|
a8568c3c4f | ||
|
|
114ec42563 | ||
|
|
f7df96d224 | ||
|
|
79edb0e1e0 | ||
|
|
5a0951caaf | ||
|
|
6b2bcf651e | ||
|
|
fea0ff189f | ||
|
|
803a8db60c | ||
|
|
414b4e3882 | ||
|
|
a17599152f | ||
|
|
7b9d8e6ba7 | ||
|
|
9ef3211365 | ||
|
|
d9bf69041c | ||
|
|
e3cb907767 | ||
|
|
ef3f8bb301 | ||
|
|
03a489ea35 | ||
|
|
81389b87d7 | ||
|
|
0d8ff295d6 | ||
|
|
6176a8dee3 | ||
|
|
299e6ae7a2 | ||
|
|
0b1d49d630 | ||
|
|
037a36edba | ||
|
|
66bc9cf292 | ||
|
|
2b9e669930 | ||
|
|
cb88b7e62a | ||
|
|
4e9943f2aa | ||
|
|
999c292482 | ||
|
|
9f5018e89e | ||
|
|
59dbce8575 | ||
|
|
3caab85931 | ||
|
|
756372809e | ||
|
|
6aa05ab11c | ||
|
|
9cf373039e | ||
|
|
bc1272f029 | ||
|
|
0049e78250 | ||
|
|
56b45ce1d3 | ||
|
|
bdd67eb229 | ||
|
|
57020a2d5e | ||
|
|
6b9045a2a2 | ||
|
|
5f24a0013a | ||
|
|
b79052501d | ||
|
|
9e0d7d9c46 | ||
|
|
a53ab7d937 | ||
|
|
c055602c6f | ||
|
|
170e8fc9a1 | ||
|
|
ee177054b8 | ||
|
|
f018b5fab5 | ||
|
|
5a29ba03dc | ||
|
|
035d99d3d3 | ||
|
|
702eff1033 | ||
|
|
97f3885357 | ||
|
|
f8653613bc | ||
|
|
b1d47c47d9 | ||
|
|
2c4a126093 | ||
|
|
cdd1546243 | ||
|
|
6a3bb0f4ec | ||
|
|
24c0fbd326 | ||
|
|
7b9eae117f | ||
|
|
512b4d891b | ||
|
|
a6b0f43dce | ||
|
|
e8d9ae9a1f | ||
|
|
2ab0074915 | ||
|
|
225e01717c | ||
|
|
4d39b88110 | ||
|
|
5052150e2e | ||
|
|
d8fbd9cbd3 | ||
|
|
53cda2cc10 | ||
|
|
543e5570ae | ||
|
|
62c7e15a36 | ||
|
|
17a2773a22 | ||
|
|
b8758ca791 | ||
|
|
bf9522a2fb | ||
|
|
ddc8621d6e | ||
|
|
7875de078a | ||
|
|
ea1189b8ec | ||
|
|
1127b8b559 | ||
|
|
64f218a06e | ||
|
|
efde8e867e | ||
|
|
f815f0377e | ||
|
|
883aa9e03d | ||
|
|
2a410fab81 | ||
|
|
34409311a3 | ||
|
|
97379aa02f | ||
|
|
ee4e9c9711 | ||
|
|
7d3c817664 | ||
|
|
8c755bf032 | ||
|
|
0b112e948f | ||
|
|
c11d21a230 | ||
|
|
a9cb1a9d61 | ||
|
|
43cd0164e0 | ||
|
|
49b3f85cc5 | ||
|
|
3daf7d4df3 | ||
|
|
3dcb23c193 | ||
|
|
cad31b638b | ||
|
|
7fbe0d25f5 | ||
|
|
637a31e083 | ||
|
|
f928ffc3fc | ||
|
|
23cb604e6e | ||
|
|
09880ee8f4 | ||
|
|
425fb6d7a8 | ||
|
|
28d87767cd | ||
|
|
ed262b8b06 | ||
|
|
7f30320566 | ||
|
|
9d74e8c730 | ||
|
|
1b2eeaff56 | ||
|
|
0632c7a90f | ||
|
|
c806f18698 | ||
|
|
91d7fbd659 | ||
|
|
fcc85a7ae6 | ||
|
|
dbfba029af | ||
|
|
88fba5f20b | ||
|
|
f7a073961c | ||
|
|
f8c154edce | ||
|
|
c6ad5c8cd2 | ||
|
|
af9ae849bd | ||
|
|
64b4d13880 | ||
|
|
6620141420 | ||
|
|
d79bc2c05b | ||
|
|
9978f6c51e | ||
|
|
5be642fbec | ||
|
|
9f1ef3f49f | ||
|
|
a3562d1d62 | ||
|
|
4e608dbd77 | ||
|
|
3f49acf390 | ||
|
|
77deb35022 | ||
|
|
1a7960810c | ||
|
|
766a41d5de | ||
|
|
df967e4b41 | ||
|
|
781ed90653 | ||
|
|
b9885bb76d | ||
|
|
11480f6110 | ||
|
|
2bc9386876 | ||
|
|
04cbe87caa | ||
|
|
4c959f4542 | ||
|
|
8652fcf86e | ||
|
|
23714d7db6 | ||
|
|
81b86441fd | ||
|
|
edb3bf84cc | ||
|
|
4d5852a30e | ||
|
|
7a5877ea50 | ||
|
|
52ae22bcf8 | ||
|
|
4fb2d78011 | ||
|
|
c93c22ec98 | ||
|
|
a26a3145ba | ||
|
|
055a3d795a | ||
|
|
2d34b738bc | ||
|
|
292aa9bded | ||
|
|
4e86a82a08 | ||
|
|
784ac79da1 | ||
|
|
647f556582 | ||
|
|
aad6838e15 | ||
|
|
95cc362c07 | ||
|
|
9ef506dc25 | ||
|
|
b236e0c801 | ||
|
|
c706663841 | ||
|
|
d7e091f315 | ||
|
|
37601eb4b7 | ||
|
|
a22772b388 | ||
|
|
befff1f22e | ||
|
|
0864a7ca76 | ||
|
|
01592afac3 | ||
|
|
3a5a46253d | ||
|
|
5bb891b2bb | ||
|
|
18f702b95a | ||
|
|
e6a35be5b7 | ||
|
|
6351964bcd | ||
|
|
ede3061fe0 | ||
|
|
f1121e3b7c | ||
|
|
a1cb86dca3 | ||
|
|
cf1d58745e | ||
|
|
98dc8e5d57 | ||
|
|
21a05ead4e | ||
|
|
80f78ee85d | ||
|
|
540b2519c2 | ||
|
|
d3931f67ca | ||
|
|
b6a32d8682 | ||
|
|
023e939798 | ||
|
|
38e7f04e60 | ||
|
|
b40baaceea | ||
|
|
ff549cf9ba | ||
|
|
2c1685bb36 | ||
|
|
2a61494442 | ||
|
|
0af5563e77 | ||
|
|
c147571b18 | ||
|
|
311981f4e5 | ||
|
|
79923c954b | ||
|
|
0b4430f228 | ||
|
|
ee9ad75509 | ||
|
|
920b20b17d | ||
|
|
9297ee982d | ||
|
|
1d5c3c3a2b | ||
|
|
217b45ae88 | ||
|
|
1f6f480864 | ||
|
|
40a5a88d56 | ||
|
|
30097ab859 | ||
|
|
09acfc8147 | ||
|
|
a2ecc5883b | ||
|
|
d127d45669 | ||
|
|
2ebb2103b8 | ||
|
|
c3d4fdb4c1 | ||
|
|
e1ab9cc0ab | ||
|
|
15317a9f4b | ||
|
|
62dc55dd77 | ||
|
|
20faadcbd9 | ||
|
|
8f0fa6684d | ||
|
|
7a3805d39f | ||
|
|
4709a539c6 | ||
|
|
8172125931 | ||
|
|
b8f9d459fb | ||
|
|
96bc57167f | ||
|
|
606e27a337 | ||
|
|
1d7c56b8c5 | ||
|
|
6e1327f66d | ||
|
|
82f33c1220 | ||
|
|
cd7567fcf6 | ||
|
|
e4274aa4f6 | ||
|
|
acd7309b78 | ||
|
|
d5ea078f24 | ||
|
|
8776830306 | ||
|
|
43dd9ef8a5 | ||
|
|
f047b2928b | ||
|
|
d89d500eab | ||
|
|
35fe1df499 | ||
|
|
d32d0b7909 | ||
|
|
0a5c1960b3 | ||
|
|
eef0051b93 | ||
|
|
b5cde63b37 | ||
|
|
043c42b2b4 | ||
|
|
758fa6f67e | ||
|
|
c2fce2699e | ||
|
|
328584e5f4 | ||
|
|
f12395f4d3 | ||
|
|
024c3ed46e | ||
|
|
3ed897c665 | ||
|
|
bfcff84b28 | ||
|
|
4124cee722 | ||
|
|
d18a9f32bc | ||
|
|
aef3863c4a | ||
|
|
f31128706d | ||
|
|
1307215b8f | ||
|
|
cb380b423e | ||
|
|
86d338c811 | ||
|
|
dd3ef07881 | ||
|
|
69f14ace01 | ||
|
|
08220f598c | ||
|
|
9badb711ff | ||
|
|
90b5f897f9 | ||
|
|
4a14aeb7d9 | ||
|
|
fef0f1fa3a | ||
|
|
a39cec8e1d | ||
|
|
c89ac40f56 | ||
|
|
114a0e5ab9 | ||
|
|
371c82e5bb | ||
|
|
71338a679e | ||
|
|
aeaf259021 | ||
|
|
bdec02e290 | ||
|
|
5090f28151 | ||
|
|
a98b531bcc | ||
|
|
8727ffbe68 | ||
|
|
e7de5382fb | ||
|
|
8956eef339 | ||
|
|
0c236d0035 | ||
|
|
aaacee5d4d | ||
|
|
da00455388 | ||
|
|
03acee1ed2 | ||
|
|
4ab8faf21e | ||
|
|
2f45023f59 | ||
|
|
1d2818a064 | ||
|
|
582da0ee44 | ||
|
|
592dea0f8c | ||
|
|
dd8db78680 | ||
|
|
23ce877bd2 | ||
|
|
8bb971c15d | ||
|
|
fe20e528b0 | ||
|
|
8dd8fb52f4 | ||
|
|
af9fcdcfa8 | ||
|
|
9990965e82 | ||
|
|
5b52063446 | ||
|
|
b2e3d47d14 | ||
|
|
67cbda3bd5 | ||
|
|
84d6cf937b | ||
|
|
765ac2a14d | ||
|
|
1167700a53 | ||
|
|
c6954f9972 | ||
|
|
c72e5fcc5e | ||
|
|
4ec075d290 | ||
|
|
60a1a3a8c8 | ||
|
|
bf38754846 | ||
|
|
94197cb25d | ||
|
|
cbaaf96324 | ||
|
|
96899a140b | ||
|
|
c756b080e8 | ||
|
|
a61fb1e23b | ||
|
|
9660d95ceb | ||
|
|
eabc98b64a | ||
|
|
5ff3d1a0c5 | ||
|
|
b6587de389 | ||
|
|
4d9f4e0202 | ||
|
|
e9d2f527a1 | ||
|
|
98e6939c48 | ||
|
|
e3911f8621 | ||
|
|
efd5f79368 | ||
|
|
8e84b5c0b1 | ||
|
|
c1dc473ed8 | ||
|
|
3b08327792 | ||
|
|
8b08c5a5f3 | ||
|
|
eedea62ac1 | ||
|
|
146f62abcc | ||
|
|
1c854f2e83 | ||
|
|
d27bb56cf3 | ||
|
|
28aeb17cbe | ||
|
|
b3cf318c5e | ||
|
|
4acf65fcfb | ||
|
|
4c871c6f50 | ||
|
|
d56ce3ae56 | ||
|
|
5225d7f50c | ||
|
|
41392a1c6e | ||
|
|
ca714157b8 | ||
|
|
9dd2d2a3b1 | ||
|
|
e53f2f7674 | ||
|
|
edbfec0ce4 | ||
|
|
d294e8cd49 | ||
|
|
2229bb9817 | ||
|
|
7ef7b6e042 | ||
|
|
8159cbf7d3 | ||
|
|
c23e609902 | ||
|
|
2d9ea25273 | ||
|
|
7773bbc908 | ||
|
|
72476f0967 | ||
|
|
a9883ccc25 | ||
|
|
3b9b93a8a4 | ||
|
|
f90b7bfb09 | ||
|
|
edc941eb9e | ||
|
|
5e7ef6c50e | ||
|
|
fdc7be1318 | ||
|
|
f00c1bf61b | ||
|
|
09030de0b5 | ||
|
|
bdba0ca1c5 | ||
|
|
e17c7d938c | ||
|
|
433f2908a0 | ||
|
|
9fa5f5ace1 | ||
|
|
849a379a8c | ||
|
|
98ee78edf0 | ||
|
|
e205629a94 | ||
|
|
9351f37935 | ||
|
|
7d185bb710 | ||
|
|
07759813ed | ||
|
|
591d294052 | ||
|
|
df1a0c5b8d | ||
|
|
e743394537 | ||
|
|
22f140ac05 | ||
|
|
25a303935c | ||
|
|
3bf20d4f7a | ||
|
|
45413ce815 | ||
|
|
8ffe466257 | ||
|
|
d9aa3cb2d4 | ||
|
|
5251a2452c | ||
|
|
6df2c1595f | ||
|
|
c56e4a08d3 | ||
|
|
80515b69c1 | ||
|
|
303645cffa | ||
|
|
b3d32f65d3 | ||
|
|
7c0aac7454 | ||
|
|
7719eae023 | ||
|
|
5e210c700d | ||
|
|
c6ce871700 | ||
|
|
f28504a2eb | ||
|
|
48733a315b | ||
|
|
16fbff8de1 | ||
|
|
bbab0cea5e | ||
|
|
19de93ae39 | ||
|
|
230e5065c1 | ||
|
|
c94340d493 | ||
|
|
ac1ff231e0 | ||
|
|
5423ffe518 | ||
|
|
ba4d613cbc | ||
|
|
ab11118c8a | ||
|
|
3ca3f39f1d | ||
|
|
8c3f167e8c | ||
|
|
1a4d3927e7 | ||
|
|
20a29e5cd1 | ||
|
|
51e0fff822 | ||
|
|
13b3e75d0e | ||
|
|
de28178369 | ||
|
|
2f38cd184c | ||
|
|
d8caa76bc8 | ||
|
|
506c3c928e | ||
|
|
48ac1de8d3 | ||
|
|
ebfce5b0f2 | ||
|
|
58f4db4e52 | ||
|
|
ba2c4d1eb7 | ||
|
|
6656b5d973 | ||
|
|
b4673fdc85 | ||
|
|
ce1266be68 | ||
|
|
226108d05d | ||
|
|
b2d541f1eb | ||
|
|
758020c574 | ||
|
|
876569613b | ||
|
|
82b26daf37 | ||
|
|
be44b65095 | ||
|
|
8596f0d4a3 | ||
|
|
19a94e5f15 | ||
|
|
7bde345b83 | ||
|
|
d45a5747ea | ||
|
|
e560ab61b6 | ||
|
|
84c3ac93ef | ||
|
|
7a50b7779a | ||
|
|
328a3c3178 | ||
|
|
21fa54d792 | ||
|
|
ec7ac60cfc | ||
|
|
c2d8d5dc82 | ||
|
|
20a7e3552c | ||
|
|
888168f044 | ||
|
|
851642a1bd | ||
|
|
f7bdebfba9 | ||
|
|
a4d3222108 | ||
|
|
f1caab9de0 | ||
|
|
c08336fdb0 | ||
|
|
541b496d09 | ||
|
|
622bf349c5 | ||
|
|
05eaf82b36 | ||
|
|
5c8150fd16 | ||
|
|
ec9327dcb4 | ||
|
|
8e689d35af | ||
|
|
50fd544070 | ||
|
|
4f8bd2e06d | ||
|
|
6f1b6f5f31 | ||
|
|
bdfda399cb | ||
|
|
a08ffc3513 | ||
|
|
21beee2fe1 | ||
|
|
a564f94bf3 | ||
|
|
9e54898866 | ||
|
|
739e01da95 | ||
|
|
3e0af2cc84 | ||
|
|
9ff13740f2 | ||
|
|
00e5c33444 | ||
|
|
57abaf7500 | ||
|
|
ed14be4e70 | ||
|
|
80909e17c7 | ||
|
|
52697ea884 | ||
|
|
9f01c8d0d6 | ||
|
|
e91d7e74ae | ||
|
|
20ca0463ea | ||
|
|
5e40f469bf | ||
|
|
7f28d63c33 | ||
|
|
bb1fa24971 | ||
|
|
ffbbaa06d7 | ||
|
|
14e1b96f05 | ||
|
|
d8c781b66b | ||
|
|
2fbec8545c | ||
|
|
b66901fc75 | ||
|
|
d569bca520 | ||
|
|
efbefc669f | ||
|
|
24805ff85d | ||
|
|
8b917d5716 | ||
|
|
3502f335ec | ||
|
|
758979e4f3 | ||
|
|
8b5fc801da | ||
|
|
f5c4214c93 | ||
|
|
f106993cd1 | ||
|
|
270e84287a | ||
|
|
daec7cf3f4 | ||
|
|
bb42d1e9a5 | ||
|
|
23f182aab3 | ||
|
|
119fbc995c | ||
|
|
3081f49179 | ||
|
|
8cf1874453 | ||
|
|
31b4bd5bcf | ||
|
|
71d1591cc1 | ||
|
|
134a2d60fe | ||
|
|
152b8912ae | ||
|
|
36f23c101d | ||
|
|
0e40510295 | ||
|
|
db0d0768d7 | ||
|
|
c68cade9f2 | ||
|
|
14928727eb | ||
|
|
67b9345929 | ||
|
|
dae1a376a2 | ||
|
|
1e359f1dcf | ||
|
|
1c54857422 | ||
|
|
0f78a0ac5c | ||
|
|
4e1e77890b | ||
|
|
5573cdfba1 | ||
|
|
14028d3758 | ||
|
|
3ab673b398 | ||
|
|
861f51f6c3 | ||
|
|
64f5d0d388 | ||
|
|
9059af8d5f | ||
|
|
c3a543b99d | ||
|
|
c85cd783e5 | ||
|
|
af2d241c99 | ||
|
|
30839a5273 | ||
|
|
8baa99b7ef | ||
|
|
d1e5572343 | ||
|
|
96aa648e17 | ||
|
|
1ae5f23dc8 | ||
|
|
f565f72679 | ||
|
|
78e76648d0 | ||
|
|
8e1e2210dd | ||
|
|
e8c43c36d7 | ||
|
|
97e2a7bae0 | ||
|
|
6b75a578ac | ||
|
|
8b9238ebc9 | ||
|
|
8cc8027b40 | ||
|
|
ffb743e108 | ||
|
|
0f805752d3 | ||
|
|
4e9de4d51b | ||
|
|
a4e9539040 | ||
|
|
0c383dfb11 | ||
|
|
11d2b7ca98 | ||
|
|
e38be2f280 | ||
|
|
febdd3c0d0 | ||
|
|
0b08ca64a8 | ||
|
|
0f8e7fbd34 | ||
|
|
1a080ba71c | ||
|
|
1622531d85 | ||
|
|
7d0a9c7233 | ||
|
|
53a64c88ad | ||
|
|
27b51d51d8 | ||
|
|
bec35e0538 | ||
|
|
f65e6a3bb1 | ||
|
|
fd94f1a5f9 | ||
|
|
09fc037d4d | ||
|
|
cf0e6dac61 | ||
|
|
3b10e3bcb5 | ||
|
|
4c17784444 | ||
|
|
6616f0886d | ||
|
|
dcafab2764 | ||
|
|
3b6146301f | ||
|
|
42e09b3c7f | ||
|
|
73da42bee6 | ||
|
|
415b1cf5f0 | ||
|
|
c011285904 | ||
|
|
4314b4fefb | ||
|
|
d686f6844d | ||
|
|
65a0e5f771 | ||
|
|
5ca6d8ce67 | ||
|
|
688c2b9ee5 | ||
|
|
271f39505c | ||
|
|
3e8367ea3b | ||
|
|
67a1e52259 | ||
|
|
7561687b7b | ||
|
|
93fc7acbe3 | ||
|
|
72dc67950f | ||
|
|
e2bebd1d51 | ||
|
|
03560d3386 | ||
|
|
a3a3303a83 | ||
|
|
232a6f87d2 | ||
|
|
ab71ea0a65 | ||
|
|
1302224f39 | ||
|
|
733bf0dcdf | ||
|
|
4ed48178a9 | ||
|
|
8cffb975d9 | ||
|
|
97b18797a4 | ||
|
|
579794b265 | ||
|
|
bea746595e | ||
|
|
87711b048a | ||
|
|
0b468ebd85 | ||
|
|
aefc250e30 | ||
|
|
4a86fea86b | ||
|
|
fe6e2e1ea7 | ||
|
|
09d90b9b70 | ||
|
|
14eb7b46a2 | ||
|
|
66077fe3a4 | ||
|
|
d50cf806db | ||
|
|
95edae9bd1 | ||
|
|
a6c35305ed | ||
|
|
b382005a4c | ||
|
|
a71b90bdd6 | ||
|
|
d4a68c80bc | ||
|
|
fcf44cbebe | ||
|
|
51d8cb063a | ||
|
|
cdc86565cc | ||
|
|
1c54907b30 | ||
|
|
b6d4246e18 | ||
|
|
cc1a984c7e | ||
|
|
52d39657ab | ||
|
|
363ec82a48 | ||
|
|
f164b0e3eb | ||
|
|
3aaf7a69ec | ||
|
|
6d2828bc3c | ||
|
|
dd6e2051a8 | ||
|
|
ef440972bb | ||
|
|
da96888669 | ||
|
|
75639059e1 | ||
|
|
0a15dd311a | ||
|
|
434a1c6710 | ||
|
|
f961eecab6 | ||
|
|
d33a571f7d | ||
|
|
ea1239efef | ||
|
|
19c7c7a9dc | ||
|
|
49e4af4fab | ||
|
|
3e27c1bb17 | ||
|
|
0f8d196741 | ||
|
|
4c45f0e44b | ||
|
|
e39eef1ed7 | ||
|
|
c9c7aea1c4 | ||
|
|
18ff9eb2b4 | ||
|
|
b2f3d2cd84 | ||
|
|
5e0832cb8b | ||
|
|
a14c0ccac6 | ||
|
|
278f90acdd | ||
|
|
8e8b18e9a9 | ||
|
|
a277d74869 | ||
|
|
7ca3b6455d | ||
|
|
5ec6f69037 | ||
|
|
39962ba5eb | ||
|
|
51fa1f9abd | ||
|
|
47af5d463c | ||
|
|
33f0b0b41c | ||
|
|
48038b1f5e | ||
|
|
323698d387 | ||
|
|
1f702beb74 | ||
|
|
7d34c28af1 | ||
|
|
d26be77010 | ||
|
|
3b96d1bd57 | ||
|
|
48fd0e71d5 | ||
|
|
bcb35ccf44 | ||
|
|
a663ff7fa8 | ||
|
|
813d34a0e9 | ||
|
|
a4074a13c4 | ||
|
|
249f329b07 | ||
|
|
cf160a8f84 | ||
|
|
4db963182d | ||
|
|
199b59fdb9 | ||
|
|
2d09bfa0f3 | ||
|
|
729285e8a2 | ||
|
|
afd17bd96a | ||
|
|
380d8570dc | ||
|
|
e711eaa810 | ||
|
|
7dfdc2094e | ||
|
|
838646ac5b | ||
|
|
507f07575b | ||
|
|
f5e8808770 | ||
|
|
ae5b6e88a5 | ||
|
|
b45186dde0 | ||
|
|
38be8aa0da | ||
|
|
816d4ba206 | ||
|
|
ede59e4d2a | ||
|
|
ce0931a3c8 | ||
|
|
a44e148818 | ||
|
|
71115c6558 | ||
|
|
8ae837e98b | ||
|
|
9518193d0a | ||
|
|
60a2b799e6 | ||
|
|
1d42690824 | ||
|
|
3f94fd5e4e | ||
|
|
165e237be7 | ||
|
|
38dfd6f4f9 | ||
|
|
5851d66174 | ||
|
|
6a970c3515 | ||
|
|
9e91e8f1b2 | ||
|
|
3e1bc77bf2 | ||
|
|
d991cb6721 | ||
|
|
37a252748a | ||
|
|
5664b5b195 | ||
|
|
278a596bfa | ||
|
|
ea74f31b3e | ||
|
|
9d7dc00f25 | ||
|
|
882e7b6716 | ||
|
|
8ba29ee8e6 | ||
|
|
dd4b61da20 | ||
|
|
c56e836d22 | ||
|
|
427f9c5b00 | ||
|
|
aa07e16f18 | ||
|
|
7b8c7edfd5 | ||
|
|
cf7b35f90d | ||
|
|
02bc9a85c0 | ||
|
|
e1820522db | ||
|
|
0a59c38f31 | ||
|
|
66fdeceb3b | ||
|
|
3f67c41759 | ||
|
|
7fbeafa1cf | ||
|
|
316d8f8e9b | ||
|
|
15d623f2c0 | ||
|
|
d1437b7666 | ||
|
|
ff8e9850ba | ||
|
|
f648a018a2 | ||
|
|
072bd30443 | ||
|
|
48f89f226f | ||
|
|
d5671c2879 | ||
|
|
80114e7a24 | ||
|
|
dede701423 | ||
|
|
43cb4d68f7 | ||
|
|
4783ad3a73 | ||
|
|
482e0c2d0b | ||
|
|
e951164399 | ||
|
|
c73b987cd0 | ||
|
|
b22c9b8542 | ||
|
|
a5327af5e9 | ||
|
|
192f8bec26 | ||
|
|
eb28e22891 | ||
|
|
b6b8f30378 | ||
|
|
67bb4f9552 | ||
|
|
028257480b | ||
|
|
e42a0c45b6 | ||
|
|
1e7f8549ff | ||
|
|
668de71f9d | ||
|
|
067245b810 | ||
|
|
8f236c69e1 | ||
|
|
8ee33da114 | ||
|
|
2fedc2e699 | ||
|
|
1961543e2f | ||
|
|
b4f65734a5 | ||
|
|
0eb80553f6 | ||
|
|
110c63ae95 | ||
|
|
57304536bf | ||
|
|
a9ca5da139 | ||
|
|
947aebfbe0 | ||
|
|
fafc9268d4 | ||
|
|
65a5d55436 | ||
|
|
96b350400f | ||
|
|
7983b4caf2 | ||
|
|
e44122f1be | ||
|
|
42618d7ec6 | ||
|
|
1d0167bbf4 | ||
|
|
43d4b21b23 | ||
|
|
562171c548 | ||
|
|
8dccecdd9f | ||
|
|
940ae364d7 | ||
|
|
532bc454c5 | ||
|
|
14ffe7782c | ||
|
|
2dd40fce44 | ||
|
|
0c8bc46e28 | ||
|
|
23c9d9c34d | ||
|
|
188e9e1114 | ||
|
|
7d0dd29937 | ||
|
|
349cd77821 | ||
|
|
dc2d7b1dfe | ||
|
|
be30329288 | ||
|
|
71446d9f3c | ||
|
|
c9d4c8d09b | ||
|
|
c580ffdb70 | ||
|
|
f46deb4eb7 | ||
|
|
b3215bed48 | ||
|
|
2a9ab02753 | ||
|
|
0da586154d | ||
|
|
26d736551d | ||
|
|
9445a3118b | ||
|
|
a2c46c7436 | ||
|
|
8df7a0960e | ||
|
|
e7f35e7a35 | ||
|
|
088e80e38b | ||
|
|
2d65c7f387 | ||
|
|
94db758eb7 | ||
|
|
e980973621 | ||
|
|
3447f06208 | ||
|
|
b3d9e0d1b0 | ||
|
|
7c3d96d0e7 | ||
|
|
cdd730e627 | ||
|
|
21cca34392 | ||
|
|
d64427d726 | ||
|
|
87ccacb99f | ||
|
|
b37773c630 | ||
|
|
4765a90f97 | ||
|
|
29587cd07c | ||
|
|
2651d99676 | ||
|
|
44e5525e6f | ||
|
|
5e48f6898d | ||
|
|
08d48f42ad | ||
|
|
4600dbcda5 | ||
|
|
c1b2ff20de | ||
|
|
c980fd0e77 |
2
.github/workflows/check_pypi_version.yml
vendored
2
.github/workflows/check_pypi_version.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
||||
python-version: ["3.10", "3.11", "3.12"]
|
||||
|
||||
steps:
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
|
||||
48
.github/workflows/pre-commit.yml
vendored
Normal file
48
.github/workflows/pre-commit.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
name: pre-commit
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
pre-commit:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RAW_LOG: pre-commit.log
|
||||
CS_XML: pre-commit.xml
|
||||
steps:
|
||||
- run: sudo apt-get update && sudo apt-get install cppcheck uncrustify
|
||||
if: false
|
||||
- uses: actions/checkout@v4
|
||||
- run: python -m pip install pre-commit
|
||||
- uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ~/.cache/pre-commit/
|
||||
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
- name: Run pre-commit hooks
|
||||
env:
|
||||
SKIP: no-commit-to-branch
|
||||
run: |
|
||||
set -o pipefail
|
||||
pre-commit gc
|
||||
pre-commit run --show-diff-on-failure --color=always --all-files | tee ${RAW_LOG}
|
||||
- name: Convert Raw Log to Checkstyle format (launch action)
|
||||
uses: mdeweerd/logToCheckStyle@v2025.1.1
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
in: ${{ env.RAW_LOG }}
|
||||
# out: ${{ env.CS_XML }}
|
||||
- uses: actions/cache/save@v4
|
||||
if: ${{ ! cancelled() }}
|
||||
with:
|
||||
path: ~/.cache/pre-commit/
|
||||
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
- name: Provide log as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ ! cancelled() }}
|
||||
with:
|
||||
name: precommit-logs
|
||||
path: |
|
||||
${{ env.RAW_LOG }}
|
||||
${{ env.CS_XML }}
|
||||
retention-days: 2
|
||||
2
.github/workflows/ubuntu-tests.yml
vendored
2
.github/workflows/ubuntu-tests.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
||||
python-version: ["3.10", "3.11", "3.12"]
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
|
||||
2
.github/workflows/windows-tests.yml
vendored
2
.github/workflows/windows-tests.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
||||
python-version: ["3.10", "3.11", "3.12"]
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
||||
python-version: ["3.10", "3.11", "3.12"]
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh # Use PowerShell for all run steps
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -15,4 +15,5 @@ aider/_version.py
|
||||
.venv/
|
||||
.#*
|
||||
.gitattributes
|
||||
tmp.benchmarks/
|
||||
tmp.benchmarks/
|
||||
.docker_bash_history
|
||||
187
HISTORY.md
187
HISTORY.md
@@ -1,11 +1,188 @@
|
||||
# Release history
|
||||
|
||||
### Aider v0.86.0
|
||||
|
||||
- Expanded GPT-5 model support across family variants and providers (OpenAI, Azure, OpenRouter), including dated and chat/mini/nano variants.
|
||||
- Aider wrote 88% of the code in this release.
|
||||
|
||||
### Aider v0.85.5
|
||||
|
||||
- Enforced diff edit format for GPT-5 models.
|
||||
- Added support for the reasoning_effort setting for GPT-5 models.
|
||||
- Fixed model detection to correctly apply GPT-5 settings to versioned names (gpt-5 and gpt-5-2025-08-07).
|
||||
|
||||
### Aider v0.85.4
|
||||
|
||||
- Added support for openai/gpt-5
|
||||
- Fixed analytics to support the latest PostHog SDK event-capture API.
|
||||
- Disabled temperature when using GPT-5 models for more deterministic outputs.
|
||||
|
||||
### Aider v0.85.3
|
||||
|
||||
- Bumped dependencies to pick up latest litellm==1.75.0.
|
||||
|
||||
### Aider v0.85.2
|
||||
|
||||
- Added support for Grok-4 via `xai/grok-4` and `openrouter/x-ai/grok-4` model names.
|
||||
- Added support for `gemini/gemini-2.5-flash-lite-preview-06-17` model, by Tamir Zahavi-Brunner.
|
||||
- `/clear` now prints “All chat history cleared.” so you know it worked, by Zexin Yuan.
|
||||
- `/undo` output now shows only the first line of each commit message, making it easier to read.
|
||||
- Fixed an issue where new settings for an existing model didn't replace the old ones, by Andrew Grigorev.
|
||||
- Added support for `openrouter/moonshotai/kimi-k2` model, by Jack Harrington.
|
||||
|
||||
### Aider v0.85.1
|
||||
|
||||
- Display model announcements with no-arg `/model` command.
|
||||
|
||||
### Aider v0.85.0
|
||||
|
||||
- Support for Responses API models like o1-pro, o3-pro.
|
||||
- Updated pricing for o3.
|
||||
- Added support for new Gemini models including `gemini-2.5-pro`, `gemini-2.5-flash`, and `gemini-2.5-pro-preview-06-05` with thinking tokens support.
|
||||
- Updated model aliases: `flash` now points to `gemini-2.5-flash` and `gemini` now points to `gemini-2.5-pro`.
|
||||
- Added `--add-gitignore-files` flag to enable adding files listed in .gitignore to Aider's editing scope, by omarcinkonis.
|
||||
- Added `--commit-language` option to specify the language for commit messages, by Kyosuke Takayama.
|
||||
- Enhanced thinking tokens support: can now be disabled by setting to 0, and improved help text with examples.
|
||||
- Added MATLAB language support for repository maps, by Matthew Tofano.
|
||||
- Added support for OpenAI o3-pro model across multiple providers.
|
||||
- Improved GitHub Copilot token handling with better validation and error messages, by Vincent Taverna and Sebastian Estrella.
|
||||
- Fixed encoding issues in git diff output and LLM history logging.
|
||||
- Enhanced commit message generation to use system prompt prefixes, by Luke Reeves.
|
||||
- Improved inline code rendering in Rich markdown output, by Vamsi Talupula.
|
||||
- Fixed Vertex AI model name prefixes in settings, by Wietse Venema.
|
||||
- Improved `/read-only` command to resolve literal paths correctly, by Matteo Landi.
|
||||
- Skip expensive file tracking operations when `--skip-sanity-check-repo` is enabled for better performance, by Makar Ivashko.
|
||||
- Ensure pip is available before package installation.
|
||||
- Auto-create parent directories for chat history files to prevent startup errors, by contributor.
|
||||
- Fixed search block regex to accept optional closing tags when working with HTML content, by Mathis Beer.
|
||||
- Co-authored-by attribution is now enabled by default for commit messages.
|
||||
- Added Clojure language support for repository maps, by Garrett Hopper.
|
||||
- Added custom PostHog analytics configuration options with `--analytics-posthog-host` and `--analytics-posthog-project-api-key` flags, by Vasil Markoukin.
|
||||
- Optimized chat history summarization performance, by jayeshthk.
|
||||
- Improved kebab-case identifier recognition in repository maps for better code analysis.
|
||||
- Increased max tokens for Deepseek models to 65536 for better performance.
|
||||
- Aider wrote 21% of the code in this release.
|
||||
|
||||
### Aider v0.84.0
|
||||
|
||||
- Added support for new Claude models including the Sonnet 4 and Opus 4 series (e.g., `claude-sonnet-4-20250514`,
|
||||
`claude-opus-4-20250514`) across various providers. The default `sonnet` and `opus` aliases were updated to these newer
|
||||
versions.
|
||||
- Added support for the `vertex_ai/gemini-2.5-flash-preview-05-20` model.
|
||||
- Fixed OpenRouter token cost calculation for improved accuracy.
|
||||
- Updated default OpenRouter models during onboarding to `deepseek/deepseek-r1:free` for the free tier and
|
||||
`anthropic/claude-sonnet-4` for paid tiers.
|
||||
- Automatically refresh GitHub Copilot tokens when used as OpenAI API keys, by Lih Chen.
|
||||
- Aider wrote 79% of the code in this release.
|
||||
|
||||
### Aider v0.83.2
|
||||
|
||||
- Bumped configargparse to 1.7.1 as 1.7 was pulled.
|
||||
- Added shell tab completion for file path arguments (by saviour) and for `--edit-format`/`--editor-edit-format` options.
|
||||
- Improved OpenRouter model metadata handling by introducing a local cache, increasing reliability and performance.
|
||||
- The `/settings` command now displays detailed metadata for active main, editor, and weak models.
|
||||
- Fixed an issue where files explicitly added via the command line were not correctly ignored if listed in `.gitignore`.
|
||||
- Improved automatic commit messages by providing more context during their generation, by wangboxue.
|
||||
|
||||
### Aider v0.83.1
|
||||
|
||||
- Improved user language detection by correctly normalizing hyphenated language codes (e.g., `en-US` to `en`) and enhancing the validation of locale results.
|
||||
- Prevented Aider from instructing the LLM to reply in 'C' or 'POSIX' when these are detected as the system locale.
|
||||
- Displayed a spinner with the model name when generating commit messages.
|
||||
|
||||
### Aider v0.83.0
|
||||
|
||||
- Added support for `gemini-2.5-pro-preview-05-06` models.
|
||||
- Added support for `qwen3-235b` models.
|
||||
- Added repo-map support for OCaml and OCaml interface files, by Andrey Popp.
|
||||
- Added a spinner animation while waiting for the LLM to start streaming its response.
|
||||
- Updated the spinner animation to a Knight Rider style.
|
||||
- Introduced `--attribute-co-authored-by` option to add co-author trailer to commit messages, by Andrew Grigorev.
|
||||
- Updated Gemini model aliases (e.g., `gemini`, `gemini-2.5-pro`) to point to the `05-06` preview versions.
|
||||
- Marked Gemini 2.5 Pro preview models as `overeager` by default.
|
||||
- Commit message prompt specifies the user's language.
|
||||
- Updated the default weak model for Gemini 2.5 Pro models to `gemini/gemini-2.5-flash-preview-04-17`.
|
||||
- Corrected `gemini-2.5-pro-exp-03-25` model settings to reflect its lack of support for `thinking_budget`.
|
||||
- Ensured model-specific system prompt prefixes are placed on a new line before the main system prompt.
|
||||
- Added tracking of total tokens sent and received, now included in benchmark statistics.
|
||||
- Automatically fetch model parameters (context window, pricing) for OpenRouter models directly from their website, by Stefan Hladnik.
|
||||
- Enabled support for `thinking_tokens` and `reasoning_effort` parameters for OpenRouter models.
|
||||
- Improved cost calculation using `litellm.completion_cost` where available.
|
||||
- Added model settings for `openrouter/google/gemini-2.5-pro-preview-03-25`.
|
||||
- Added `--disable-playwright` flag to prevent Playwright installation prompts and usage, by Andrew Grigorev.
|
||||
- The `aider scrape` command-line tool will now use Playwright for web scraping if it is available, by Jon Keys.
|
||||
- Fixed linter command execution on Windows by adopting `oslex` for argument quoting, by Titusz Pan.
|
||||
- Improved cross-platform display of shell commands by using `oslex` for robust argument quoting, by Titusz Pan.
|
||||
- Improved `/ask` mode to instruct the LLM to elide unchanging code in its responses.
|
||||
- Ensured web scraping in the GUI also respects Playwright availability and the `--disable-playwright` flag.
|
||||
- Improved display of filenames in the prompt header using rich Text formatting.
|
||||
- Enabled `reasoning_effort` for Gemini 2.5 Flash models.
|
||||
- Added a `--shell-completions` argument to generate shell completion scripts (e.g., for bash, zsh).
|
||||
- Explicit `--attribute-author` or `--attribute-committer` flags now override the default behavior when `--attribute-co-authored-by` is used, allowing finer control over commit attribution, by Andrew Grigorev.
|
||||
- Fixed an issue where read-only status of files might not be preserved correctly by some commands (e.g. `/drop` after adding a read-only file).
|
||||
- The `aider-args` utility (or `python -m aider.args`) now defaults to printing a sample YAML configuration if no arguments are provided.
|
||||
- Displayed token count progress and the name of the file or identifier being processed during repo map updates.
|
||||
- Extended the waiting spinner to also show for non-streaming responses and further enhanced its animation with console width clipping, cursor hiding, and a more continuous appearance.
|
||||
- Dropped support for Python 3.9.
|
||||
- Aider wrote 55% of the code in this release.
|
||||
|
||||
### Aider v0.82.3
|
||||
|
||||
- Add support for `gemini-2.5-flash-preview-04-17` models.
|
||||
- Improved robustness of edit block parsing when filenames start with backticks or fences.
|
||||
- Add new `udiff-simple` edit format, for Gemini 2.5 Pro.
|
||||
- Update default weak/editor models for Gemini 2.5 Pro models to use `gemini-2.5-flash-preview-04-17`.
|
||||
- Instruct models to reply in the user's detected system language.
|
||||
- Fix parsing of diffs for newly created files (`--- /dev/null`).
|
||||
- Add markdown syntax highlighting support when editing multi-line commit messages via `/commit`, by Kay Gosho.
|
||||
- Set Gemini 2.5 Pro models to use the `overeager` prompt setting by default.
|
||||
- Add common file types (`.svg`, `.pdf`) to the default list of ignored files for AI comment scanning (`--watch`).
|
||||
- Skip scanning files larger than 1MB for AI comments (`--watch`).
|
||||
|
||||
### Aider v0.82.2
|
||||
|
||||
- Fix editing shell files with diff-fenced, by zjy1412.
|
||||
- Improve robustness of patch application by allowing multiple update/delete actions for the same file within a single response.
|
||||
- Update prompts to instruct LLMs to consolidate all edits for a given file into a single block within the patch.
|
||||
|
||||
### Aider v0.82.1
|
||||
|
||||
- Added support for `o3` and `o4-mini` including provider-specific versions for OpenAI, OpenRouter, and Azure.
|
||||
- Added support for Azure specific `gpt-4.1` and `gpt-4.1-mini` models.
|
||||
- Disabled streaming for `o3` models since you need identity verification to stream.
|
||||
- Fixed handling of file paths in unified diffs, especially those generated by git.
|
||||
|
||||
### Aider v0.82.0
|
||||
|
||||
- Support for GPT 4.1, mini and nano.
|
||||
- Added new `patch` edit format for OpenAI's GPT-4.1 model.
|
||||
- Improved support for using architect mode with Gemini 2.5 Pro.
|
||||
- Added new `editor-diff`, `editor-whole`, and `editor-diff-fenced` edit formats.
|
||||
- Bugfix for automatically selecting the best edit format to use in architect mode.
|
||||
- Added support for `grok-3-fast-beta` and `grok-3-mini-fast-beta` models.
|
||||
- Aider wrote 92% of the code in this release.
|
||||
|
||||
### Aider v0.81.3
|
||||
|
||||
- Commit messages generated by aider are no longer forced to be entirely lowercase, by Peter Hadlaw.
|
||||
- Updated default settings for Grok models.
|
||||
|
||||
### Aider v0.81.2
|
||||
|
||||
- Add support for `xai/grok-3-beta`, `xai/grok-3-mini-beta`, `openrouter/x-ai/grok-3-beta`, `openrouter/x-ai/grok-3-mini-beta`, and `openrouter/openrouter/optimus-alpha` models.
|
||||
- Add alias "grok3" for `xai/grok-3-beta`.
|
||||
- Add alias "optimus" for `openrouter/openrouter/optimus-alpha`.
|
||||
- Fix URL extraction from error messages.
|
||||
- Allow adding files by full path even if a file with the same basename is already in the chat.
|
||||
- Fix quoting of values containing '#' in the sample `aider.conf.yml`.
|
||||
- Add support for Fireworks AI model 'deepseek-v3-0324', by Felix Lisczyk.
|
||||
- Commit messages generated by aider are now lowercase, by Anton Ödman.
|
||||
|
||||
### Aider v0.81.1
|
||||
|
||||
- Added support for the `gemini/gemini-2.5-pro-preview-03-25` model.
|
||||
- Updated the `gemini` alias to point to `gemini/gemini-2.5-pro-preview-03-25`.
|
||||
- Added the `gemini-exp` alias for `gemini/gemini-2.5-pro-exp-03-25`.
|
||||
- Aider wrote 87% of the code in this release.
|
||||
|
||||
### Aider v0.81.0
|
||||
|
||||
@@ -317,7 +494,7 @@
|
||||
- [Aider works with LLM web chat UIs](https://aider.chat/docs/usage/copypaste.html).
|
||||
- New `--copy-paste` mode.
|
||||
- New `/copy-context` command.
|
||||
- [Set API keys and other environment variables for all providers from command line or yaml conf file](https://aider.chat/docs/config/aider_conf.html#storing-llm-keys).
|
||||
- [Set API keys and other environment variables for all providers from command line or YAML conf file](https://aider.chat/docs/config/aider_conf.html#storing-llm-keys).
|
||||
- New `--api-key provider=key` setting.
|
||||
- New `--set-env VAR=value` setting.
|
||||
- Added bash and zsh support to `--watch-files`.
|
||||
@@ -485,7 +662,7 @@
|
||||
|
||||
### Aider v0.59.1
|
||||
|
||||
- Check for obsolete `yes: true` in yaml config, show helpful error.
|
||||
- Check for obsolete `yes: true` in YAML config, show helpful error.
|
||||
- Model settings for openrouter/anthropic/claude-3.5-sonnet:beta
|
||||
|
||||
### Aider v0.59.0
|
||||
@@ -495,7 +672,7 @@
|
||||
- Still auto-completes the full paths of the repo files like `/add`.
|
||||
- Now supports globs like `src/**/*.py`
|
||||
- Renamed `--yes` to `--yes-always`.
|
||||
- Now uses `AIDER_YES_ALWAYS` env var and `yes-always:` yaml key.
|
||||
- Now uses `AIDER_YES_ALWAYS` env var and `yes-always:` YAML key.
|
||||
- Existing YAML and .env files will need to be updated.
|
||||
- Can still abbreviate to `--yes` on the command line.
|
||||
- Config file now uses standard YAML list syntax with ` - list entries`, one per line.
|
||||
@@ -702,7 +879,7 @@
|
||||
- Use `--map-refresh <always|files|manual|auto>` to configure.
|
||||
- Improved cost estimate logic for caching.
|
||||
- Improved editing performance on Jupyter Notebook `.ipynb` files.
|
||||
- Show which config yaml file is loaded with `--verbose`.
|
||||
- Show which config YAML file is loaded with `--verbose`.
|
||||
- Bumped dependency versions.
|
||||
- Bugfix: properly load `.aider.models.metadata.json` data.
|
||||
- Bugfix: Using `--msg /ask ...` caused an exception.
|
||||
|
||||
74
README.md
74
README.md
@@ -27,13 +27,13 @@ cog.out(text)
|
||||
<a href="https://github.com/Aider-AI/aider/stargazers"><img alt="GitHub Stars" title="Total number of GitHub stars the Aider project has received"
|
||||
src="https://img.shields.io/github/stars/Aider-AI/aider?style=flat-square&logo=github&color=f1c40f&labelColor=555555"/></a>
|
||||
<a href="https://pypi.org/project/aider-chat/"><img alt="PyPI Downloads" title="Total number of installations via pip from PyPI"
|
||||
src="https://img.shields.io/badge/📦%20Installs-1.8M-2ecc71?style=flat-square&labelColor=555555"/></a>
|
||||
src="https://img.shields.io/badge/📦%20Installs-3.0M-2ecc71?style=flat-square&labelColor=555555"/></a>
|
||||
<img alt="Tokens per week" title="Number of tokens processed weekly by Aider users"
|
||||
src="https://img.shields.io/badge/📈%20Tokens%2Fweek-15B-3498db?style=flat-square&labelColor=555555"/>
|
||||
<a href="https://openrouter.ai/"><img alt="OpenRouter Ranking" title="Aider's ranking among applications on the OpenRouter platform"
|
||||
<a href="https://openrouter.ai/#options-menu"><img alt="OpenRouter Ranking" title="Aider's ranking among applications on the OpenRouter platform"
|
||||
src="https://img.shields.io/badge/🏆%20OpenRouter-Top%2020-9b59b6?style=flat-square&labelColor=555555"/></a>
|
||||
<a href="https://aider.chat/HISTORY.html"><img alt="Singularity" title="Percentage of the new code in Aider's last release written by Aider itself"
|
||||
src="https://img.shields.io/badge/🔄%20Singularity-86%25-e74c3c?style=flat-square&labelColor=555555"/></a>
|
||||
src="https://img.shields.io/badge/🔄%20Singularity-88%25-e74c3c?style=flat-square&labelColor=555555"/></a>
|
||||
<!--[[[end]]]-->
|
||||
</p>
|
||||
|
||||
@@ -135,38 +135,46 @@ See the [installation instructions](https://aider.chat/docs/install.html) and [u
|
||||
### Community & Resources
|
||||
- [LLM Leaderboards](https://aider.chat/docs/leaderboards/)
|
||||
- [GitHub Repository](https://github.com/Aider-AI/aider)
|
||||
- [Discord Community](https://discord.gg/Tv2uQnR88V)
|
||||
- [Discord Community](https://discord.gg/Y7X7bhMQFV)
|
||||
- [Release notes](https://aider.chat/HISTORY.html)
|
||||
- [Blog](https://aider.chat/blog/)
|
||||
|
||||
## Kind Words From Users
|
||||
|
||||
- *"The best free open source AI coding assistant."* — [IndyDevDan](https://youtu.be/YALpX8oOn78)
|
||||
- *"The best AI coding assistant so far."* — [Matthew Berman](https://www.youtube.com/watch?v=df8afeb1FY8)
|
||||
- *"Aider ... has easily quadrupled my coding productivity."* — [SOLAR_FIELDS](https://news.ycombinator.com/item?id=36212100)
|
||||
- *"It's a cool workflow... Aider's ergonomics are perfect for me."* — [qup](https://news.ycombinator.com/item?id=38185326)
|
||||
- *"It's really like having your senior developer live right in your Git repo - truly amazing!"* — [rappster](https://github.com/Aider-AI/aider/issues/124)
|
||||
- *"What an amazing tool. It's incredible."* — [valyagolev](https://github.com/Aider-AI/aider/issues/6#issue-1722897858)
|
||||
- *"Aider is such an astounding thing!"* — [cgrothaus](https://github.com/Aider-AI/aider/issues/82#issuecomment-1631876700)
|
||||
- *"It was WAY faster than I would be getting off the ground and making the first few working versions."* — [Daniel Feldman](https://twitter.com/d_feldman/status/1662295077387923456)
|
||||
- *"THANK YOU for Aider! It really feels like a glimpse into the future of coding."* — [derwiki](https://news.ycombinator.com/item?id=38205643)
|
||||
- *"It's just amazing. It is freeing me to do things I felt were out my comfort zone before."* — [Dougie](https://discord.com/channels/1131200896827654144/1174002618058678323/1174084556257775656)
|
||||
- *"This project is stellar."* — [funkytaco](https://github.com/Aider-AI/aider/issues/112#issuecomment-1637429008)
|
||||
- *"Amazing project, definitely the best AI coding assistant I've used."* — [joshuavial](https://github.com/Aider-AI/aider/issues/84)
|
||||
- *"I absolutely love using Aider ... It makes software development feel so much lighter as an experience."* — [principalideal0](https://discord.com/channels/1131200896827654144/1133421607499595858/1229689636012691468)
|
||||
- *"I have been recovering from multiple shoulder surgeries ... and have used aider extensively. It has allowed me to continue productivity."* — [codeninja](https://www.reddit.com/r/OpenAI/s/nmNwkHy1zG)
|
||||
- *"I am an aider addict. I'm getting so much more work done, but in less time."* — [dandandan](https://discord.com/channels/1131200896827654144/1131200896827654149/1135913253483069470)
|
||||
- *"After wasting $100 on tokens trying to find something better, I'm back to Aider. It blows everything else out of the water hands down, there's no competition whatsoever."* — [SystemSculpt](https://discord.com/channels/1131200896827654144/1131200896827654149/1178736602797846548)
|
||||
- *"Aider is amazing, coupled with Sonnet 3.5 it's quite mind blowing."* — [Josh Dingus](https://discord.com/channels/1131200896827654144/1133060684540813372/1262374225298198548)
|
||||
- *"Hands down, this is the best AI coding assistant tool so far."* — [IndyDevDan](https://www.youtube.com/watch?v=MPYFPvxfGZs)
|
||||
- *"[Aider] changed my daily coding workflows. It's mind-blowing how a single Python application can change your life."* — [maledorak](https://discord.com/channels/1131200896827654144/1131200896827654149/1258453375620747264)
|
||||
- *"Best agent for actual dev work in existing codebases."* — [Nick Dobos](https://twitter.com/NickADobos/status/1690408967963652097?s=20)
|
||||
- *"One of my favorite pieces of software. Blazing trails on new paradigms!"* — [Chris Wall](https://x.com/chris65536/status/1905053299251798432)
|
||||
- *"Aider has been revolutionary for me and my work."* — [Starry Hope](https://x.com/starryhopeblog/status/1904985812137132056)
|
||||
- *"Try aider! One of the best ways to vibe code."* — [Chris Wall](https://x.com/Chris65536/status/1905053418961391929)
|
||||
- *"Aider is hands down the best. And it's free and opensource."* — [AriyaSavakaLurker](https://www.reddit.com/r/ChatGPTCoding/comments/1ik16y6/whats_your_take_on_aider/mbip39n/)
|
||||
- *"Aider is also my best friend."* — [jzn21](https://www.reddit.com/r/ChatGPTCoding/comments/1heuvuo/aider_vs_cline_vs_windsurf_vs_cursor/m27dcnb/)
|
||||
- *"Try Aider, it's worth it."* — [jorgejhms](https://www.reddit.com/r/ChatGPTCoding/comments/1heuvuo/aider_vs_cline_vs_windsurf_vs_cursor/m27cp99/)
|
||||
- *"I like aider :)"* — [Chenwei Cui](https://x.com/ccui42/status/1904965344999145698)
|
||||
- *"Aider is the precision tool of LLM code gen. It is minimal, thoughtful and capable of surgical changes to your codebase all while keeping the developer in control."* — [Reilly Sweetland](https://x.com/rsweetland/status/1904963807237259586)
|
||||
- *"Cannot believe aider vibe coded a 650 LOC feature across service and cli today in 1 shot."* - [autopoietist](https://discord.com/channels/1131200896827654144/1131200896827654149/1355675042259796101)
|
||||
- *"My life has changed... Aider... It's going to rock your world."* — [Eric S. Raymond on X](https://x.com/esrtweet/status/1910809356381413593)
|
||||
- *"The best free open source AI coding assistant."* — [IndyDevDan on YouTube](https://youtu.be/YALpX8oOn78)
|
||||
- *"The best AI coding assistant so far."* — [Matthew Berman on YouTube](https://www.youtube.com/watch?v=df8afeb1FY8)
|
||||
- *"Aider ... has easily quadrupled my coding productivity."* — [SOLAR_FIELDS on Hacker News](https://news.ycombinator.com/item?id=36212100)
|
||||
- *"It's a cool workflow... Aider's ergonomics are perfect for me."* — [qup on Hacker News](https://news.ycombinator.com/item?id=38185326)
|
||||
- *"It's really like having your senior developer live right in your Git repo - truly amazing!"* — [rappster on GitHub](https://github.com/Aider-AI/aider/issues/124)
|
||||
- *"What an amazing tool. It's incredible."* — [valyagolev on GitHub](https://github.com/Aider-AI/aider/issues/6#issue-1722897858)
|
||||
- *"Aider is such an astounding thing!"* — [cgrothaus on GitHub](https://github.com/Aider-AI/aider/issues/82#issuecomment-1631876700)
|
||||
- *"It was WAY faster than I would be getting off the ground and making the first few working versions."* — [Daniel Feldman on X](https://twitter.com/d_feldman/status/1662295077387923456)
|
||||
- *"THANK YOU for Aider! It really feels like a glimpse into the future of coding."* — [derwiki on Hacker News](https://news.ycombinator.com/item?id=38205643)
|
||||
- *"It's just amazing. It is freeing me to do things I felt were out my comfort zone before."* — [Dougie on Discord](https://discord.com/channels/1131200896827654144/1174002618058678323/1174084556257775656)
|
||||
- *"This project is stellar."* — [funkytaco on GitHub](https://github.com/Aider-AI/aider/issues/112#issuecomment-1637429008)
|
||||
- *"Amazing project, definitely the best AI coding assistant I've used."* — [joshuavial on GitHub](https://github.com/Aider-AI/aider/issues/84)
|
||||
- *"I absolutely love using Aider ... It makes software development feel so much lighter as an experience."* — [principalideal0 on Discord](https://discord.com/channels/1131200896827654144/1133421607499595858/1229689636012691468)
|
||||
- *"I have been recovering from ... surgeries ... aider ... has allowed me to continue productivity."* — [codeninja on Reddit](https://www.reddit.com/r/OpenAI/s/nmNwkHy1zG)
|
||||
- *"I am an aider addict. I'm getting so much more work done, but in less time."* — [dandandan on Discord](https://discord.com/channels/1131200896827654144/1131200896827654149/1135913253483069470)
|
||||
- *"Aider... blows everything else out of the water hands down, there's no competition whatsoever."* — [SystemSculpt on Discord](https://discord.com/channels/1131200896827654144/1131200896827654149/1178736602797846548)
|
||||
- *"Aider is amazing, coupled with Sonnet 3.5 it's quite mind blowing."* — [Josh Dingus on Discord](https://discord.com/channels/1131200896827654144/1133060684540813372/1262374225298198548)
|
||||
- *"Hands down, this is the best AI coding assistant tool so far."* — [IndyDevDan on YouTube](https://www.youtube.com/watch?v=MPYFPvxfGZs)
|
||||
- *"[Aider] changed my daily coding workflows. It's mind-blowing how ...(it)... can change your life."* — [maledorak on Discord](https://discord.com/channels/1131200896827654144/1131200896827654149/1258453375620747264)
|
||||
- *"Best agent for actual dev work in existing codebases."* — [Nick Dobos on X](https://twitter.com/NickADobos/status/1690408967963652097?s=20)
|
||||
- *"One of my favorite pieces of software. Blazing trails on new paradigms!"* — [Chris Wall on X](https://x.com/chris65536/status/1905053299251798432)
|
||||
- *"Aider has been revolutionary for me and my work."* — [Starry Hope on X](https://x.com/starryhopeblog/status/1904985812137132056)
|
||||
- *"Try aider! One of the best ways to vibe code."* — [Chris Wall on X](https://x.com/Chris65536/status/1905053418961391929)
|
||||
- *"Freaking love Aider."* — [hztar on Hacker News](https://news.ycombinator.com/item?id=44035015)
|
||||
- *"Aider is hands down the best. And it's free and opensource."* — [AriyaSavakaLurker on Reddit](https://www.reddit.com/r/ChatGPTCoding/comments/1ik16y6/whats_your_take_on_aider/mbip39n/)
|
||||
- *"Aider is also my best friend."* — [jzn21 on Reddit](https://www.reddit.com/r/ChatGPTCoding/comments/1heuvuo/aider_vs_cline_vs_windsurf_vs_cursor/m27dcnb/)
|
||||
- *"Try Aider, it's worth it."* — [jorgejhms on Reddit](https://www.reddit.com/r/ChatGPTCoding/comments/1heuvuo/aider_vs_cline_vs_windsurf_vs_cursor/m27cp99/)
|
||||
- *"I like aider :)"* — [Chenwei Cui on X](https://x.com/ccui42/status/1904965344999145698)
|
||||
- *"Aider is the precision tool of LLM code gen... Minimal, thoughtful and capable of surgical changes ... while keeping the developer in control."* — [Reilly Sweetland on X](https://x.com/rsweetland/status/1904963807237259586)
|
||||
- *"Cannot believe aider vibe coded a 650 LOC feature across service and cli today in 1 shot."* - [autopoietist on Discord](https://discord.com/channels/1131200896827654144/1131200896827654149/1355675042259796101)
|
||||
- *"Oh no the secret is out! Yes, Aider is the best coding tool around. I highly, highly recommend it to anyone."* — [Joshua D Vander Hook on X](https://x.com/jodavaho/status/1911154899057795218)
|
||||
- *"thanks to aider, i have started and finished three personal projects within the last two days"* — [joseph stalzyn on X](https://x.com/anitaheeder/status/1908338609645904160)
|
||||
- *"Been using aider as my daily driver for over a year ... I absolutely love the tool, like beyond words."* — [koleok on Discord](https://discord.com/channels/1131200896827654144/1273248471394291754/1356727448372252783)
|
||||
- *"Aider ... is the tool to benchmark against."* — [BeetleB on Hacker News](https://news.ycombinator.com/item?id=43930201)
|
||||
- *"aider is really cool"* — [kache on X](https://x.com/yacineMTB/status/1911224442430124387)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from packaging import version
|
||||
|
||||
__version__ = "0.81.2.dev"
|
||||
__version__ = "0.86.2.dev"
|
||||
safe_version = __version__
|
||||
|
||||
try:
|
||||
|
||||
@@ -70,9 +70,17 @@ class Analytics:
|
||||
# ephemeral
|
||||
logfile = None
|
||||
|
||||
def __init__(self, logfile=None, permanently_disable=False):
|
||||
def __init__(
|
||||
self,
|
||||
logfile=None,
|
||||
permanently_disable=False,
|
||||
posthog_host=None,
|
||||
posthog_project_api_key=None,
|
||||
):
|
||||
self.logfile = logfile
|
||||
self.get_or_create_uuid()
|
||||
self.custom_posthog_host = posthog_host
|
||||
self.custom_posthog_project_api_key = posthog_project_api_key
|
||||
|
||||
if self.permanently_disable or permanently_disable or not self.asked_opt_in:
|
||||
self.disable(permanently_disable)
|
||||
@@ -92,8 +100,8 @@ class Analytics:
|
||||
|
||||
# self.mp = Mixpanel(mixpanel_project_token)
|
||||
self.ph = Posthog(
|
||||
project_api_key=posthog_project_api_key,
|
||||
host=posthog_host,
|
||||
project_api_key=self.custom_posthog_project_api_key or posthog_project_api_key,
|
||||
host=self.custom_posthog_host or posthog_host,
|
||||
on_error=self.posthog_error,
|
||||
enable_exception_autocapture=True,
|
||||
super_properties=self.get_system_info(), # Add system info to all events
|
||||
@@ -229,7 +237,7 @@ class Analytics:
|
||||
self.mp = None # Disable mixpanel on connection errors
|
||||
|
||||
if self.ph:
|
||||
self.ph.capture(self.user_id, event_name, dict(properties))
|
||||
self.ph.capture(event_name, distinct_id=self.user_id, properties=dict(properties))
|
||||
|
||||
if self.logfile:
|
||||
log_entry = {
|
||||
|
||||
146
aider/args.py
146
aider/args.py
@@ -6,6 +6,7 @@ import sys
|
||||
from pathlib import Path
|
||||
|
||||
import configargparse
|
||||
import shtab
|
||||
|
||||
from aider import __version__
|
||||
from aider.args_formatter import (
|
||||
@@ -39,10 +40,22 @@ def get_parser(default_config_files, git_root):
|
||||
config_file_parser_class=configargparse.YAMLConfigFileParser,
|
||||
auto_env_var_prefix="AIDER_",
|
||||
)
|
||||
# List of valid edit formats for argparse validation & shtab completion.
|
||||
# Dynamically gather them from the registered coder classes so the list
|
||||
# stays in sync if new formats are added.
|
||||
from aider import coders as _aider_coders
|
||||
|
||||
edit_format_choices = sorted(
|
||||
{
|
||||
c.edit_format
|
||||
for c in _aider_coders.__all__
|
||||
if hasattr(c, "edit_format") and c.edit_format is not None
|
||||
}
|
||||
)
|
||||
group = parser.add_argument_group("Main model")
|
||||
group.add_argument(
|
||||
"files", metavar="FILE", nargs="*", help="files to edit with an LLM (optional)"
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
group.add_argument(
|
||||
"--model",
|
||||
metavar="MODEL",
|
||||
@@ -109,13 +122,13 @@ def get_parser(default_config_files, git_root):
|
||||
metavar="MODEL_SETTINGS_FILE",
|
||||
default=".aider.model.settings.yml",
|
||||
help="Specify a file with aider model settings for unknown models",
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
group.add_argument(
|
||||
"--model-metadata-file",
|
||||
metavar="MODEL_METADATA_FILE",
|
||||
default=".aider.model.metadata.json",
|
||||
help="Specify a file with context window and costs for unknown models",
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
group.add_argument(
|
||||
"--alias",
|
||||
action="append",
|
||||
@@ -130,7 +143,10 @@ def get_parser(default_config_files, git_root):
|
||||
group.add_argument(
|
||||
"--thinking-tokens",
|
||||
type=str,
|
||||
help="Set the thinking token budget for models that support it (default: not set)",
|
||||
help=(
|
||||
"Set the thinking token budget for models that support it. Use 0 to disable. (default:"
|
||||
" not set)"
|
||||
),
|
||||
)
|
||||
group.add_argument(
|
||||
"--verify-ssl",
|
||||
@@ -148,6 +164,7 @@ def get_parser(default_config_files, git_root):
|
||||
"--edit-format",
|
||||
"--chat-mode",
|
||||
metavar="EDIT_FORMAT",
|
||||
choices=edit_format_choices,
|
||||
default=None,
|
||||
help="Specify what edit format the LLM should use (default depends on model)",
|
||||
)
|
||||
@@ -182,6 +199,7 @@ def get_parser(default_config_files, git_root):
|
||||
group.add_argument(
|
||||
"--editor-edit-format",
|
||||
metavar="EDITOR_EDIT_FORMAT",
|
||||
choices=edit_format_choices,
|
||||
default=None,
|
||||
help="Specify the edit format for the editor model (default: depends on editor model)",
|
||||
)
|
||||
@@ -261,13 +279,13 @@ def get_parser(default_config_files, git_root):
|
||||
metavar="INPUT_HISTORY_FILE",
|
||||
default=default_input_history_file,
|
||||
help=f"Specify the chat input history file (default: {default_input_history_file})",
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
group.add_argument(
|
||||
"--chat-history-file",
|
||||
metavar="CHAT_HISTORY_FILE",
|
||||
default=default_chat_history_file,
|
||||
help=f"Specify the chat history file (default: {default_chat_history_file})",
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
group.add_argument(
|
||||
"--restore-chat-history",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
@@ -279,7 +297,7 @@ def get_parser(default_config_files, git_root):
|
||||
metavar="LLM_HISTORY_FILE",
|
||||
default=None,
|
||||
help="Log the conversation with the LLM to this file (for example, .aider.llm.history)",
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
|
||||
##########
|
||||
group = parser.add_argument_group("Output settings")
|
||||
@@ -395,6 +413,12 @@ def get_parser(default_config_files, git_root):
|
||||
default=True,
|
||||
help="Enable/disable adding .aider* to .gitignore (default: True)",
|
||||
)
|
||||
group.add_argument(
|
||||
"--add-gitignore-files",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=False,
|
||||
help="Enable/disable the addition of files listed in .gitignore to Aider's editing scope.",
|
||||
)
|
||||
default_aiderignore_file = (
|
||||
os.path.join(git_root, ".aiderignore") if git_root else ".aiderignore"
|
||||
)
|
||||
@@ -405,7 +429,7 @@ def get_parser(default_config_files, git_root):
|
||||
type=lambda path_str: resolve_aiderignore_path(path_str, git_root),
|
||||
default=default_aiderignore_file,
|
||||
help="Specify the aider ignore file (default: .aiderignore in git root)",
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
group.add_argument(
|
||||
"--subtree-only",
|
||||
action="store_true",
|
||||
@@ -427,14 +451,20 @@ def get_parser(default_config_files, git_root):
|
||||
group.add_argument(
|
||||
"--attribute-author",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=True,
|
||||
help="Attribute aider code changes in the git author name (default: True)",
|
||||
default=None,
|
||||
help=(
|
||||
"Attribute aider code changes in the git author name (default: True). If explicitly set"
|
||||
" to True, overrides --attribute-co-authored-by precedence."
|
||||
),
|
||||
)
|
||||
group.add_argument(
|
||||
"--attribute-committer",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=True,
|
||||
help="Attribute aider commits in the git committer name (default: True)",
|
||||
default=None,
|
||||
help=(
|
||||
"Attribute aider commits in the git committer name (default: True). If explicitly set"
|
||||
" to True, overrides --attribute-co-authored-by precedence for aider edits."
|
||||
),
|
||||
)
|
||||
group.add_argument(
|
||||
"--attribute-commit-message-author",
|
||||
@@ -448,6 +478,16 @@ def get_parser(default_config_files, git_root):
|
||||
default=False,
|
||||
help="Prefix all commit messages with 'aider: ' (default: False)",
|
||||
)
|
||||
group.add_argument(
|
||||
"--attribute-co-authored-by",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=True,
|
||||
help=(
|
||||
"Attribute aider edits using the Co-authored-by trailer in the commit message"
|
||||
" (default: True). If True, this takes precedence over default --attribute-author and"
|
||||
" --attribute-committer behavior unless they are explicitly set to True."
|
||||
),
|
||||
)
|
||||
group.add_argument(
|
||||
"--git-commit-verify",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
@@ -535,13 +575,23 @@ def get_parser(default_config_files, git_root):
|
||||
"--analytics-log",
|
||||
metavar="ANALYTICS_LOG_FILE",
|
||||
help="Specify a file to log analytics events",
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
group.add_argument(
|
||||
"--analytics-disable",
|
||||
action="store_true",
|
||||
help="Permanently disable analytics",
|
||||
default=False,
|
||||
)
|
||||
group.add_argument(
|
||||
"--analytics-posthog-host",
|
||||
metavar="ANALYTICS_POSTHOG_HOST",
|
||||
help="Send analytics to custom PostHog instance",
|
||||
)
|
||||
group.add_argument(
|
||||
"--analytics-posthog-project-api-key",
|
||||
metavar="ANALYTICS_POSTHOG_PROJECT_API_KEY",
|
||||
help="Send analytics to custom PostHog project",
|
||||
)
|
||||
|
||||
#########
|
||||
group = parser.add_argument_group("Upgrading")
|
||||
@@ -602,7 +652,7 @@ def get_parser(default_config_files, git_root):
|
||||
"Specify a file containing the message to send the LLM, process reply, then exit"
|
||||
" (disables chat mode)"
|
||||
),
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
group.add_argument(
|
||||
"--gui",
|
||||
"--browser",
|
||||
@@ -620,7 +670,7 @@ def get_parser(default_config_files, git_root):
|
||||
"--apply",
|
||||
metavar="FILE",
|
||||
help="Apply the changes from the given file instead of running the chat (debug)",
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
group.add_argument(
|
||||
"--apply-clipboard-edits",
|
||||
action="store_true",
|
||||
@@ -670,18 +720,24 @@ def get_parser(default_config_files, git_root):
|
||||
|
||||
######
|
||||
group = parser.add_argument_group("Other settings")
|
||||
group.add_argument(
|
||||
"--disable-playwright",
|
||||
action="store_true",
|
||||
help="Never prompt for or attempt to install Playwright for web scraping (default: False).",
|
||||
default=False,
|
||||
)
|
||||
group.add_argument(
|
||||
"--file",
|
||||
action="append",
|
||||
metavar="FILE",
|
||||
help="specify a file to edit (can be used multiple times)",
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
group.add_argument(
|
||||
"--read",
|
||||
action="append",
|
||||
metavar="FILE",
|
||||
help="specify a read-only file (can be used multiple times)",
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
group.add_argument(
|
||||
"--vim",
|
||||
action="store_true",
|
||||
@@ -694,6 +750,12 @@ def get_parser(default_config_files, git_root):
|
||||
default=None,
|
||||
help="Specify the language to use in the chat (default: None, uses system settings)",
|
||||
)
|
||||
group.add_argument(
|
||||
"--commit-language",
|
||||
metavar="COMMIT_LANGUAGE",
|
||||
default=None,
|
||||
help="Specify the language to use in the commit message (default: None, user language)",
|
||||
)
|
||||
group.add_argument(
|
||||
"--yes-always",
|
||||
action="store_true",
|
||||
@@ -711,7 +773,7 @@ def get_parser(default_config_files, git_root):
|
||||
"--load",
|
||||
metavar="LOAD_FILE",
|
||||
help="Load and execute /commands from a file on launch",
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
group.add_argument(
|
||||
"--encoding",
|
||||
default="utf-8",
|
||||
@@ -732,7 +794,7 @@ def get_parser(default_config_files, git_root):
|
||||
"Specify the config file (default: search for .aider.conf.yml in git root, cwd"
|
||||
" or home directory)"
|
||||
),
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
# This is a duplicate of the argument in the preparser and is a no-op by this time of
|
||||
# argument parsing, but it's here so that the help is displayed as expected.
|
||||
group.add_argument(
|
||||
@@ -740,7 +802,7 @@ def get_parser(default_config_files, git_root):
|
||||
metavar="ENV_FILE",
|
||||
default=default_env_file(git_root),
|
||||
help="Specify the .env file to load (default: .env in git root)",
|
||||
)
|
||||
).complete = shtab.FILE
|
||||
group.add_argument(
|
||||
"--suggest-shell-commands",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
@@ -788,6 +850,17 @@ def get_parser(default_config_files, git_root):
|
||||
help="Specify which editor to use for the /editor command",
|
||||
)
|
||||
|
||||
supported_shells_list = sorted(list(shtab.SUPPORTED_SHELLS))
|
||||
group.add_argument(
|
||||
"--shell-completions",
|
||||
metavar="SHELL",
|
||||
choices=supported_shells_list,
|
||||
help=(
|
||||
"Print shell completion script for the specified SHELL and exit. Supported shells:"
|
||||
f" {', '.join(supported_shells_list)}. Example: aider --shell-completions bash"
|
||||
),
|
||||
)
|
||||
|
||||
##########
|
||||
group = parser.add_argument_group("Deprecated model settings")
|
||||
# Add deprecated model shortcut arguments
|
||||
@@ -836,13 +909,34 @@ def get_sample_dotenv():
|
||||
|
||||
|
||||
def main():
|
||||
arg = sys.argv[1] if len(sys.argv[1:]) else None
|
||||
|
||||
if arg == "md":
|
||||
print(get_md_help())
|
||||
elif arg == "dotenv":
|
||||
print(get_sample_dotenv())
|
||||
if len(sys.argv) > 1:
|
||||
command = sys.argv[1]
|
||||
else:
|
||||
command = "yaml" # Default to yaml if no command is given
|
||||
|
||||
if command == "md":
|
||||
print(get_md_help())
|
||||
elif command == "dotenv":
|
||||
print(get_sample_dotenv())
|
||||
elif command == "yaml":
|
||||
print(get_sample_yaml())
|
||||
elif command == "completion":
|
||||
if len(sys.argv) > 2:
|
||||
shell = sys.argv[2]
|
||||
if shell not in shtab.SUPPORTED_SHELLS:
|
||||
print(f"Error: Unsupported shell '{shell}'.", file=sys.stderr)
|
||||
print(f"Supported shells are: {', '.join(shtab.SUPPORTED_SHELLS)}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
parser = get_parser([], None)
|
||||
parser.prog = "aider" # Set the program name on the parser
|
||||
print(shtab.complete(parser, shell=shell))
|
||||
else:
|
||||
print("Error: Please specify a shell for completion.", file=sys.stderr)
|
||||
print(f"Usage: python {sys.argv[0]} completion <shell_name>", file=sys.stderr)
|
||||
print(f"Supported shells are: {', '.join(shtab.SUPPORTED_SHELLS)}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
else:
|
||||
# Default to YAML for any other unrecognized argument, or if 'yaml' was explicitly passed
|
||||
print(get_sample_yaml())
|
||||
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ class YamlHelpFormatter(argparse.HelpFormatter):
|
||||
# Place in your home dir, or at the root of your git repo.
|
||||
##########################################################
|
||||
|
||||
# Note: You can only put OpenAI and Anthropic API keys in the yaml
|
||||
# Note: You can only put OpenAI and Anthropic API keys in the YAML
|
||||
# config file. Keys for all APIs can be stored in a .env file
|
||||
# https://aider.chat/docs/config/dotenv.html
|
||||
|
||||
@@ -143,7 +143,10 @@ class YamlHelpFormatter(argparse.HelpFormatter):
|
||||
default = "true"
|
||||
|
||||
if default:
|
||||
parts.append(f"#{switch}: {default}\n")
|
||||
if "#" in default:
|
||||
parts.append(f'#{switch}: "{default}"\n')
|
||||
else:
|
||||
parts.append(f"#{switch}: {default}\n")
|
||||
elif action.nargs in ("*", "+") or isinstance(action, argparse._AppendAction):
|
||||
parts.append(f"#{switch}: xxx")
|
||||
parts.append("## Specify multiple values like this:")
|
||||
|
||||
@@ -4,10 +4,13 @@ from .base_coder import Coder
|
||||
from .context_coder import ContextCoder
|
||||
from .editblock_coder import EditBlockCoder
|
||||
from .editblock_fenced_coder import EditBlockFencedCoder
|
||||
from .editor_diff_fenced_coder import EditorDiffFencedCoder
|
||||
from .editor_editblock_coder import EditorEditBlockCoder
|
||||
from .editor_whole_coder import EditorWholeFileCoder
|
||||
from .help_coder import HelpCoder
|
||||
from .patch_coder import PatchCoder
|
||||
from .udiff_coder import UnifiedDiffCoder
|
||||
from .udiff_simple import UnifiedDiffSimpleCoder
|
||||
from .wholefile_coder import WholeFileCoder
|
||||
|
||||
# from .single_wholefile_func_coder import SingleWholeFileFunctionCoder
|
||||
@@ -19,10 +22,13 @@ __all__ = [
|
||||
EditBlockCoder,
|
||||
EditBlockFencedCoder,
|
||||
WholeFileCoder,
|
||||
PatchCoder,
|
||||
UnifiedDiffCoder,
|
||||
UnifiedDiffSimpleCoder,
|
||||
# SingleWholeFileFunctionCoder,
|
||||
ArchitectCoder,
|
||||
EditorEditBlockCoder,
|
||||
EditorWholeFileCoder,
|
||||
EditorDiffFencedCoder,
|
||||
ContextCoder,
|
||||
]
|
||||
|
||||
@@ -8,7 +8,7 @@ class AskPrompts(CoderPrompts):
|
||||
Answer questions about the supplied code.
|
||||
Always reply to the user in {language}.
|
||||
|
||||
Describe code changes however you like. Don't use SEARCH/REPLACE blocks!
|
||||
If you need to describe code changes, do so *briefly*.
|
||||
"""
|
||||
|
||||
example_messages = []
|
||||
@@ -32,4 +32,4 @@ Here are summaries of some files present in my git repo.
|
||||
If you need to see the full contents of any files to answer my questions, ask me to *add them to the chat*.
|
||||
"""
|
||||
|
||||
system_reminder = ""
|
||||
system_reminder = "{final_reminders}"
|
||||
|
||||
@@ -15,10 +15,19 @@ import time
|
||||
import traceback
|
||||
from collections import defaultdict
|
||||
from datetime import datetime
|
||||
|
||||
# Optional dependency: used to convert locale codes (eg ``en_US``)
|
||||
# into human-readable language names (eg ``English``).
|
||||
try:
|
||||
from babel import Locale # type: ignore
|
||||
except ImportError: # Babel not installed – we will fall back to a small mapping
|
||||
Locale = None
|
||||
from json.decoder import JSONDecodeError
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
|
||||
from rich.console import Console
|
||||
|
||||
from aider import __version__, models, prompts, urls, utils
|
||||
from aider.analytics import Analytics
|
||||
from aider.commands import Commands
|
||||
@@ -38,6 +47,7 @@ from aider.repo import ANY_GIT_ERROR, GitRepo
|
||||
from aider.repomap import RepoMap
|
||||
from aider.run_cmd import run_cmd
|
||||
from aider.utils import format_content, format_messages, format_tokens, is_image_file
|
||||
from aider.waiting import WaitingSpinner
|
||||
|
||||
from ..dump import dump # noqa: F401
|
||||
from .chat_chunks import ChatChunks
|
||||
@@ -101,8 +111,6 @@ class Coder:
|
||||
partial_response_content = ""
|
||||
commit_before_message = []
|
||||
message_cost = 0.0
|
||||
message_tokens_sent = 0
|
||||
message_tokens_received = 0
|
||||
add_cache_headers = False
|
||||
cache_warming_thread = None
|
||||
num_cache_warming_pings = 0
|
||||
@@ -110,6 +118,7 @@ class Coder:
|
||||
detect_urls = True
|
||||
ignore_mentions = None
|
||||
chat_language = None
|
||||
commit_language = None
|
||||
file_watcher = None
|
||||
|
||||
@classmethod
|
||||
@@ -168,6 +177,8 @@ class Coder:
|
||||
commands=from_coder.commands.clone(),
|
||||
total_cost=from_coder.total_cost,
|
||||
ignore_mentions=from_coder.ignore_mentions,
|
||||
total_tokens_sent=from_coder.total_tokens_sent,
|
||||
total_tokens_received=from_coder.total_tokens_received,
|
||||
file_watcher=from_coder.file_watcher,
|
||||
)
|
||||
use_kwargs.update(update) # override to complete the switch
|
||||
@@ -291,6 +302,7 @@ class Coder:
|
||||
io,
|
||||
repo=None,
|
||||
fnames=None,
|
||||
add_gitignore_files=False,
|
||||
read_only_fnames=None,
|
||||
show_diffs=False,
|
||||
auto_commits=True,
|
||||
@@ -318,8 +330,11 @@ class Coder:
|
||||
num_cache_warming_pings=0,
|
||||
suggest_shell_commands=True,
|
||||
chat_language=None,
|
||||
commit_language=None,
|
||||
detect_urls=True,
|
||||
ignore_mentions=None,
|
||||
total_tokens_sent=0,
|
||||
total_tokens_received=0,
|
||||
file_watcher=None,
|
||||
auto_copy_context=False,
|
||||
auto_accept_architect=True,
|
||||
@@ -329,6 +344,7 @@ class Coder:
|
||||
|
||||
self.event = self.analytics.event
|
||||
self.chat_language = chat_language
|
||||
self.commit_language = commit_language
|
||||
self.commit_before_message = []
|
||||
self.aider_commit_hashes = set()
|
||||
self.rejected_urls = set()
|
||||
@@ -366,10 +382,15 @@ class Coder:
|
||||
self.need_commit_before_edits = set()
|
||||
|
||||
self.total_cost = total_cost
|
||||
self.total_tokens_sent = total_tokens_sent
|
||||
self.total_tokens_received = total_tokens_received
|
||||
self.message_tokens_sent = 0
|
||||
self.message_tokens_received = 0
|
||||
|
||||
self.verbose = verbose
|
||||
self.abs_fnames = set()
|
||||
self.abs_read_only_fnames = set()
|
||||
self.add_gitignore_files = add_gitignore_files
|
||||
|
||||
if cur_messages:
|
||||
self.cur_messages = cur_messages
|
||||
@@ -427,8 +448,9 @@ class Coder:
|
||||
|
||||
for fname in fnames:
|
||||
fname = Path(fname)
|
||||
if self.repo and self.repo.git_ignored_file(fname):
|
||||
if self.repo and self.repo.git_ignored_file(fname) and not self.add_gitignore_files:
|
||||
self.io.tool_warning(f"Skipping {fname} that matches gitignore spec.")
|
||||
continue
|
||||
|
||||
if self.repo and self.repo.ignored_file(fname):
|
||||
self.io.tool_warning(f"Skipping {fname} that matches aiderignore spec.")
|
||||
@@ -564,6 +586,15 @@ class Coder:
|
||||
|
||||
return True
|
||||
|
||||
def _stop_waiting_spinner(self):
|
||||
"""Stop and clear the waiting spinner if it is running."""
|
||||
spinner = getattr(self, "waiting_spinner", None)
|
||||
if spinner:
|
||||
try:
|
||||
spinner.stop()
|
||||
finally:
|
||||
self.waiting_spinner = None
|
||||
|
||||
def get_abs_fnames_content(self):
|
||||
for fname in list(self.abs_fnames):
|
||||
content = self.io.read_text(fname)
|
||||
@@ -926,7 +957,7 @@ class Coder:
|
||||
url_pattern = re.compile(r'(https?://[^\s/$.?#].[^\s"]*)')
|
||||
urls = list(set(url_pattern.findall(text))) # Use set to remove duplicates
|
||||
for url in urls:
|
||||
url = url.rstrip(".',\"")
|
||||
url = url.rstrip(".',\"}") # Added } to the characters to strip
|
||||
self.io.offer_url(url)
|
||||
return urls
|
||||
|
||||
@@ -953,6 +984,9 @@ class Coder:
|
||||
return inp
|
||||
|
||||
def keyboard_interrupt(self):
|
||||
# Ensure cursor is visible on exit
|
||||
Console().show_cursor(True)
|
||||
|
||||
now = time.time()
|
||||
|
||||
thresh = 2 # seconds
|
||||
@@ -1011,23 +1045,82 @@ class Coder:
|
||||
]
|
||||
self.cur_messages = []
|
||||
|
||||
def get_user_language(self):
|
||||
if self.chat_language:
|
||||
return self.chat_language
|
||||
def normalize_language(self, lang_code):
|
||||
"""
|
||||
Convert a locale code such as ``en_US`` or ``fr`` into a readable
|
||||
language name (e.g. ``English`` or ``French``). If Babel is
|
||||
available it is used for reliable conversion; otherwise a small
|
||||
built-in fallback map handles common languages.
|
||||
"""
|
||||
if not lang_code:
|
||||
return None
|
||||
|
||||
if lang_code.upper() in ("C", "POSIX"):
|
||||
return None
|
||||
|
||||
# Probably already a language name
|
||||
if (
|
||||
len(lang_code) > 3
|
||||
and "_" not in lang_code
|
||||
and "-" not in lang_code
|
||||
and lang_code[0].isupper()
|
||||
):
|
||||
return lang_code
|
||||
|
||||
# Preferred: Babel
|
||||
if Locale is not None:
|
||||
try:
|
||||
loc = Locale.parse(lang_code.replace("-", "_"))
|
||||
return loc.get_display_name("en").capitalize()
|
||||
except Exception:
|
||||
pass # Fall back to manual mapping
|
||||
|
||||
# Simple fallback for common languages
|
||||
fallback = {
|
||||
"en": "English",
|
||||
"fr": "French",
|
||||
"es": "Spanish",
|
||||
"de": "German",
|
||||
"it": "Italian",
|
||||
"pt": "Portuguese",
|
||||
"zh": "Chinese",
|
||||
"ja": "Japanese",
|
||||
"ko": "Korean",
|
||||
"ru": "Russian",
|
||||
}
|
||||
primary_lang_code = lang_code.replace("-", "_").split("_")[0].lower()
|
||||
return fallback.get(primary_lang_code, lang_code)
|
||||
|
||||
def get_user_language(self):
|
||||
"""
|
||||
Detect the user's language preference and return a human-readable
|
||||
language name such as ``English``. Detection order:
|
||||
|
||||
1. ``self.chat_language`` if explicitly set
|
||||
2. ``locale.getlocale()``
|
||||
3. ``LANG`` / ``LANGUAGE`` / ``LC_ALL`` / ``LC_MESSAGES`` environment variables
|
||||
"""
|
||||
|
||||
# Explicit override
|
||||
if self.chat_language:
|
||||
return self.normalize_language(self.chat_language)
|
||||
|
||||
# System locale
|
||||
try:
|
||||
lang = locale.getlocale()[0]
|
||||
if lang:
|
||||
return lang # Return the full language code, including country
|
||||
lang = self.normalize_language(lang)
|
||||
if lang:
|
||||
return lang
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
for env_var in ["LANG", "LANGUAGE", "LC_ALL", "LC_MESSAGES"]:
|
||||
# Environment variables
|
||||
for env_var in ("LANG", "LANGUAGE", "LC_ALL", "LC_MESSAGES"):
|
||||
lang = os.environ.get(env_var)
|
||||
if lang:
|
||||
return lang.split(".")[
|
||||
0
|
||||
] # Return language and country, but remove encoding if present
|
||||
lang = lang.split(".")[0] # Strip encoding if present
|
||||
return self.normalize_language(lang)
|
||||
|
||||
return None
|
||||
|
||||
@@ -1079,28 +1172,33 @@ class Coder:
|
||||
return platform_text
|
||||
|
||||
def fmt_system_prompt(self, prompt):
|
||||
final_reminders = []
|
||||
if self.main_model.lazy:
|
||||
lazy_prompt = self.gpt_prompts.lazy_prompt
|
||||
elif self.main_model.overeager:
|
||||
lazy_prompt = self.gpt_prompts.overeager_prompt
|
||||
else:
|
||||
lazy_prompt = ""
|
||||
final_reminders.append(self.gpt_prompts.lazy_prompt)
|
||||
if self.main_model.overeager:
|
||||
final_reminders.append(self.gpt_prompts.overeager_prompt)
|
||||
|
||||
user_lang = self.get_user_language()
|
||||
if user_lang:
|
||||
final_reminders.append(f"Reply in {user_lang}.\n")
|
||||
|
||||
platform_text = self.get_platform_info()
|
||||
|
||||
if self.suggest_shell_commands:
|
||||
shell_cmd_prompt = self.gpt_prompts.shell_cmd_prompt.format(platform=platform_text)
|
||||
shell_cmd_reminder = self.gpt_prompts.shell_cmd_reminder.format(platform=platform_text)
|
||||
rename_with_shell = self.gpt_prompts.rename_with_shell
|
||||
else:
|
||||
shell_cmd_prompt = self.gpt_prompts.no_shell_cmd_prompt.format(platform=platform_text)
|
||||
shell_cmd_reminder = self.gpt_prompts.no_shell_cmd_reminder.format(
|
||||
platform=platform_text
|
||||
)
|
||||
rename_with_shell = ""
|
||||
|
||||
if self.chat_language:
|
||||
language = self.chat_language
|
||||
if user_lang: # user_lang is the result of self.get_user_language()
|
||||
language = user_lang
|
||||
else:
|
||||
language = "the same language they are using"
|
||||
language = "the same language they are using" # Default if no specific lang detected
|
||||
|
||||
if self.fence[0] == "`" * 4:
|
||||
quad_backtick_reminder = (
|
||||
@@ -1109,24 +1207,27 @@ class Coder:
|
||||
else:
|
||||
quad_backtick_reminder = ""
|
||||
|
||||
final_reminders = "\n\n".join(final_reminders)
|
||||
|
||||
prompt = prompt.format(
|
||||
fence=self.fence,
|
||||
quad_backtick_reminder=quad_backtick_reminder,
|
||||
lazy_prompt=lazy_prompt,
|
||||
final_reminders=final_reminders,
|
||||
platform=platform_text,
|
||||
shell_cmd_prompt=shell_cmd_prompt,
|
||||
rename_with_shell=rename_with_shell,
|
||||
shell_cmd_reminder=shell_cmd_reminder,
|
||||
go_ahead_tip=self.gpt_prompts.go_ahead_tip,
|
||||
language=language,
|
||||
)
|
||||
|
||||
if self.main_model.system_prompt_prefix:
|
||||
prompt = self.main_model.system_prompt_prefix + prompt
|
||||
|
||||
return prompt
|
||||
|
||||
def format_chat_chunks(self):
|
||||
self.choose_fence()
|
||||
main_sys = self.fmt_system_prompt(self.gpt_prompts.main_system)
|
||||
if self.main_model.system_prompt_prefix:
|
||||
main_sys = self.main_model.system_prompt_prefix + "\n" + main_sys
|
||||
|
||||
example_messages = []
|
||||
if self.main_model.examples_as_sys_msg:
|
||||
@@ -1335,8 +1436,13 @@ class Coder:
|
||||
utils.show_messages(messages, functions=self.functions)
|
||||
|
||||
self.multi_response_content = ""
|
||||
if self.show_pretty() and self.stream:
|
||||
self.mdstream = self.io.get_assistant_mdstream()
|
||||
if self.show_pretty():
|
||||
self.waiting_spinner = WaitingSpinner("Waiting for " + self.main_model.name)
|
||||
self.waiting_spinner.start()
|
||||
if self.stream:
|
||||
self.mdstream = self.io.get_assistant_mdstream()
|
||||
else:
|
||||
self.mdstream = None
|
||||
else:
|
||||
self.mdstream = None
|
||||
|
||||
@@ -1409,6 +1515,9 @@ class Coder:
|
||||
self.live_incremental_response(True)
|
||||
self.mdstream = None
|
||||
|
||||
# Ensure any waiting spinner is stopped
|
||||
self._stop_waiting_spinner()
|
||||
|
||||
self.partial_response_content = self.get_multi_response_content_in_progress(True)
|
||||
self.remove_reasoning_content()
|
||||
self.multi_response_content = ""
|
||||
@@ -1626,10 +1735,6 @@ class Coder:
|
||||
mentioned_rel_fnames = set()
|
||||
fname_to_rel_fnames = {}
|
||||
for rel_fname in addable_rel_fnames:
|
||||
# Skip files that share a basename with files already in chat
|
||||
if os.path.basename(rel_fname) in existing_basenames:
|
||||
continue
|
||||
|
||||
normalized_rel_fname = rel_fname.replace("\\", "/")
|
||||
normalized_words = set(word.replace("\\", "/") for word in words)
|
||||
if normalized_rel_fname in normalized_words:
|
||||
@@ -1644,6 +1749,10 @@ class Coder:
|
||||
fname_to_rel_fnames[fname].append(rel_fname)
|
||||
|
||||
for fname, rel_fnames in fname_to_rel_fnames.items():
|
||||
# If the basename is already in chat, don't add based on a basename mention
|
||||
if fname in existing_basenames:
|
||||
continue
|
||||
# If the basename mention is unique among addable files and present in the text
|
||||
if len(rel_fnames) == 1 and fname in words:
|
||||
mentioned_rel_fnames.add(rel_fnames[0])
|
||||
|
||||
@@ -1725,6 +1834,9 @@ class Coder:
|
||||
self.io.ai_output(json.dumps(args, indent=4))
|
||||
|
||||
def show_send_output(self, completion):
|
||||
# Stop spinner once we have a response
|
||||
self._stop_waiting_spinner()
|
||||
|
||||
if self.verbose:
|
||||
print(completion)
|
||||
|
||||
@@ -1839,6 +1951,8 @@ class Coder:
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
if received_content:
|
||||
self._stop_waiting_spinner()
|
||||
self.partial_response_content += text
|
||||
|
||||
if self.show_pretty():
|
||||
@@ -1918,6 +2032,44 @@ class Coder:
|
||||
self.usage_report = tokens_report
|
||||
return
|
||||
|
||||
try:
|
||||
# Try and use litellm's built in cost calculator. Seems to work for non-streaming only?
|
||||
cost = litellm.completion_cost(completion_response=completion)
|
||||
except Exception:
|
||||
cost = 0
|
||||
|
||||
if not cost:
|
||||
cost = self.compute_costs_from_tokens(
|
||||
prompt_tokens, completion_tokens, cache_write_tokens, cache_hit_tokens
|
||||
)
|
||||
|
||||
self.total_cost += cost
|
||||
self.message_cost += cost
|
||||
|
||||
def format_cost(value):
|
||||
if value == 0:
|
||||
return "0.00"
|
||||
magnitude = abs(value)
|
||||
if magnitude >= 0.01:
|
||||
return f"{value:.2f}"
|
||||
else:
|
||||
return f"{value:.{max(2, 2 - int(math.log10(magnitude)))}f}"
|
||||
|
||||
cost_report = (
|
||||
f"Cost: ${format_cost(self.message_cost)} message,"
|
||||
f" ${format_cost(self.total_cost)} session."
|
||||
)
|
||||
|
||||
if cache_hit_tokens and cache_write_tokens:
|
||||
sep = "\n"
|
||||
else:
|
||||
sep = " "
|
||||
|
||||
self.usage_report = tokens_report + sep + cost_report
|
||||
|
||||
def compute_costs_from_tokens(
|
||||
self, prompt_tokens, completion_tokens, cache_write_tokens, cache_hit_tokens
|
||||
):
|
||||
cost = 0
|
||||
|
||||
input_cost_per_token = self.main_model.info.get("input_cost_per_token") or 0
|
||||
@@ -1945,35 +2097,15 @@ class Coder:
|
||||
cost += prompt_tokens * input_cost_per_token
|
||||
|
||||
cost += completion_tokens * output_cost_per_token
|
||||
|
||||
self.total_cost += cost
|
||||
self.message_cost += cost
|
||||
|
||||
def format_cost(value):
|
||||
if value == 0:
|
||||
return "0.00"
|
||||
magnitude = abs(value)
|
||||
if magnitude >= 0.01:
|
||||
return f"{value:.2f}"
|
||||
else:
|
||||
return f"{value:.{max(2, 2 - int(math.log10(magnitude)))}f}"
|
||||
|
||||
cost_report = (
|
||||
f"Cost: ${format_cost(self.message_cost)} message,"
|
||||
f" ${format_cost(self.total_cost)} session."
|
||||
)
|
||||
|
||||
if cache_hit_tokens and cache_write_tokens:
|
||||
sep = "\n"
|
||||
else:
|
||||
sep = " "
|
||||
|
||||
self.usage_report = tokens_report + sep + cost_report
|
||||
return cost
|
||||
|
||||
def show_usage_report(self):
|
||||
if not self.usage_report:
|
||||
return
|
||||
|
||||
self.total_tokens_sent += self.message_tokens_sent
|
||||
self.total_tokens_received += self.message_tokens_received
|
||||
|
||||
self.io.tool_output(self.usage_report)
|
||||
|
||||
prompt_tokens = self.message_tokens_sent
|
||||
@@ -2248,7 +2380,7 @@ class Coder:
|
||||
context = self.get_context_from_history(self.cur_messages)
|
||||
|
||||
try:
|
||||
res = self.repo.commit(fnames=edited, context=context, aider_edits=True)
|
||||
res = self.repo.commit(fnames=edited, context=context, aider_edits=True, coder=self)
|
||||
if res:
|
||||
self.show_auto_commit_outcome(res)
|
||||
commit_hash, commit_message = res
|
||||
@@ -2284,7 +2416,7 @@ class Coder:
|
||||
if not self.repo:
|
||||
return
|
||||
|
||||
self.repo.commit(fnames=self.need_commit_before_edits)
|
||||
self.repo.commit(fnames=self.need_commit_before_edits, coder=self)
|
||||
|
||||
# files changed, move cur messages back behind the files messages
|
||||
# self.move_back_cur_messages(self.gpt_prompts.files_content_local_edits)
|
||||
|
||||
@@ -15,7 +15,9 @@ You always COMPLETELY IMPLEMENT the needed code!
|
||||
"""
|
||||
|
||||
overeager_prompt = """Pay careful attention to the scope of the user's request.
|
||||
Do what they ask, but no more."""
|
||||
Do what they ask, but no more.
|
||||
Do not improve, comment, fix or modify unrelated parts of the code in any way!
|
||||
"""
|
||||
|
||||
example_messages = []
|
||||
|
||||
@@ -53,3 +55,6 @@ Do not edit these files!
|
||||
shell_cmd_reminder = ""
|
||||
no_shell_cmd_prompt = ""
|
||||
no_shell_cmd_reminder = ""
|
||||
|
||||
rename_with_shell = ""
|
||||
go_ahead_tip = ""
|
||||
|
||||
@@ -383,7 +383,7 @@ def do_replace(fname, content, before_text, after_text, fence=None):
|
||||
return new_content
|
||||
|
||||
|
||||
HEAD = r"^<{5,9} SEARCH\s*$"
|
||||
HEAD = r"^<{5,9} SEARCH>?\s*$"
|
||||
DIVIDER = r"^={5,9}\s*$"
|
||||
UPDATED = r"^>{5,9} REPLACE\s*$"
|
||||
|
||||
@@ -412,7 +412,16 @@ def strip_filename(filename, fence):
|
||||
return
|
||||
|
||||
start_fence = fence[0]
|
||||
if filename.startswith(start_fence) or filename.startswith(triple_backticks):
|
||||
if filename.startswith(start_fence):
|
||||
candidate = filename[len(start_fence) :]
|
||||
if candidate and ("." in candidate or "/" in candidate):
|
||||
return candidate
|
||||
return
|
||||
|
||||
if filename.startswith(triple_backticks):
|
||||
candidate = filename[len(triple_backticks) :]
|
||||
if candidate and ("." in candidate or "/" in candidate):
|
||||
return candidate
|
||||
return
|
||||
|
||||
filename = filename.rstrip(":")
|
||||
@@ -454,7 +463,14 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE, valid_fnames=None)
|
||||
"```csh",
|
||||
"```tcsh",
|
||||
]
|
||||
next_is_editblock = i + 1 < len(lines) and head_pattern.match(lines[i + 1].strip())
|
||||
|
||||
# Check if the next line or the one after that is an editblock
|
||||
next_is_editblock = (
|
||||
i + 1 < len(lines)
|
||||
and head_pattern.match(lines[i + 1].strip())
|
||||
or i + 2 < len(lines)
|
||||
and head_pattern.match(lines[i + 2].strip())
|
||||
)
|
||||
|
||||
if any(line.strip().startswith(start) for start in shell_starts) and not next_is_editblock:
|
||||
shell_content = []
|
||||
|
||||
@@ -5,5 +5,6 @@ from .editblock_fenced_prompts import EditBlockFencedPrompts
|
||||
|
||||
class EditBlockFencedCoder(EditBlockCoder):
|
||||
"""A coder that uses fenced search/replace blocks for code modifications."""
|
||||
|
||||
edit_format = "diff-fenced"
|
||||
gpt_prompts = EditBlockFencedPrompts()
|
||||
|
||||
@@ -19,7 +19,7 @@ class EditBlockFencedPrompts(EditBlockPrompts):
|
||||
|
||||
Here are the *SEARCH/REPLACE* blocks:
|
||||
|
||||
{fence[0]}
|
||||
{fence[0]}python
|
||||
mathweb/flask/app.py
|
||||
<<<<<<< SEARCH
|
||||
from flask import Flask
|
||||
@@ -29,7 +29,7 @@ from flask import Flask
|
||||
>>>>>>> REPLACE
|
||||
{fence[1]}
|
||||
|
||||
{fence[0]}
|
||||
{fence[0]}python
|
||||
mathweb/flask/app.py
|
||||
<<<<<<< SEARCH
|
||||
def factorial(n):
|
||||
@@ -44,7 +44,7 @@ def factorial(n):
|
||||
>>>>>>> REPLACE
|
||||
{fence[1]}
|
||||
|
||||
{fence[0]}
|
||||
{fence[0]}python
|
||||
mathweb/flask/app.py
|
||||
<<<<<<< SEARCH
|
||||
return str(factorial(n))
|
||||
@@ -68,7 +68,7 @@ mathweb/flask/app.py
|
||||
|
||||
Here are the *SEARCH/REPLACE* blocks:
|
||||
|
||||
{fence[0]}
|
||||
{fence[0]}python
|
||||
hello.py
|
||||
<<<<<<< SEARCH
|
||||
=======
|
||||
@@ -79,7 +79,7 @@ def hello():
|
||||
>>>>>>> REPLACE
|
||||
{fence[1]}
|
||||
|
||||
{fence[0]}
|
||||
{fence[0]}python
|
||||
main.py
|
||||
<<<<<<< SEARCH
|
||||
def hello():
|
||||
@@ -93,3 +93,51 @@ from hello import hello
|
||||
""",
|
||||
),
|
||||
]
|
||||
|
||||
system_reminder = """
|
||||
# *SEARCH/REPLACE block* Rules:
|
||||
|
||||
Every *SEARCH/REPLACE block* must use this format:
|
||||
1. The opening fence and code language, eg: {fence[0]}python
|
||||
2. The *FULL* file path alone on a line, verbatim. No bold asterisks, no quotes around it, no escaping of characters, etc.
|
||||
3. The start of search block: <<<<<<< SEARCH
|
||||
4. A contiguous chunk of lines to search for in the existing source code
|
||||
5. The dividing line: =======
|
||||
6. The lines to replace into the source code
|
||||
7. The end of the replace block: >>>>>>> REPLACE
|
||||
8. The closing fence: {fence[1]}
|
||||
|
||||
Use the *FULL* file path, as shown to you by the user.
|
||||
{quad_backtick_reminder}
|
||||
Every *SEARCH* section must *EXACTLY MATCH* the existing file content, character for character, including all comments, docstrings, etc.
|
||||
If the file contains code or other data wrapped/escaped in json/xml/quotes or other containers, you need to propose edits to the literal contents of the file, including the container markup.
|
||||
|
||||
*SEARCH/REPLACE* blocks will *only* replace the first match occurrence.
|
||||
Including multiple unique *SEARCH/REPLACE* blocks if needed.
|
||||
Include enough lines in each SEARCH section to uniquely match each set of lines that need to change.
|
||||
|
||||
Keep *SEARCH/REPLACE* blocks concise.
|
||||
Break large *SEARCH/REPLACE* blocks into a series of smaller blocks that each change a small portion of the file.
|
||||
Include just the changing lines, and a few surrounding lines if needed for uniqueness.
|
||||
Do not include long runs of unchanging lines in *SEARCH/REPLACE* blocks.
|
||||
|
||||
Only create *SEARCH/REPLACE* blocks for files that the user has added to the chat!
|
||||
|
||||
To move code within a file, use 2 *SEARCH/REPLACE* blocks: 1 to delete it from its current location, 1 to insert it in the new location.
|
||||
|
||||
Pay attention to which filenames the user wants you to edit, especially if they are asking you to create a new file.
|
||||
|
||||
If you want to put code in a new file, use a *SEARCH/REPLACE block* with:
|
||||
- A new file path, including dir name if needed
|
||||
- An empty `SEARCH` section
|
||||
- The new file's contents in the `REPLACE` section
|
||||
|
||||
To rename files which have been added to the chat, use shell commands at the end of your response.
|
||||
|
||||
If the user just says something like "ok" or "go ahead" or "do that" they probably want you to make SEARCH/REPLACE blocks for the code changes you just proposed.
|
||||
The user will say when they've applied your edits. If they haven't explicitly confirmed the edits have been applied, they probably want proper SEARCH/REPLACE blocks.
|
||||
|
||||
{final_reminders}
|
||||
ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
|
||||
{shell_cmd_reminder}
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# flake8: noqa: E501
|
||||
|
||||
from . import shell
|
||||
from .base_prompts import CoderPrompts
|
||||
|
||||
|
||||
@@ -7,7 +8,7 @@ class EditBlockPrompts(CoderPrompts):
|
||||
main_system = """Act as an expert software developer.
|
||||
Always use best practices when coding.
|
||||
Respect and use existing conventions, libraries, etc that are already present in the code base.
|
||||
{lazy_prompt}
|
||||
{final_reminders}
|
||||
Take requests for changes to the supplied code.
|
||||
If the request is ambiguous, ask questions.
|
||||
|
||||
@@ -28,32 +29,6 @@ You can keep asking if you then decide you need to edit more files.
|
||||
All changes to files must use this *SEARCH/REPLACE block* format.
|
||||
ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
|
||||
{shell_cmd_prompt}
|
||||
"""
|
||||
|
||||
shell_cmd_prompt = """
|
||||
4. *Concisely* suggest any shell commands the user might want to run in ```bash blocks.
|
||||
|
||||
Just suggest shell commands this way, not example code.
|
||||
Only suggest complete shell commands that are ready to execute, without placeholders.
|
||||
Only suggest at most a few shell commands at a time, not more than 1-3, one per line.
|
||||
Do not suggest multi-line shell commands.
|
||||
All shell commands will run from the root directory of the user's project.
|
||||
|
||||
Use the appropriate shell based on the user's system info:
|
||||
{platform}
|
||||
Examples of when to suggest shell commands:
|
||||
|
||||
- If you changed a self-contained html file, suggest an OS-appropriate command to open a browser to view it to see the updated content.
|
||||
- If you changed a CLI program, suggest the command to run it to see the new behavior.
|
||||
- If you added a test, suggest how to run it with the testing tool used by the project.
|
||||
- Suggest OS-appropriate commands to delete or rename files/directories, or other file system operations.
|
||||
- If your code changes add new dependencies, suggest the command to install them.
|
||||
- Etc.
|
||||
"""
|
||||
|
||||
no_shell_cmd_prompt = """
|
||||
Keep in mind these details about the user's platform and environment:
|
||||
{platform}
|
||||
"""
|
||||
example_messages = [
|
||||
dict(
|
||||
@@ -181,23 +156,19 @@ If you want to put code in a new file, use a *SEARCH/REPLACE block* with:
|
||||
- An empty `SEARCH` section
|
||||
- The new file's contents in the `REPLACE` section
|
||||
|
||||
To rename files which have been added to the chat, use shell commands at the end of your response.
|
||||
|
||||
If the user just says something like "ok" or "go ahead" or "do that" they probably want you to make SEARCH/REPLACE blocks for the code changes you just proposed.
|
||||
The user will say when they've applied your edits. If they haven't explicitly confirmed the edits have been applied, they probably want proper SEARCH/REPLACE blocks.
|
||||
|
||||
{lazy_prompt}
|
||||
ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
|
||||
{rename_with_shell}{go_ahead_tip}{final_reminders}ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
|
||||
{shell_cmd_reminder}
|
||||
"""
|
||||
|
||||
shell_cmd_reminder = """
|
||||
Examples of when to suggest shell commands:
|
||||
rename_with_shell = """To rename files which have been added to the chat, use shell commands at the end of your response.
|
||||
|
||||
- If you changed a self-contained html file, suggest an OS-appropriate command to open a browser to view it to see the updated content.
|
||||
- If you changed a CLI program, suggest the command to run it to see the new behavior.
|
||||
- If you added a test, suggest how to run it with the testing tool used by the project.
|
||||
- Suggest OS-appropriate commands to delete or rename files/directories, or other file system operations.
|
||||
- If your code changes add new dependencies, suggest the command to install them.
|
||||
- Etc.
|
||||
"""
|
||||
|
||||
go_ahead_tip = """If the user just says something like "ok" or "go ahead" or "do that" they probably want you to make SEARCH/REPLACE blocks for the code changes you just proposed.
|
||||
The user will say when they've applied your edits. If they haven't explicitly confirmed the edits have been applied, they probably want proper SEARCH/REPLACE blocks.
|
||||
|
||||
"""
|
||||
|
||||
shell_cmd_prompt = shell.shell_cmd_prompt
|
||||
no_shell_cmd_prompt = shell.no_shell_cmd_prompt
|
||||
shell_cmd_reminder = shell.shell_cmd_reminder
|
||||
|
||||
9
aider/coders/editor_diff_fenced_coder.py
Normal file
9
aider/coders/editor_diff_fenced_coder.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from .editblock_fenced_coder import EditBlockFencedCoder
|
||||
from .editor_diff_fenced_prompts import EditorDiffFencedPrompts
|
||||
|
||||
|
||||
class EditorDiffFencedCoder(EditBlockFencedCoder):
|
||||
"A coder that uses search/replace blocks, focused purely on editing files."
|
||||
|
||||
edit_format = "editor-diff-fenced"
|
||||
gpt_prompts = EditorDiffFencedPrompts()
|
||||
11
aider/coders/editor_diff_fenced_prompts.py
Normal file
11
aider/coders/editor_diff_fenced_prompts.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# flake8: noqa: E501
|
||||
|
||||
from .editblock_fenced_prompts import EditBlockFencedPrompts
|
||||
|
||||
|
||||
class EditorDiffFencedPrompts(EditBlockFencedPrompts):
|
||||
shell_cmd_prompt = ""
|
||||
no_shell_cmd_prompt = ""
|
||||
shell_cmd_reminder = ""
|
||||
go_ahead_tip = ""
|
||||
rename_with_shell = ""
|
||||
@@ -5,7 +5,7 @@ from .editblock_prompts import EditBlockPrompts
|
||||
|
||||
class EditorEditBlockPrompts(EditBlockPrompts):
|
||||
main_system = """Act as an expert software developer who edits source code.
|
||||
{lazy_prompt}
|
||||
{final_reminders}
|
||||
Describe each change with a *SEARCH/REPLACE block* per the examples below.
|
||||
All changes to files must use this *SEARCH/REPLACE block* format.
|
||||
ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
|
||||
@@ -14,3 +14,5 @@ ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
|
||||
shell_cmd_prompt = ""
|
||||
no_shell_cmd_prompt = ""
|
||||
shell_cmd_reminder = ""
|
||||
go_ahead_tip = ""
|
||||
rename_with_shell = ""
|
||||
|
||||
@@ -5,6 +5,6 @@ from .wholefile_prompts import WholeFilePrompts
|
||||
|
||||
class EditorWholeFilePrompts(WholeFilePrompts):
|
||||
main_system = """Act as an expert software developer and make changes to source code.
|
||||
{lazy_prompt}
|
||||
{final_reminders}
|
||||
Output a copy of each file that needs changes.
|
||||
"""
|
||||
|
||||
@@ -5,6 +5,7 @@ from .help_prompts import HelpPrompts
|
||||
|
||||
class HelpCoder(Coder):
|
||||
"""Interactive help and documentation about aider."""
|
||||
|
||||
edit_format = "help"
|
||||
gpt_prompts = HelpPrompts()
|
||||
|
||||
|
||||
706
aider/coders/patch_coder.py
Normal file
706
aider/coders/patch_coder.py
Normal file
@@ -0,0 +1,706 @@
|
||||
import pathlib
|
||||
from dataclasses import dataclass, field
|
||||
from enum import Enum
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
|
||||
from .base_coder import Coder
|
||||
from .patch_prompts import PatchPrompts
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Domain objects & Exceptions (Adapted from apply_patch.py)
|
||||
# --------------------------------------------------------------------------- #
|
||||
class DiffError(ValueError):
|
||||
"""Any problem detected while parsing or applying a patch."""
|
||||
|
||||
|
||||
class ActionType(str, Enum):
|
||||
ADD = "Add"
|
||||
DELETE = "Delete"
|
||||
UPDATE = "Update"
|
||||
|
||||
|
||||
@dataclass
|
||||
class Chunk:
|
||||
orig_index: int = -1 # Line number in the *original* file block where the change starts
|
||||
del_lines: List[str] = field(default_factory=list)
|
||||
ins_lines: List[str] = field(default_factory=list)
|
||||
|
||||
|
||||
@dataclass
|
||||
class PatchAction:
|
||||
type: ActionType
|
||||
path: str
|
||||
# For ADD:
|
||||
new_content: Optional[str] = None
|
||||
# For UPDATE:
|
||||
chunks: List[Chunk] = field(default_factory=list)
|
||||
move_path: Optional[str] = None
|
||||
|
||||
|
||||
# Type alias for the return type of get_edits
|
||||
EditResult = Tuple[str, PatchAction]
|
||||
|
||||
|
||||
@dataclass
|
||||
class Patch:
|
||||
actions: Dict[str, PatchAction] = field(default_factory=dict)
|
||||
fuzz: int = 0 # Track fuzziness used during parsing
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Helper functions (Adapted from apply_patch.py)
|
||||
# --------------------------------------------------------------------------- #
|
||||
def _norm(line: str) -> str:
|
||||
"""Strip CR so comparisons work for both LF and CRLF input."""
|
||||
return line.rstrip("\r")
|
||||
|
||||
|
||||
def find_context_core(lines: List[str], context: List[str], start: int) -> Tuple[int, int]:
|
||||
"""Finds context block, returns start index and fuzz level."""
|
||||
if not context:
|
||||
return start, 0
|
||||
|
||||
# Exact match
|
||||
for i in range(start, len(lines) - len(context) + 1):
|
||||
if lines[i : i + len(context)] == context:
|
||||
return i, 0
|
||||
# Rstrip match
|
||||
norm_context = [s.rstrip() for s in context]
|
||||
for i in range(start, len(lines) - len(context) + 1):
|
||||
if [s.rstrip() for s in lines[i : i + len(context)]] == norm_context:
|
||||
return i, 1 # Fuzz level 1
|
||||
# Strip match
|
||||
norm_context_strip = [s.strip() for s in context]
|
||||
for i in range(start, len(lines) - len(context) + 1):
|
||||
if [s.strip() for s in lines[i : i + len(context)]] == norm_context_strip:
|
||||
return i, 100 # Fuzz level 100
|
||||
return -1, 0
|
||||
|
||||
|
||||
def find_context(lines: List[str], context: List[str], start: int, eof: bool) -> Tuple[int, int]:
|
||||
"""Finds context, handling EOF marker."""
|
||||
if eof:
|
||||
# If EOF marker, first try matching at the very end
|
||||
if len(lines) >= len(context):
|
||||
new_index, fuzz = find_context_core(lines, context, len(lines) - len(context))
|
||||
if new_index != -1:
|
||||
return new_index, fuzz
|
||||
# If not found at end, search from `start` as fallback
|
||||
new_index, fuzz = find_context_core(lines, context, start)
|
||||
return new_index, fuzz + 10_000 # Add large fuzz penalty if EOF wasn't at end
|
||||
# Normal case: search from `start`
|
||||
return find_context_core(lines, context, start)
|
||||
|
||||
|
||||
def peek_next_section(lines: List[str], index: int) -> Tuple[List[str], List[Chunk], int, bool]:
|
||||
"""
|
||||
Parses one section (context, -, + lines) of an Update block.
|
||||
Returns: (context_lines, chunks_in_section, next_index, is_eof)
|
||||
"""
|
||||
context_lines: List[str] = []
|
||||
del_lines: List[str] = []
|
||||
ins_lines: List[str] = []
|
||||
chunks: List[Chunk] = []
|
||||
mode = "keep" # Start by expecting context lines
|
||||
start_index = index
|
||||
|
||||
while index < len(lines):
|
||||
line = lines[index]
|
||||
norm_line = _norm(line)
|
||||
|
||||
# Check for section terminators
|
||||
if norm_line.startswith(
|
||||
(
|
||||
"@@",
|
||||
"*** End Patch",
|
||||
"*** Update File:",
|
||||
"*** Delete File:",
|
||||
"*** Add File:",
|
||||
"*** End of File", # Special terminator
|
||||
)
|
||||
):
|
||||
break
|
||||
if norm_line == "***": # Legacy/alternative terminator? Handle just in case.
|
||||
break
|
||||
if norm_line.startswith("***"): # Invalid line
|
||||
raise DiffError(f"Invalid patch line found in update section: {line}")
|
||||
|
||||
index += 1
|
||||
last_mode = mode
|
||||
|
||||
# Determine line type and strip prefix
|
||||
if line.startswith("+"):
|
||||
mode = "add"
|
||||
line_content = line[1:]
|
||||
elif line.startswith("-"):
|
||||
mode = "delete"
|
||||
line_content = line[1:]
|
||||
elif line.startswith(" "):
|
||||
mode = "keep"
|
||||
line_content = line[1:]
|
||||
elif line.strip() == "": # Treat blank lines in patch as context ' '
|
||||
mode = "keep"
|
||||
line_content = "" # Keep it as a blank line
|
||||
else:
|
||||
# Assume lines without prefix are context if format is loose,
|
||||
# but strict format requires ' '. Raise error for strictness.
|
||||
raise DiffError(f"Invalid line prefix in update section: {line}")
|
||||
|
||||
# If mode changes from add/delete back to keep, finalize the previous chunk
|
||||
if mode == "keep" and last_mode != "keep":
|
||||
if del_lines or ins_lines:
|
||||
chunks.append(
|
||||
Chunk(
|
||||
# orig_index is relative to the start of the *context* block found
|
||||
orig_index=len(context_lines) - len(del_lines),
|
||||
del_lines=del_lines,
|
||||
ins_lines=ins_lines,
|
||||
)
|
||||
)
|
||||
del_lines, ins_lines = [], []
|
||||
|
||||
# Collect lines based on mode
|
||||
if mode == "delete":
|
||||
del_lines.append(line_content)
|
||||
context_lines.append(line_content) # Deleted lines are part of the original context
|
||||
elif mode == "add":
|
||||
ins_lines.append(line_content)
|
||||
elif mode == "keep":
|
||||
context_lines.append(line_content)
|
||||
|
||||
# Finalize any pending chunk at the end of the section
|
||||
if del_lines or ins_lines:
|
||||
chunks.append(
|
||||
Chunk(
|
||||
orig_index=len(context_lines) - len(del_lines),
|
||||
del_lines=del_lines,
|
||||
ins_lines=ins_lines,
|
||||
)
|
||||
)
|
||||
|
||||
# Check for EOF marker
|
||||
is_eof = False
|
||||
if index < len(lines) and _norm(lines[index]) == "*** End of File":
|
||||
index += 1
|
||||
is_eof = True
|
||||
|
||||
if index == start_index and not is_eof: # Should not happen if patch is well-formed
|
||||
raise DiffError("Empty patch section found.")
|
||||
|
||||
return context_lines, chunks, index, is_eof
|
||||
|
||||
|
||||
def identify_files_needed(text: str) -> List[str]:
|
||||
"""Extracts file paths from Update and Delete actions."""
|
||||
lines = text.splitlines()
|
||||
paths = set()
|
||||
for line in lines:
|
||||
norm_line = _norm(line)
|
||||
if norm_line.startswith("*** Update File: "):
|
||||
paths.add(norm_line[len("*** Update File: ") :].strip())
|
||||
elif norm_line.startswith("*** Delete File: "):
|
||||
paths.add(norm_line[len("*** Delete File: ") :].strip())
|
||||
return list(paths)
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# PatchCoder Class Implementation
|
||||
# --------------------------------------------------------------------------- #
|
||||
class PatchCoder(Coder):
|
||||
"""
|
||||
A coder that uses a custom patch format for code modifications,
|
||||
inspired by the format described in tmp.gpt41edits.txt.
|
||||
Applies patches using logic adapted from the reference apply_patch.py script.
|
||||
"""
|
||||
|
||||
edit_format = "patch"
|
||||
gpt_prompts = PatchPrompts()
|
||||
|
||||
def get_edits(self) -> List[EditResult]:
|
||||
"""
|
||||
Parses the LLM response content (containing the patch) into a list of
|
||||
tuples, where each tuple contains the file path and the PatchAction object.
|
||||
"""
|
||||
content = self.partial_response_content
|
||||
if not content or not content.strip():
|
||||
return []
|
||||
|
||||
# Check for patch sentinels
|
||||
lines = content.splitlines()
|
||||
if (
|
||||
len(lines) < 2
|
||||
or not _norm(lines[0]).startswith("*** Begin Patch")
|
||||
# Allow flexible end, might be EOF or just end of stream
|
||||
# or _norm(lines[-1]) != "*** End Patch"
|
||||
):
|
||||
# Tolerate missing sentinels if content looks like a patch action
|
||||
is_patch_like = any(
|
||||
_norm(line).startswith(
|
||||
("@@", "*** Update File:", "*** Add File:", "*** Delete File:")
|
||||
)
|
||||
for line in lines
|
||||
)
|
||||
if not is_patch_like:
|
||||
# If it doesn't even look like a patch, return empty
|
||||
self.io.tool_warning("Response does not appear to be in patch format.")
|
||||
return []
|
||||
# If it looks like a patch but lacks sentinels, try parsing anyway but warn.
|
||||
self.io.tool_warning(
|
||||
"Patch format warning: Missing '*** Begin Patch'/'*** End Patch' sentinels."
|
||||
)
|
||||
start_index = 0
|
||||
else:
|
||||
start_index = 1 # Skip "*** Begin Patch"
|
||||
|
||||
# Identify files needed for context lookups during parsing
|
||||
needed_paths = identify_files_needed(content)
|
||||
current_files: Dict[str, str] = {}
|
||||
for rel_path in needed_paths:
|
||||
abs_path = self.abs_root_path(rel_path)
|
||||
try:
|
||||
# Use io.read_text to handle potential errors/encodings
|
||||
file_content = self.io.read_text(abs_path)
|
||||
if file_content is None:
|
||||
raise DiffError(
|
||||
f"File referenced in patch not found or could not be read: {rel_path}"
|
||||
)
|
||||
current_files[rel_path] = file_content
|
||||
except FileNotFoundError:
|
||||
raise DiffError(f"File referenced in patch not found: {rel_path}")
|
||||
except IOError as e:
|
||||
raise DiffError(f"Error reading file {rel_path}: {e}")
|
||||
|
||||
try:
|
||||
# Parse the patch text using adapted logic
|
||||
patch_obj = self._parse_patch_text(lines, start_index, current_files)
|
||||
# Convert Patch object actions dict to a list of tuples (path, action)
|
||||
# for compatibility with the base Coder's prepare_to_edit method.
|
||||
results = []
|
||||
for path, action in patch_obj.actions.items():
|
||||
results.append((path, action))
|
||||
return results
|
||||
except DiffError as e:
|
||||
# Raise as ValueError for consistency with other coders' error handling
|
||||
raise ValueError(f"Error parsing patch content: {e}")
|
||||
except Exception as e:
|
||||
# Catch unexpected errors during parsing
|
||||
raise ValueError(f"Unexpected error parsing patch: {e}")
|
||||
|
||||
def _parse_patch_text(
|
||||
self, lines: List[str], start_index: int, current_files: Dict[str, str]
|
||||
) -> Patch:
|
||||
"""
|
||||
Parses patch content lines into a Patch object.
|
||||
Adapted from the Parser class in apply_patch.py.
|
||||
"""
|
||||
patch = Patch()
|
||||
index = start_index
|
||||
fuzz_accumulator = 0
|
||||
|
||||
while index < len(lines):
|
||||
line = lines[index]
|
||||
norm_line = _norm(line)
|
||||
|
||||
if norm_line == "*** End Patch":
|
||||
index += 1
|
||||
break # Successfully reached end
|
||||
|
||||
# ---------- UPDATE ---------- #
|
||||
if norm_line.startswith("*** Update File: "):
|
||||
path = norm_line[len("*** Update File: ") :].strip()
|
||||
index += 1
|
||||
if not path:
|
||||
raise DiffError("Update File action missing path.")
|
||||
|
||||
# Optional move target
|
||||
move_to = None
|
||||
if index < len(lines) and _norm(lines[index]).startswith("*** Move to: "):
|
||||
move_to = _norm(lines[index])[len("*** Move to: ") :].strip()
|
||||
index += 1
|
||||
if not move_to:
|
||||
raise DiffError("Move to action missing path.")
|
||||
|
||||
if path not in current_files:
|
||||
raise DiffError(f"Update File Error - missing file content for: {path}")
|
||||
|
||||
file_content = current_files[path]
|
||||
|
||||
existing_action = patch.actions.get(path)
|
||||
if existing_action is not None:
|
||||
# Merge additional UPDATE block into the existing one
|
||||
if existing_action.type != ActionType.UPDATE:
|
||||
raise DiffError(f"Conflicting actions for file: {path}")
|
||||
|
||||
new_action, index, fuzz = self._parse_update_file_sections(
|
||||
lines, index, file_content
|
||||
)
|
||||
existing_action.chunks.extend(new_action.chunks)
|
||||
|
||||
if move_to:
|
||||
if existing_action.move_path and existing_action.move_path != move_to:
|
||||
raise DiffError(f"Conflicting move targets for file: {path}")
|
||||
existing_action.move_path = move_to
|
||||
fuzz_accumulator += fuzz
|
||||
else:
|
||||
# First UPDATE block for this file
|
||||
action, index, fuzz = self._parse_update_file_sections(
|
||||
lines, index, file_content
|
||||
)
|
||||
action.path = path
|
||||
action.move_path = move_to
|
||||
patch.actions[path] = action
|
||||
fuzz_accumulator += fuzz
|
||||
continue
|
||||
|
||||
# ---------- DELETE ---------- #
|
||||
elif norm_line.startswith("*** Delete File: "):
|
||||
path = norm_line[len("*** Delete File: ") :].strip()
|
||||
index += 1
|
||||
if not path:
|
||||
raise DiffError("Delete File action missing path.")
|
||||
existing_action = patch.actions.get(path)
|
||||
if existing_action:
|
||||
if existing_action.type == ActionType.DELETE:
|
||||
# Duplicate delete – ignore the extra block
|
||||
self.io.tool_warning(f"Duplicate delete action for file: {path} ignored.")
|
||||
continue
|
||||
else:
|
||||
raise DiffError(f"Conflicting actions for file: {path}")
|
||||
if path not in current_files:
|
||||
raise DiffError(
|
||||
f"Delete File Error - file not found: {path}"
|
||||
) # Check against known files
|
||||
|
||||
patch.actions[path] = PatchAction(type=ActionType.DELETE, path=path)
|
||||
continue
|
||||
|
||||
# ---------- ADD ---------- #
|
||||
elif norm_line.startswith("*** Add File: "):
|
||||
path = norm_line[len("*** Add File: ") :].strip()
|
||||
index += 1
|
||||
if not path:
|
||||
raise DiffError("Add File action missing path.")
|
||||
if path in patch.actions:
|
||||
raise DiffError(f"Duplicate action for file: {path}")
|
||||
# Check if file exists in the context provided (should not for Add).
|
||||
# Note: We only have needed files, a full check requires FS access.
|
||||
# if path in current_files:
|
||||
# raise DiffError(f"Add File Error - file already exists: {path}")
|
||||
|
||||
action, index = self._parse_add_file_content(lines, index)
|
||||
action.path = path # Ensure path is set
|
||||
patch.actions[path] = action
|
||||
continue
|
||||
|
||||
# If we are here, the line is unexpected
|
||||
# Allow blank lines between actions
|
||||
if not norm_line.strip():
|
||||
index += 1
|
||||
continue
|
||||
|
||||
raise DiffError(f"Unknown or misplaced line while parsing patch: {line}")
|
||||
|
||||
# Check if we consumed the whole input or stopped early
|
||||
# Tolerate missing "*** End Patch" if we processed actions
|
||||
# if index < len(lines) and _norm(lines[index-1]) != "*** End Patch":
|
||||
# raise DiffError("Patch parsing finished unexpectedly before end of input.")
|
||||
|
||||
patch.fuzz = fuzz_accumulator
|
||||
return patch
|
||||
|
||||
def _parse_update_file_sections(
|
||||
self, lines: List[str], index: int, file_content: str
|
||||
) -> Tuple[PatchAction, int, int]:
|
||||
"""Parses all sections (@@, context, -, +) for a single Update File action."""
|
||||
action = PatchAction(type=ActionType.UPDATE, path="") # Path set by caller
|
||||
orig_lines = file_content.splitlines() # Use splitlines for consistency
|
||||
current_file_index = 0 # Track position in original file content
|
||||
total_fuzz = 0
|
||||
|
||||
while index < len(lines):
|
||||
norm_line = _norm(lines[index])
|
||||
# Check for terminators for *this* file update
|
||||
if norm_line.startswith(
|
||||
(
|
||||
"*** End Patch",
|
||||
"*** Update File:",
|
||||
"*** Delete File:",
|
||||
"*** Add File:",
|
||||
)
|
||||
):
|
||||
break # End of this file's update section
|
||||
|
||||
# Handle @@ scope lines (optional)
|
||||
scope_lines = []
|
||||
while index < len(lines) and _norm(lines[index]).startswith("@@"):
|
||||
scope_line_content = lines[index][len("@@") :].strip()
|
||||
if scope_line_content: # Ignore empty @@ lines?
|
||||
scope_lines.append(scope_line_content)
|
||||
index += 1
|
||||
|
||||
# Find the scope in the original file if specified
|
||||
if scope_lines:
|
||||
# Simple scope finding: search from current position
|
||||
# A more robust finder could handle nested scopes like the reference @@ @@
|
||||
found_scope = False
|
||||
temp_index = current_file_index
|
||||
while temp_index < len(orig_lines):
|
||||
# Check if all scope lines match sequentially from temp_index
|
||||
match = True
|
||||
for i, scope in enumerate(scope_lines):
|
||||
if (
|
||||
temp_index + i >= len(orig_lines)
|
||||
or _norm(orig_lines[temp_index + i]).strip() != scope
|
||||
):
|
||||
match = False
|
||||
break
|
||||
if match:
|
||||
current_file_index = temp_index + len(scope_lines)
|
||||
found_scope = True
|
||||
break
|
||||
temp_index += 1
|
||||
|
||||
if not found_scope:
|
||||
# Try fuzzy scope matching (strip whitespace)
|
||||
temp_index = current_file_index
|
||||
while temp_index < len(orig_lines):
|
||||
match = True
|
||||
for i, scope in enumerate(scope_lines):
|
||||
if (
|
||||
temp_index + i >= len(orig_lines)
|
||||
or _norm(orig_lines[temp_index + i]).strip() != scope.strip()
|
||||
):
|
||||
match = False
|
||||
break
|
||||
if match:
|
||||
current_file_index = temp_index + len(scope_lines)
|
||||
found_scope = True
|
||||
total_fuzz += 1 # Add fuzz for scope match difference
|
||||
break
|
||||
temp_index += 1
|
||||
|
||||
if not found_scope:
|
||||
scope_txt = "\n".join(scope_lines)
|
||||
raise DiffError(f"Could not find scope context:\n{scope_txt}")
|
||||
|
||||
# Peek and parse the next context/change section
|
||||
context_block, chunks_in_section, next_index, is_eof = peek_next_section(lines, index)
|
||||
|
||||
# Find where this context block appears in the original file
|
||||
found_index, fuzz = find_context(orig_lines, context_block, current_file_index, is_eof)
|
||||
total_fuzz += fuzz
|
||||
|
||||
if found_index == -1:
|
||||
ctx_txt = "\n".join(context_block)
|
||||
marker = "*** End of File" if is_eof else ""
|
||||
raise DiffError(
|
||||
f"Could not find patch context {marker} starting near line"
|
||||
f" {current_file_index}:\n{ctx_txt}"
|
||||
)
|
||||
|
||||
# Adjust chunk original indices to be absolute within the file
|
||||
for chunk in chunks_in_section:
|
||||
# chunk.orig_index from peek is relative to context_block start
|
||||
# We need it relative to the file start
|
||||
chunk.orig_index += found_index
|
||||
action.chunks.append(chunk)
|
||||
|
||||
# Advance file index past the matched context block
|
||||
current_file_index = found_index + len(context_block)
|
||||
# Advance line index past the processed section in the patch
|
||||
index = next_index
|
||||
|
||||
return action, index, total_fuzz
|
||||
|
||||
def _parse_add_file_content(self, lines: List[str], index: int) -> Tuple[PatchAction, int]:
|
||||
"""Parses the content (+) lines for an Add File action."""
|
||||
added_lines: List[str] = []
|
||||
while index < len(lines):
|
||||
line = lines[index]
|
||||
norm_line = _norm(line)
|
||||
# Stop if we hit another action or end marker
|
||||
if norm_line.startswith(
|
||||
(
|
||||
"*** End Patch",
|
||||
"*** Update File:",
|
||||
"*** Delete File:",
|
||||
"*** Add File:",
|
||||
)
|
||||
):
|
||||
break
|
||||
|
||||
# Expect lines to start with '+'
|
||||
if not line.startswith("+"):
|
||||
# Tolerate blank lines? Or require '+'? Reference implies '+' required.
|
||||
if norm_line.strip() == "":
|
||||
# Treat blank line as adding a blank line
|
||||
added_lines.append("")
|
||||
else:
|
||||
raise DiffError(f"Invalid Add File line (missing '+'): {line}")
|
||||
else:
|
||||
added_lines.append(line[1:]) # Strip leading '+'
|
||||
|
||||
index += 1
|
||||
|
||||
action = PatchAction(type=ActionType.ADD, path="", new_content="\n".join(added_lines))
|
||||
return action, index
|
||||
|
||||
def apply_edits(self, edits: List[PatchAction]):
|
||||
"""
|
||||
Applies the parsed PatchActions to the corresponding files.
|
||||
"""
|
||||
if not edits:
|
||||
return
|
||||
|
||||
# Group edits by original path? Not strictly needed if processed sequentially.
|
||||
|
||||
# Edits are now List[Tuple[str, PatchAction]]
|
||||
for _path_tuple_element, action in edits:
|
||||
# action is the PatchAction object
|
||||
# action.path is the canonical path within the action logic
|
||||
full_path = self.abs_root_path(action.path)
|
||||
path_obj = pathlib.Path(full_path)
|
||||
|
||||
try:
|
||||
if action.type == ActionType.ADD:
|
||||
# Check existence *before* writing
|
||||
if path_obj.exists():
|
||||
raise DiffError(f"ADD Error: File already exists: {action.path}")
|
||||
if action.new_content is None:
|
||||
# Parser should ensure this doesn't happen
|
||||
raise DiffError(f"ADD change for {action.path} has no content")
|
||||
|
||||
self.io.tool_output(f"Adding {action.path}")
|
||||
path_obj.parent.mkdir(parents=True, exist_ok=True)
|
||||
# Ensure single trailing newline, matching reference behavior
|
||||
content_to_write = action.new_content
|
||||
if not content_to_write.endswith("\n"):
|
||||
content_to_write += "\n"
|
||||
self.io.write_text(full_path, content_to_write)
|
||||
|
||||
elif action.type == ActionType.DELETE:
|
||||
self.io.tool_output(f"Deleting {action.path}")
|
||||
if not path_obj.exists():
|
||||
self.io.tool_warning(
|
||||
f"DELETE Warning: File not found, skipping: {action.path}"
|
||||
)
|
||||
else:
|
||||
path_obj.unlink()
|
||||
|
||||
elif action.type == ActionType.UPDATE:
|
||||
if not path_obj.exists():
|
||||
raise DiffError(f"UPDATE Error: File does not exist: {action.path}")
|
||||
|
||||
current_content = self.io.read_text(full_path)
|
||||
if current_content is None:
|
||||
# Should have been caught during parsing if file was needed
|
||||
raise DiffError(f"Could not read file for UPDATE: {action.path}")
|
||||
|
||||
# Apply the update logic using the parsed chunks
|
||||
new_content = self._apply_update(current_content, action, action.path)
|
||||
|
||||
target_full_path = (
|
||||
self.abs_root_path(action.move_path) if action.move_path else full_path
|
||||
)
|
||||
target_path_obj = pathlib.Path(target_full_path)
|
||||
|
||||
if action.move_path:
|
||||
self.io.tool_output(
|
||||
f"Updating and moving {action.path} to {action.move_path}"
|
||||
)
|
||||
# Check if target exists before overwriting/moving
|
||||
if target_path_obj.exists() and full_path != target_full_path:
|
||||
self.io.tool_warning(
|
||||
"UPDATE Warning: Target file for move already exists, overwriting:"
|
||||
f" {action.move_path}"
|
||||
)
|
||||
else:
|
||||
self.io.tool_output(f"Updating {action.path}")
|
||||
|
||||
# Ensure parent directory exists for target
|
||||
target_path_obj.parent.mkdir(parents=True, exist_ok=True)
|
||||
self.io.write_text(target_full_path, new_content)
|
||||
|
||||
# Remove original file *after* successful write to new location if moved
|
||||
if action.move_path and full_path != target_full_path:
|
||||
path_obj.unlink()
|
||||
|
||||
else:
|
||||
# Should not happen
|
||||
raise DiffError(f"Unknown action type encountered: {action.type}")
|
||||
|
||||
except (DiffError, FileNotFoundError, IOError, OSError) as e:
|
||||
# Raise a ValueError to signal failure, consistent with other coders.
|
||||
raise ValueError(f"Error applying action '{action.type}' to {action.path}: {e}")
|
||||
except Exception as e:
|
||||
# Catch unexpected errors during application
|
||||
raise ValueError(
|
||||
f"Unexpected error applying action '{action.type}' to {action.path}: {e}"
|
||||
)
|
||||
|
||||
def _apply_update(self, text: str, action: PatchAction, path: str) -> str:
|
||||
"""
|
||||
Applies UPDATE chunks to the given text content.
|
||||
Adapted from _get_updated_file in apply_patch.py.
|
||||
"""
|
||||
if action.type is not ActionType.UPDATE:
|
||||
# Should not be called otherwise, but check for safety
|
||||
raise DiffError("_apply_update called with non-update action")
|
||||
|
||||
orig_lines = text.splitlines() # Use splitlines to handle endings consistently
|
||||
dest_lines: List[str] = []
|
||||
current_orig_line_idx = 0 # Tracks index in orig_lines processed so far
|
||||
|
||||
# Sort chunks by their original index to apply them sequentially
|
||||
sorted_chunks = sorted(action.chunks, key=lambda c: c.orig_index)
|
||||
|
||||
for chunk in sorted_chunks:
|
||||
# chunk.orig_index is the absolute line number where the change starts
|
||||
# (where the first deleted line was, or where inserted lines go if no deletes)
|
||||
chunk_start_index = chunk.orig_index
|
||||
|
||||
if chunk_start_index < current_orig_line_idx:
|
||||
# This indicates overlapping chunks or incorrect indices from parsing
|
||||
raise DiffError(
|
||||
f"{path}: Overlapping or out-of-order chunk detected."
|
||||
f" Current index {current_orig_line_idx}, chunk starts at {chunk_start_index}."
|
||||
)
|
||||
|
||||
# Add lines from original file between the last chunk and this one
|
||||
dest_lines.extend(orig_lines[current_orig_line_idx:chunk_start_index])
|
||||
|
||||
# Verify that the lines to be deleted actually match the original file content
|
||||
# (The parser should have used find_context, but double-check here)
|
||||
num_del = len(chunk.del_lines)
|
||||
actual_deleted_lines = orig_lines[chunk_start_index : chunk_start_index + num_del]
|
||||
|
||||
# Use the same normalization as find_context_core for comparison robustness
|
||||
norm_chunk_del = [_norm(s).strip() for s in chunk.del_lines]
|
||||
norm_actual_del = [_norm(s).strip() for s in actual_deleted_lines]
|
||||
|
||||
if norm_chunk_del != norm_actual_del:
|
||||
# This indicates the context matching failed or the file changed since parsing
|
||||
# Provide detailed error message
|
||||
expected_str = "\n".join(f"- {s}" for s in chunk.del_lines)
|
||||
actual_str = "\n".join(f" {s}" for s in actual_deleted_lines)
|
||||
raise DiffError(
|
||||
f"{path}: Mismatch applying patch near line {chunk_start_index + 1}.\n"
|
||||
f"Expected lines to remove:\n{expected_str}\n"
|
||||
f"Found lines in file:\n{actual_str}"
|
||||
)
|
||||
|
||||
# Add the inserted lines from the chunk
|
||||
dest_lines.extend(chunk.ins_lines)
|
||||
|
||||
# Advance the original line index past the lines processed (deleted lines)
|
||||
current_orig_line_idx = chunk_start_index + num_del
|
||||
|
||||
# Add any remaining lines from the original file after the last chunk
|
||||
dest_lines.extend(orig_lines[current_orig_line_idx:])
|
||||
|
||||
# Join lines and ensure a single trailing newline
|
||||
result = "\n".join(dest_lines)
|
||||
if result or orig_lines: # Add newline unless result is empty and original was empty
|
||||
result += "\n"
|
||||
return result
|
||||
161
aider/coders/patch_prompts.py
Normal file
161
aider/coders/patch_prompts.py
Normal file
@@ -0,0 +1,161 @@
|
||||
# flake8: noqa: E501
|
||||
|
||||
from .base_prompts import CoderPrompts
|
||||
from .editblock_prompts import EditBlockPrompts
|
||||
|
||||
|
||||
class PatchPrompts(EditBlockPrompts):
|
||||
# --------------------------------------------------------------------- #
|
||||
# SYSTEM PROMPT
|
||||
# --------------------------------------------------------------------- #
|
||||
main_system = """Act as an expert software developer.
|
||||
Always use best practices when coding.
|
||||
Respect and use existing conventions, libraries, etc that are already present in the code base.
|
||||
{final_reminders}
|
||||
Take requests for changes to the supplied code.
|
||||
If the request is ambiguous, ask questions.
|
||||
|
||||
Always reply to the user in {language}.
|
||||
|
||||
Once you understand the request you MUST:
|
||||
|
||||
1. Decide if you need to propose edits to any files that haven't been added to the chat. You can create new files without asking!
|
||||
|
||||
• If you need to propose edits to existing files not already added to the chat, you *MUST* tell the user their full path names and ask them to *add the files to the chat*.
|
||||
• End your reply and wait for their approval.
|
||||
• You can keep asking if you then decide you need to edit more files.
|
||||
|
||||
2. Think step‑by‑step and explain the needed changes in a few short sentences.
|
||||
|
||||
3. Describe the changes using the V4A diff format, enclosed within `*** Begin Patch` and `*** End Patch` markers.
|
||||
|
||||
IMPORTANT: Each file MUST appear only once in the patch.
|
||||
Consolidate **all** edits for a given file into a single `*** [ACTION] File:` block.
|
||||
{shell_cmd_prompt}
|
||||
"""
|
||||
|
||||
# --------------------------------------------------------------------- #
|
||||
# EXAMPLE MESSAGES
|
||||
# --------------------------------------------------------------------- #
|
||||
example_messages = [
|
||||
# --- Example 1 ---------------------------------------------------- #
|
||||
dict(
|
||||
role="user",
|
||||
content="Change get_factorial() to use math.factorial",
|
||||
),
|
||||
dict(
|
||||
role="assistant",
|
||||
content="""To make this change we need to modify `mathweb/flask/app.py`:
|
||||
|
||||
1. Import the `math` module.
|
||||
2. Replace the custom recursive `factorial()` helper with `math.factorial`.
|
||||
3. Update `get_factorial()` to call `math.factorial`.
|
||||
|
||||
Here is the patch:
|
||||
|
||||
*** Begin Patch
|
||||
*** Update File: mathweb/flask/app.py
|
||||
@@
|
||||
-from flask import Flask
|
||||
-
|
||||
-from flask import Flask
|
||||
+from flask import Flask
|
||||
+import math
|
||||
@@
|
||||
-def factorial(n):
|
||||
- "compute factorial"
|
||||
-
|
||||
- if n == 0:
|
||||
- return 1
|
||||
- else:
|
||||
- return n * factorial(n-1)
|
||||
+def factorial(n):
|
||||
+ "compute factorial"
|
||||
+
|
||||
+ return math.factorial(n)
|
||||
@@ def get_factorial(self, n):
|
||||
- return str(factorial(n))
|
||||
+ return str(math.factorial(n))
|
||||
*** End Patch
|
||||
""",
|
||||
),
|
||||
# --- Example 2 ---------------------------------------------------- #
|
||||
dict(
|
||||
role="user",
|
||||
content="Refactor hello() into its own file.",
|
||||
),
|
||||
dict(
|
||||
role="assistant",
|
||||
content="""To make this change we need to modify `main.py` and create a new file `hello.py`:
|
||||
|
||||
1. Create `hello.py` with the `hello()` function.
|
||||
2. Remove `hello()` from `main.py` and import it instead.
|
||||
|
||||
Here is the patch:
|
||||
|
||||
*** Begin Patch
|
||||
*** Add File: hello.py
|
||||
+# A simple function
|
||||
+def hello():
|
||||
+ "print a greeting"
|
||||
+
|
||||
+ print("hello")
|
||||
*** Update File: main.py
|
||||
@@
|
||||
-def hello():
|
||||
- "print a greeting"
|
||||
-
|
||||
- print("hello")
|
||||
+from hello import hello
|
||||
*** End Patch
|
||||
""",
|
||||
),
|
||||
]
|
||||
|
||||
# --------------------------------------------------------------------- #
|
||||
# SYSTEM REMINDER
|
||||
# --------------------------------------------------------------------- #
|
||||
system_reminder = """# V4A Diff Format Rules:
|
||||
|
||||
Your entire response containing the patch MUST start with `*** Begin Patch` on a line by itself.
|
||||
Your entire response containing the patch MUST end with `*** End Patch` on a line by itself.
|
||||
|
||||
Use the *FULL* file path, as shown to you by the user.
|
||||
{quad_backtick_reminder}
|
||||
|
||||
For each file you need to modify, start with a marker line:
|
||||
|
||||
*** [ACTION] File: [path/to/file]
|
||||
|
||||
Where `[ACTION]` is one of `Add`, `Update`, or `Delete`.
|
||||
|
||||
⇨ **Each file MUST appear only once in the patch.**
|
||||
Consolidate all changes for that file into the same block.
|
||||
If you are moving code within a file, include both the deletions and the
|
||||
insertions as separate hunks inside this single `*** Update File:` block
|
||||
(do *not* open a second block for the same file).
|
||||
|
||||
For `Update` actions, describe each snippet of code that needs to be changed using the following format:
|
||||
1. Context lines: Include 3 lines of context *before* the change. These lines MUST start with a single space ` `.
|
||||
2. Lines to remove: Precede each line to be removed with a minus sign `-`.
|
||||
3. Lines to add: Precede each line to be added with a plus sign `+`.
|
||||
4. Context lines: Include 3 lines of context *after* the change. These lines MUST start with a single space ` `.
|
||||
|
||||
Context lines MUST exactly match the existing file content, character for character, including indentation.
|
||||
If a change is near the beginning or end of the file, include fewer than 3 context lines as appropriate.
|
||||
If 3 lines of context is insufficient to uniquely identify the snippet, use `@@ [CLASS_OR_FUNCTION_NAME]` markers on their own lines *before* the context lines to specify the scope. You can use multiple `@@` markers if needed.
|
||||
Do not include line numbers.
|
||||
|
||||
Only create patches for files that the user has added to the chat!
|
||||
|
||||
When moving code *within* a single file, keep everything inside one
|
||||
`*** Update File:` block. Provide one hunk that deletes the code from its
|
||||
original location and another hunk that inserts it at the new location.
|
||||
|
||||
For `Add` actions, use the `*** Add File: [path/to/new/file]` marker, followed by the lines of the new file, each preceded by a plus sign `+`.
|
||||
|
||||
For `Delete` actions, use the `*** Delete File: [path/to/file]` marker. No other lines are needed for the deletion.
|
||||
|
||||
{rename_with_shell}{go_ahead_tip}{final_reminders}ONLY EVER RETURN CODE IN THE SPECIFIED V4A DIFF FORMAT!
|
||||
{shell_cmd_reminder}
|
||||
"""
|
||||
@@ -109,7 +109,7 @@ class RelativeIndenter:
|
||||
"""
|
||||
|
||||
if self.marker in text:
|
||||
raise ValueError("Text already contains the outdent marker: {self.marker}")
|
||||
raise ValueError(f"Text already contains the outdent marker: {self.marker}")
|
||||
|
||||
lines = text.splitlines(keepends=True)
|
||||
|
||||
@@ -235,20 +235,6 @@ Left
|
||||
Left
|
||||
"""
|
||||
|
||||
"""
|
||||
ri = RelativeIndenter([example])
|
||||
dump(example)
|
||||
|
||||
rel_example = ri.make_relative(example)
|
||||
dump(repr(rel_example))
|
||||
|
||||
abs_example = ri.make_absolute(rel_example)
|
||||
dump(abs_example)
|
||||
|
||||
|
||||
sys.exit()
|
||||
"""
|
||||
|
||||
|
||||
def relative_indent(texts):
|
||||
ri = RelativeIndenter(texts)
|
||||
@@ -349,7 +335,7 @@ def lines_to_chars(lines, mapping):
|
||||
return new_text
|
||||
|
||||
|
||||
def dmp_lines_apply(texts, remap=True):
|
||||
def dmp_lines_apply(texts):
|
||||
debug = False
|
||||
# debug = True
|
||||
|
||||
@@ -655,8 +641,6 @@ def proc(dname):
|
||||
(dmp_lines_apply, all_preprocs),
|
||||
]
|
||||
|
||||
_strategies = editblock_strategies # noqa: F841
|
||||
|
||||
short_names = dict(
|
||||
search_and_replace="sr",
|
||||
git_cherry_pick_osr_onto_o="cp_o",
|
||||
|
||||
37
aider/coders/shell.py
Normal file
37
aider/coders/shell.py
Normal file
@@ -0,0 +1,37 @@
|
||||
shell_cmd_prompt = """
|
||||
4. *Concisely* suggest any shell commands the user might want to run in ```bash blocks.
|
||||
|
||||
Just suggest shell commands this way, not example code.
|
||||
Only suggest complete shell commands that are ready to execute, without placeholders.
|
||||
Only suggest at most a few shell commands at a time, not more than 1-3, one per line.
|
||||
Do not suggest multi-line shell commands.
|
||||
All shell commands will run from the root directory of the user's project.
|
||||
|
||||
Use the appropriate shell based on the user's system info:
|
||||
{platform}
|
||||
Examples of when to suggest shell commands:
|
||||
|
||||
- If you changed a self-contained html file, suggest an OS-appropriate command to open a browser to view it to see the updated content.
|
||||
- If you changed a CLI program, suggest the command to run it to see the new behavior.
|
||||
- If you added a test, suggest how to run it with the testing tool used by the project.
|
||||
- Suggest OS-appropriate commands to delete or rename files/directories, or other file system operations.
|
||||
- If your code changes add new dependencies, suggest the command to install them.
|
||||
- Etc.
|
||||
""" # noqa
|
||||
|
||||
no_shell_cmd_prompt = """
|
||||
Keep in mind these details about the user's platform and environment:
|
||||
{platform}
|
||||
""" # noqa
|
||||
|
||||
shell_cmd_reminder = """
|
||||
Examples of when to suggest shell commands:
|
||||
|
||||
- If you changed a self-contained html file, suggest an OS-appropriate command to open a browser to view it to see the updated content.
|
||||
- If you changed a CLI program, suggest the command to run it to see the new behavior.
|
||||
- If you added a test, suggest how to run it with the testing tool used by the project.
|
||||
- Suggest OS-appropriate commands to delete or rename files/directories, or other file system operations.
|
||||
- If your code changes add new dependencies, suggest the command to install them.
|
||||
- Etc.
|
||||
|
||||
""" # noqa
|
||||
@@ -45,6 +45,7 @@ other_hunks_applied = (
|
||||
|
||||
class UnifiedDiffCoder(Coder):
|
||||
"""A coder that uses unified diff format for code modifications."""
|
||||
|
||||
edit_format = "udiff"
|
||||
gpt_prompts = UnifiedDiffPrompts()
|
||||
|
||||
@@ -344,7 +345,16 @@ def process_fenced_block(lines, start_line_num):
|
||||
|
||||
if block[0].startswith("--- ") and block[1].startswith("+++ "):
|
||||
# Extract the file path, considering that it might contain spaces
|
||||
fname = block[1][4:].strip()
|
||||
a_fname = block[0][4:].strip()
|
||||
b_fname = block[1][4:].strip()
|
||||
|
||||
# Check if standard git diff prefixes are present (or /dev/null) and strip them
|
||||
if (a_fname.startswith("a/") or a_fname == "/dev/null") and b_fname.startswith("b/"):
|
||||
fname = b_fname[2:]
|
||||
else:
|
||||
# Otherwise, assume the path is as intended
|
||||
fname = b_fname
|
||||
|
||||
block = block[2:]
|
||||
else:
|
||||
fname = None
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
# flake8: noqa: E501
|
||||
|
||||
from . import shell
|
||||
from .base_prompts import CoderPrompts
|
||||
|
||||
|
||||
class UnifiedDiffPrompts(CoderPrompts):
|
||||
main_system = """Act as an expert software developer.
|
||||
{lazy_prompt}
|
||||
{final_reminders}
|
||||
Always use best practices when coding.
|
||||
Respect and use existing conventions, libraries, etc that are already present in the code base.
|
||||
|
||||
@@ -106,5 +107,9 @@ To move code within a file, use 2 hunks: 1 to delete it from its current locatio
|
||||
|
||||
To make a new file, show a diff from `--- /dev/null` to `+++ path/to/new/file.ext`.
|
||||
|
||||
{lazy_prompt}
|
||||
{final_reminders}
|
||||
"""
|
||||
|
||||
shell_cmd_prompt = shell.shell_cmd_prompt
|
||||
no_shell_cmd_prompt = shell.no_shell_cmd_prompt
|
||||
shell_cmd_reminder = shell.shell_cmd_reminder
|
||||
|
||||
14
aider/coders/udiff_simple.py
Normal file
14
aider/coders/udiff_simple.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from .udiff_coder import UnifiedDiffCoder
|
||||
from .udiff_simple_prompts import UnifiedDiffSimplePrompts
|
||||
|
||||
|
||||
class UnifiedDiffSimpleCoder(UnifiedDiffCoder):
|
||||
"""
|
||||
A coder that uses unified diff format for code modifications.
|
||||
This variant uses a simpler prompt that doesn't mention specific
|
||||
diff rules like using `@@ ... @@` lines or avoiding line numbers.
|
||||
"""
|
||||
|
||||
edit_format = "udiff-simple"
|
||||
|
||||
gpt_prompts = UnifiedDiffSimplePrompts()
|
||||
25
aider/coders/udiff_simple_prompts.py
Normal file
25
aider/coders/udiff_simple_prompts.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from .udiff_prompts import UnifiedDiffPrompts
|
||||
|
||||
|
||||
class UnifiedDiffSimplePrompts(UnifiedDiffPrompts):
|
||||
"""
|
||||
Prompts for the UnifiedDiffSimpleCoder.
|
||||
Inherits from UnifiedDiffPrompts and can override specific prompts
|
||||
if a simpler wording is desired for this edit format.
|
||||
"""
|
||||
|
||||
example_messages = []
|
||||
|
||||
system_reminder = """# File editing rules:
|
||||
|
||||
Return edits similar to unified diffs that `diff -U0` would produce.
|
||||
|
||||
The user's patch tool needs CORRECT patches that apply cleanly against the current contents of the file!
|
||||
Think carefully and make sure you include and mark all lines that need to be removed or changed as `-` lines.
|
||||
Make sure you mark all new or modified lines with `+`.
|
||||
Don't leave out any lines or the diff patch won't apply correctly.
|
||||
|
||||
To make a new file, show a diff from `--- /dev/null` to `+++ path/to/new/file.ext`.
|
||||
|
||||
{final_reminders}
|
||||
""" # noqa
|
||||
@@ -10,7 +10,7 @@ If the request is ambiguous, ask questions.
|
||||
|
||||
Always reply to the user in {language}.
|
||||
|
||||
{lazy_prompt}
|
||||
{final_reminders}
|
||||
Once you understand the request you MUST:
|
||||
1. Determine if any code changes are needed.
|
||||
2. Explain any needed changes.
|
||||
@@ -61,7 +61,7 @@ To suggest changes to a file you MUST return a *file listing* that contains the
|
||||
*NEVER* skip, omit or elide content from a *file listing* using "..." or by adding comments like "... rest of code..."!
|
||||
Create a new file you MUST return a *file listing* which includes an appropriate filename, including any appropriate path.
|
||||
|
||||
{lazy_prompt}
|
||||
{final_reminders}
|
||||
"""
|
||||
|
||||
redacted_edit_message = "No changes are needed."
|
||||
|
||||
@@ -47,6 +47,7 @@ class Commands:
|
||||
parser=self.parser,
|
||||
verbose=self.verbose,
|
||||
editor=self.editor,
|
||||
original_read_only_fnames=self.original_read_only_fnames,
|
||||
)
|
||||
|
||||
def __init__(
|
||||
@@ -87,6 +88,11 @@ class Commands:
|
||||
"Switch the Main Model to a new LLM"
|
||||
|
||||
model_name = args.strip()
|
||||
if not model_name:
|
||||
announcements = "\n".join(self.coder.get_announcements())
|
||||
self.io.tool_output(announcements)
|
||||
return
|
||||
|
||||
model = models.Model(
|
||||
model_name,
|
||||
editor_model=self.coder.main_model.editor_model.name,
|
||||
@@ -220,12 +226,18 @@ class Commands:
|
||||
|
||||
self.io.tool_output(f"Scraping {url}...")
|
||||
if not self.scraper:
|
||||
res = install_playwright(self.io)
|
||||
if not res:
|
||||
self.io.tool_warning("Unable to initialize playwright.")
|
||||
disable_playwright = getattr(self.args, "disable_playwright", False)
|
||||
if disable_playwright:
|
||||
res = False
|
||||
else:
|
||||
res = install_playwright(self.io)
|
||||
if not res:
|
||||
self.io.tool_warning("Unable to initialize playwright.")
|
||||
|
||||
self.scraper = Scraper(
|
||||
print_error=self.io.tool_error, playwright_available=res, verify_ssl=self.verify_ssl
|
||||
print_error=self.io.tool_error,
|
||||
playwright_available=res,
|
||||
verify_ssl=self.verify_ssl,
|
||||
)
|
||||
|
||||
content = self.scraper.scrape(url) or ""
|
||||
@@ -339,7 +351,7 @@ class Commands:
|
||||
return
|
||||
|
||||
commit_message = args.strip() if args else None
|
||||
self.coder.repo.commit(message=commit_message)
|
||||
self.coder.repo.commit(message=commit_message, coder=self.coder)
|
||||
|
||||
def cmd_lint(self, args="", fnames=None):
|
||||
"Lint and fix in-chat files or all dirty files if none in chat"
|
||||
@@ -400,6 +412,7 @@ class Commands:
|
||||
"Clear the chat history"
|
||||
|
||||
self._clear_chat_history()
|
||||
self.io.tool_output("All chat history cleared.")
|
||||
|
||||
def _drop_all_files(self):
|
||||
self.coder.abs_fnames = set()
|
||||
@@ -556,6 +569,7 @@ class Commands:
|
||||
|
||||
last_commit_hash = self.coder.repo.get_head_commit_sha(short=True)
|
||||
last_commit_message = self.coder.repo.get_head_commit_message("(unknown)").strip()
|
||||
last_commit_message = (last_commit_message.splitlines() or [""])[0]
|
||||
if last_commit_hash not in self.coder.aider_commit_hashes:
|
||||
self.io.tool_error("The last commit was not made by aider in this chat session.")
|
||||
self.io.tool_output(
|
||||
@@ -634,6 +648,7 @@ class Commands:
|
||||
# Get the current HEAD after undo
|
||||
current_head_hash = self.coder.repo.get_head_commit_sha(short=True)
|
||||
current_head_message = self.coder.repo.get_head_commit_message("(unknown)").strip()
|
||||
current_head_message = (current_head_message.splitlines() or [""])[0]
|
||||
self.io.tool_output(f"Now at: {current_head_hash} {current_head_message}")
|
||||
|
||||
if self.coder.main_model.send_undo_reply:
|
||||
@@ -837,7 +852,11 @@ class Commands:
|
||||
)
|
||||
continue
|
||||
|
||||
if self.coder.repo and self.coder.repo.git_ignored_file(matched_file):
|
||||
if (
|
||||
self.coder.repo
|
||||
and self.coder.repo.git_ignored_file(matched_file)
|
||||
and not self.coder.add_gitignore_files
|
||||
):
|
||||
self.io.tool_error(f"Can't add {matched_file} which is in gitignore")
|
||||
continue
|
||||
|
||||
@@ -1305,12 +1324,23 @@ class Commands:
|
||||
# First collect all expanded paths
|
||||
for pattern in filenames:
|
||||
expanded_pattern = expanduser(pattern)
|
||||
if os.path.isabs(expanded_pattern):
|
||||
# For absolute paths, glob it
|
||||
matches = list(glob.glob(expanded_pattern))
|
||||
path_obj = Path(expanded_pattern)
|
||||
is_abs = path_obj.is_absolute()
|
||||
if not is_abs:
|
||||
path_obj = Path(self.coder.root) / path_obj
|
||||
|
||||
matches = []
|
||||
# Check for literal path existence first
|
||||
if path_obj.exists():
|
||||
matches = [path_obj]
|
||||
else:
|
||||
# For relative paths and globs, use glob from the root directory
|
||||
matches = list(Path(self.coder.root).glob(expanded_pattern))
|
||||
# If literal path doesn't exist, try globbing
|
||||
if is_abs:
|
||||
# For absolute paths, glob it
|
||||
matches = [Path(p) for p in glob.glob(expanded_pattern)]
|
||||
else:
|
||||
# For relative paths and globs, use glob from the root directory
|
||||
matches = list(Path(self.coder.root).glob(expanded_pattern))
|
||||
|
||||
if not matches:
|
||||
self.io.tool_error(f"No matches found for: {pattern}")
|
||||
@@ -1385,7 +1415,30 @@ class Commands:
|
||||
"Print out the current settings"
|
||||
settings = format_settings(self.parser, self.args)
|
||||
announcements = "\n".join(self.coder.get_announcements())
|
||||
|
||||
# Build metadata for the active models (main, editor, weak)
|
||||
model_sections = []
|
||||
active_models = [
|
||||
("Main model", self.coder.main_model),
|
||||
("Editor model", getattr(self.coder.main_model, "editor_model", None)),
|
||||
("Weak model", getattr(self.coder.main_model, "weak_model", None)),
|
||||
]
|
||||
for label, model in active_models:
|
||||
if not model:
|
||||
continue
|
||||
info = getattr(model, "info", {}) or {}
|
||||
if not info:
|
||||
continue
|
||||
model_sections.append(f"{label} ({model.name}):")
|
||||
for k, v in sorted(info.items()):
|
||||
model_sections.append(f" {k}: {v}")
|
||||
model_sections.append("") # blank line between models
|
||||
|
||||
model_metadata = "\n".join(model_sections)
|
||||
|
||||
output = f"{announcements}\n{settings}"
|
||||
if model_metadata:
|
||||
output += "\n" + model_metadata
|
||||
self.io.tool_output(output)
|
||||
|
||||
def completions_raw_load(self, document, complete_event):
|
||||
@@ -1507,7 +1560,7 @@ class Commands:
|
||||
return self.cmd_editor(args)
|
||||
|
||||
def cmd_think_tokens(self, args):
|
||||
"Set the thinking token budget (supports formats like 8096, 8k, 10.5k, 0.5M)"
|
||||
"""Set the thinking token budget, eg: 8096, 8k, 10.5k, 0.5M, or 0 to disable."""
|
||||
model = self.coder.main_model
|
||||
|
||||
if not args.strip():
|
||||
@@ -1525,10 +1578,16 @@ class Commands:
|
||||
value = args.strip()
|
||||
model.set_thinking_tokens(value)
|
||||
|
||||
formatted_budget = model.get_thinking_tokens()
|
||||
budget = model.get_raw_thinking_tokens()
|
||||
# Handle the special case of 0 to disable thinking tokens
|
||||
if value == "0":
|
||||
self.io.tool_output("Thinking tokens disabled.")
|
||||
else:
|
||||
formatted_budget = model.get_thinking_tokens()
|
||||
budget = model.get_raw_thinking_tokens()
|
||||
self.io.tool_output(
|
||||
f"Set thinking token budget to {budget:,} tokens ({formatted_budget})."
|
||||
)
|
||||
|
||||
self.io.tool_output(f"Set thinking token budget to {budget:,} tokens ({formatted_budget}).")
|
||||
self.io.tool_output()
|
||||
|
||||
# Output announcements
|
||||
|
||||
@@ -11,7 +11,7 @@ from aider.coders import Coder
|
||||
from aider.dump import dump # noqa: F401
|
||||
from aider.io import InputOutput
|
||||
from aider.main import main as cli_main
|
||||
from aider.scrape import Scraper
|
||||
from aider.scrape import Scraper, has_playwright
|
||||
|
||||
|
||||
class CaptureIO(InputOutput):
|
||||
@@ -484,7 +484,7 @@ class GUI:
|
||||
url = self.web_content
|
||||
|
||||
if not self.state.scraper:
|
||||
self.scraper = Scraper(print_error=self.info)
|
||||
self.scraper = Scraper(print_error=self.info, playwright_available=has_playwright())
|
||||
|
||||
content = self.scraper.scrape(url) or ""
|
||||
if content.strip():
|
||||
|
||||
@@ -63,37 +63,37 @@ class ChatSummary:
|
||||
if split_index <= min_split:
|
||||
return self.summarize_all(messages)
|
||||
|
||||
head = messages[:split_index]
|
||||
# Split head and tail
|
||||
tail = messages[split_index:]
|
||||
|
||||
sized = sized[:split_index]
|
||||
head.reverse()
|
||||
sized.reverse()
|
||||
# Only size the head once
|
||||
sized_head = sized[:split_index]
|
||||
|
||||
# Precompute token limit (fallback to 4096 if undefined)
|
||||
model_max_input_tokens = self.models[0].info.get("max_input_tokens") or 4096
|
||||
model_max_input_tokens -= 512 # reserve buffer for safety
|
||||
|
||||
keep = []
|
||||
total = 0
|
||||
|
||||
# These sometimes come set with value = None
|
||||
model_max_input_tokens = self.models[0].info.get("max_input_tokens") or 4096
|
||||
model_max_input_tokens -= 512
|
||||
|
||||
for i in range(split_index):
|
||||
total += sized[i][0]
|
||||
# Iterate in original order, summing tokens until limit
|
||||
for tokens, msg in sized_head:
|
||||
total += tokens
|
||||
if total > model_max_input_tokens:
|
||||
break
|
||||
keep.append(head[i])
|
||||
|
||||
keep.reverse()
|
||||
keep.append(msg)
|
||||
# No need to reverse lists back and forth
|
||||
|
||||
summary = self.summarize_all(keep)
|
||||
|
||||
tail_tokens = sum(tokens for tokens, msg in sized[split_index:])
|
||||
# If the combined summary and tail still fits, return directly
|
||||
summary_tokens = self.token_count(summary)
|
||||
|
||||
result = summary + tail
|
||||
tail_tokens = sum(tokens for tokens, _ in sized[split_index:])
|
||||
if summary_tokens + tail_tokens < self.max_tokens:
|
||||
return result
|
||||
return summary + tail
|
||||
|
||||
return self.summarize_real(result, depth + 1)
|
||||
# Otherwise recurse with increased depth
|
||||
return self.summarize_real(summary + tail, depth + 1)
|
||||
|
||||
def summarize_all(self, messages):
|
||||
content = ""
|
||||
|
||||
35
aider/io.py
35
aider/io.py
@@ -308,6 +308,12 @@ class InputOutput:
|
||||
self.yes = yes
|
||||
|
||||
self.input_history_file = input_history_file
|
||||
if self.input_history_file:
|
||||
try:
|
||||
Path(self.input_history_file).parent.mkdir(parents=True, exist_ok=True)
|
||||
except (PermissionError, OSError) as e:
|
||||
self.tool_warning(f"Could not create directory for input history: {e}")
|
||||
self.input_history_file = None
|
||||
self.llm_history_file = llm_history_file
|
||||
if chat_history_file is not None:
|
||||
self.chat_history_file = Path(chat_history_file)
|
||||
@@ -595,7 +601,7 @@ class InputOutput:
|
||||
current_text = buffer.text
|
||||
|
||||
# Open the editor with the current text
|
||||
edited_text = pipe_editor(input_data=current_text)
|
||||
edited_text = pipe_editor(input_data=current_text, suffix="md")
|
||||
|
||||
# Replace the buffer with the edited text, strip any trailing newlines
|
||||
buffer.text = edited_text.rstrip("\n")
|
||||
@@ -749,9 +755,14 @@ class InputOutput:
|
||||
if not self.llm_history_file:
|
||||
return
|
||||
timestamp = datetime.now().isoformat(timespec="seconds")
|
||||
with open(self.llm_history_file, "a", encoding=self.encoding) as log_file:
|
||||
log_file.write(f"{role.upper()} {timestamp}\n")
|
||||
log_file.write(content + "\n")
|
||||
try:
|
||||
Path(self.llm_history_file).parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(self.llm_history_file, "a", encoding="utf-8") as log_file:
|
||||
log_file.write(f"{role.upper()} {timestamp}\n")
|
||||
log_file.write(content + "\n")
|
||||
except (PermissionError, OSError) as err:
|
||||
self.tool_warning(f"Unable to write to llm history file {self.llm_history_file}: {err}")
|
||||
self.llm_history_file = None
|
||||
|
||||
def display_user_input(self, inp):
|
||||
if self.pretty and self.user_input_color:
|
||||
@@ -1001,7 +1012,11 @@ class InputOutput:
|
||||
self.console.print(*messages, style=style)
|
||||
|
||||
def get_assistant_mdstream(self):
|
||||
mdargs = dict(style=self.assistant_output_color, code_theme=self.code_theme)
|
||||
mdargs = dict(
|
||||
style=self.assistant_output_color,
|
||||
code_theme=self.code_theme,
|
||||
inline_code_lexer="text",
|
||||
)
|
||||
mdStream = MarkdownStream(mdargs=mdargs)
|
||||
return mdStream
|
||||
|
||||
@@ -1112,6 +1127,7 @@ class InputOutput:
|
||||
text += "\n"
|
||||
if self.chat_history_file is not None:
|
||||
try:
|
||||
self.chat_history_file.parent.mkdir(parents=True, exist_ok=True)
|
||||
with self.chat_history_file.open("a", encoding=self.encoding, errors="ignore") as f:
|
||||
f.write(text)
|
||||
except (PermissionError, OSError) as err:
|
||||
@@ -1144,18 +1160,19 @@ class InputOutput:
|
||||
ro_paths = []
|
||||
for rel_path in read_only_files:
|
||||
abs_path = os.path.abspath(os.path.join(self.root, rel_path))
|
||||
ro_paths.append(abs_path if len(abs_path) < len(rel_path) else rel_path)
|
||||
ro_paths.append(Text(abs_path if len(abs_path) < len(rel_path) else rel_path))
|
||||
|
||||
files_with_label = ["Readonly:"] + ro_paths
|
||||
files_with_label = [Text("Readonly:")] + ro_paths
|
||||
read_only_output = StringIO()
|
||||
Console(file=read_only_output, force_terminal=False).print(Columns(files_with_label))
|
||||
read_only_lines = read_only_output.getvalue().splitlines()
|
||||
console.print(Columns(files_with_label))
|
||||
|
||||
if editable_files:
|
||||
files_with_label = editable_files
|
||||
text_editable_files = [Text(f) for f in editable_files]
|
||||
files_with_label = text_editable_files
|
||||
if read_only_files:
|
||||
files_with_label = ["Editable:"] + editable_files
|
||||
files_with_label = [Text("Editable:")] + text_editable_files
|
||||
editable_output = StringIO()
|
||||
Console(file=editable_output, force_terminal=False).print(Columns(files_with_label))
|
||||
editable_lines = editable_output.getvalue().splitlines()
|
||||
|
||||
@@ -4,10 +4,10 @@ import subprocess
|
||||
import sys
|
||||
import traceback
|
||||
import warnings
|
||||
import shlex
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
import oslex
|
||||
from grep_ast import TreeContext, filename_to_lang
|
||||
from grep_ast.tsl import get_parser # noqa: E402
|
||||
|
||||
@@ -45,7 +45,7 @@ class Linter:
|
||||
return fname
|
||||
|
||||
def run_cmd(self, cmd, rel_fname, code):
|
||||
cmd += " " + shlex.quote(rel_fname)
|
||||
cmd += " " + oslex.quote(rel_fname)
|
||||
|
||||
returncode = 0
|
||||
stdout = ""
|
||||
|
||||
@@ -14,6 +14,7 @@ except ImportError:
|
||||
git = None
|
||||
|
||||
import importlib_resources
|
||||
import shtab
|
||||
from dotenv import load_dotenv
|
||||
from prompt_toolkit.enums import EditingMode
|
||||
|
||||
@@ -502,6 +503,12 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||
# Parse again to include any arguments that might have been defined in .env
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
if args.shell_completions:
|
||||
# Ensure parser.prog is set for shtab, though it should be by default
|
||||
parser.prog = "aider"
|
||||
print(shtab.complete(parser, shell=args.shell_completions))
|
||||
sys.exit(0)
|
||||
|
||||
if git is None:
|
||||
args.git = False
|
||||
|
||||
@@ -626,7 +633,12 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||
)
|
||||
os.environ["OPENAI_ORGANIZATION"] = args.openai_organization_id
|
||||
|
||||
analytics = Analytics(logfile=args.analytics_log, permanently_disable=args.analytics_disable)
|
||||
analytics = Analytics(
|
||||
logfile=args.analytics_log,
|
||||
permanently_disable=args.analytics_disable,
|
||||
posthog_host=args.analytics_posthog_host,
|
||||
posthog_project_api_key=args.analytics_posthog_project_api_key,
|
||||
)
|
||||
if args.analytics is not False:
|
||||
if analytics.need_to_ask(args.analytics):
|
||||
io.tool_output(
|
||||
@@ -857,7 +869,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||
)
|
||||
|
||||
if args.copy_paste and args.edit_format is None:
|
||||
if main_model.edit_format in ("diff", "whole"):
|
||||
if main_model.edit_format in ("diff", "whole", "diff-fenced"):
|
||||
main_model.edit_format = "editor-" + main_model.edit_format
|
||||
|
||||
if args.verbose:
|
||||
@@ -904,6 +916,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||
commit_prompt=args.commit_prompt,
|
||||
subtree_only=args.subtree_only,
|
||||
git_commit_verify=args.git_commit_verify,
|
||||
attribute_co_authored_by=args.attribute_co_authored_by, # Pass the arg
|
||||
)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
@@ -913,8 +926,9 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||
analytics.event("exit", reason="Repository sanity check failed")
|
||||
return 1
|
||||
|
||||
if repo:
|
||||
analytics.event("repo", num_files=len(repo.get_tracked_files()))
|
||||
if repo and not args.skip_sanity_check_repo:
|
||||
num_files = len(repo.get_tracked_files())
|
||||
analytics.event("repo", num_files=num_files)
|
||||
else:
|
||||
analytics.event("no-repo")
|
||||
|
||||
@@ -985,9 +999,11 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||
num_cache_warming_pings=args.cache_keepalive_pings,
|
||||
suggest_shell_commands=args.suggest_shell_commands,
|
||||
chat_language=args.chat_language,
|
||||
commit_language=args.commit_language,
|
||||
detect_urls=args.detect_urls,
|
||||
auto_copy_context=args.copy_paste,
|
||||
auto_accept_architect=args.auto_accept_architect,
|
||||
add_gitignore_files=args.add_gitignore_files,
|
||||
)
|
||||
except UnknownEditFormat as err:
|
||||
io.tool_error(str(err))
|
||||
|
||||
@@ -115,9 +115,9 @@ class MarkdownStream:
|
||||
else:
|
||||
self.mdargs = dict()
|
||||
|
||||
# Initialize rich Live display with empty text
|
||||
self.live = Live(Text(""), refresh_per_second=1.0 / self.min_delay)
|
||||
self.live.start()
|
||||
# Defer Live creation until the first update.
|
||||
self.live = None
|
||||
self._live_started = False
|
||||
|
||||
def _render_markdown_to_lines(self, text):
|
||||
"""Render markdown text to a list of lines.
|
||||
@@ -163,6 +163,12 @@ class MarkdownStream:
|
||||
Markdown going to the console works better in terminal scrollback buffers.
|
||||
The live window doesn't play nice with terminal scrollback.
|
||||
"""
|
||||
# On the first call, stop the spinner and start the Live renderer
|
||||
if not getattr(self, "_live_started", False):
|
||||
self.live = Live(Text(""), refresh_per_second=1.0 / self.min_delay)
|
||||
self.live.start()
|
||||
self._live_started = True
|
||||
|
||||
now = time.time()
|
||||
# Throttle updates to maintain smooth rendering
|
||||
if not final and now - self.when < self.min_delay:
|
||||
|
||||
265
aider/models.py
265
aider/models.py
@@ -8,6 +8,7 @@ import platform
|
||||
import sys
|
||||
import time
|
||||
from dataclasses import dataclass, fields
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Optional, Union
|
||||
|
||||
@@ -15,8 +16,10 @@ import json5
|
||||
import yaml
|
||||
from PIL import Image
|
||||
|
||||
from aider import __version__
|
||||
from aider.dump import dump # noqa: F401
|
||||
from aider.llm import litellm
|
||||
from aider.openrouter import OpenRouterModelManager
|
||||
from aider.sendchat import ensure_alternating_roles, sanity_check_messages
|
||||
from aider.utils import check_pip_install_extra
|
||||
|
||||
@@ -69,6 +72,8 @@ claude-3-opus-20240229
|
||||
claude-3-sonnet-20240229
|
||||
claude-3-5-sonnet-20240620
|
||||
claude-3-5-sonnet-20241022
|
||||
claude-sonnet-4-20250514
|
||||
claude-opus-4-20250514
|
||||
"""
|
||||
|
||||
ANTHROPIC_MODELS = [ln.strip() for ln in ANTHROPIC_MODELS.splitlines() if ln.strip()]
|
||||
@@ -76,9 +81,9 @@ ANTHROPIC_MODELS = [ln.strip() for ln in ANTHROPIC_MODELS.splitlines() if ln.str
|
||||
# Mapping of model aliases to their canonical names
|
||||
MODEL_ALIASES = {
|
||||
# Claude models
|
||||
"sonnet": "anthropic/claude-3-7-sonnet-20250219",
|
||||
"sonnet": "anthropic/claude-sonnet-4-20250514",
|
||||
"haiku": "claude-3-5-haiku-20241022",
|
||||
"opus": "claude-3-opus-20240229",
|
||||
"opus": "claude-opus-4-20250514",
|
||||
# GPT models
|
||||
"4": "gpt-4-0613",
|
||||
"4o": "gpt-4o",
|
||||
@@ -88,12 +93,15 @@ MODEL_ALIASES = {
|
||||
"3": "gpt-3.5-turbo",
|
||||
# Other models
|
||||
"deepseek": "deepseek/deepseek-chat",
|
||||
"flash": "gemini/gemini-2.0-flash-exp",
|
||||
"flash": "gemini/gemini-2.5-flash",
|
||||
"flash-lite": "gemini/gemini-2.5-flash-lite",
|
||||
"quasar": "openrouter/openrouter/quasar-alpha",
|
||||
"r1": "deepseek/deepseek-reasoner",
|
||||
"gemini-2.5-pro": "gemini/gemini-2.5-pro-exp-03-25",
|
||||
"gemini": "gemini/gemini-2.5-pro-preview-03-25",
|
||||
"gemini-2.5-pro": "gemini/gemini-2.5-pro",
|
||||
"gemini": "gemini/gemini-2.5-pro",
|
||||
"gemini-exp": "gemini/gemini-2.5-pro-exp-03-25",
|
||||
"grok3": "xai/grok-3-beta",
|
||||
"optimus": "openrouter/openrouter/optimus-alpha",
|
||||
}
|
||||
# Model metadata loaded from resources and user's files.
|
||||
|
||||
@@ -147,8 +155,13 @@ class ModelInfoManager:
|
||||
self.verify_ssl = True
|
||||
self._cache_loaded = False
|
||||
|
||||
# Manager for the cached OpenRouter model database
|
||||
self.openrouter_manager = OpenRouterModelManager()
|
||||
|
||||
def set_verify_ssl(self, verify_ssl):
|
||||
self.verify_ssl = verify_ssl
|
||||
if hasattr(self, "openrouter_manager"):
|
||||
self.openrouter_manager.set_verify_ssl(verify_ssl)
|
||||
|
||||
def _load_cache(self):
|
||||
if self._cache_loaded:
|
||||
@@ -229,8 +242,68 @@ class ModelInfoManager:
|
||||
if litellm_info:
|
||||
return litellm_info
|
||||
|
||||
if not cached_info and model.startswith("openrouter/"):
|
||||
# First try using the locally cached OpenRouter model database
|
||||
openrouter_info = self.openrouter_manager.get_model_info(model)
|
||||
if openrouter_info:
|
||||
return openrouter_info
|
||||
|
||||
# Fallback to legacy web-scraping if the API cache does not contain the model
|
||||
openrouter_info = self.fetch_openrouter_model_info(model)
|
||||
if openrouter_info:
|
||||
return openrouter_info
|
||||
|
||||
return cached_info
|
||||
|
||||
def fetch_openrouter_model_info(self, model):
|
||||
"""
|
||||
Fetch model info by scraping the openrouter model page.
|
||||
Expected URL: https://openrouter.ai/<model_route>
|
||||
Example: openrouter/qwen/qwen-2.5-72b-instruct:free
|
||||
Returns a dict with keys: max_tokens, max_input_tokens, max_output_tokens,
|
||||
input_cost_per_token, output_cost_per_token.
|
||||
"""
|
||||
url_part = model[len("openrouter/") :]
|
||||
url = "https://openrouter.ai/" + url_part
|
||||
try:
|
||||
import requests
|
||||
|
||||
response = requests.get(url, timeout=5, verify=self.verify_ssl)
|
||||
if response.status_code != 200:
|
||||
return {}
|
||||
html = response.text
|
||||
import re
|
||||
|
||||
if re.search(
|
||||
rf"The model\s*.*{re.escape(url_part)}.* is not available", html, re.IGNORECASE
|
||||
):
|
||||
print(f"\033[91mError: Model '{url_part}' is not available\033[0m")
|
||||
return {}
|
||||
text = re.sub(r"<[^>]+>", " ", html)
|
||||
context_match = re.search(r"([\d,]+)\s*context", text)
|
||||
if context_match:
|
||||
context_str = context_match.group(1).replace(",", "")
|
||||
context_size = int(context_str)
|
||||
else:
|
||||
context_size = None
|
||||
input_cost_match = re.search(r"\$\s*([\d.]+)\s*/M input tokens", text, re.IGNORECASE)
|
||||
output_cost_match = re.search(r"\$\s*([\d.]+)\s*/M output tokens", text, re.IGNORECASE)
|
||||
input_cost = float(input_cost_match.group(1)) / 1000000 if input_cost_match else None
|
||||
output_cost = float(output_cost_match.group(1)) / 1000000 if output_cost_match else None
|
||||
if context_size is None or input_cost is None or output_cost is None:
|
||||
return {}
|
||||
params = {
|
||||
"max_input_tokens": context_size,
|
||||
"max_tokens": context_size,
|
||||
"max_output_tokens": context_size,
|
||||
"input_cost_per_token": input_cost,
|
||||
"output_cost_per_token": output_cost,
|
||||
}
|
||||
return params
|
||||
except Exception as e:
|
||||
print("Error fetching openrouter info:", str(e))
|
||||
return {}
|
||||
|
||||
|
||||
model_info_manager = ModelInfoManager()
|
||||
|
||||
@@ -312,7 +385,11 @@ class Model(ModelSettings):
|
||||
self.apply_generic_model_settings(model)
|
||||
|
||||
# Apply override settings last if they exist
|
||||
if self.extra_model_settings and self.extra_model_settings.extra_params:
|
||||
if (
|
||||
self.extra_model_settings
|
||||
and self.extra_model_settings.extra_params
|
||||
and self.extra_model_settings.name == "aider/extra_params"
|
||||
):
|
||||
# Initialize extra_params if it doesn't exist
|
||||
if not self.extra_params:
|
||||
self.extra_params = {}
|
||||
@@ -326,12 +403,44 @@ class Model(ModelSettings):
|
||||
# For non-dict values, simply update
|
||||
self.extra_params[key] = value
|
||||
|
||||
# Ensure OpenRouter models accept thinking_tokens and reasoning_effort
|
||||
if self.name.startswith("openrouter/"):
|
||||
if self.accepts_settings is None:
|
||||
self.accepts_settings = []
|
||||
if "thinking_tokens" not in self.accepts_settings:
|
||||
self.accepts_settings.append("thinking_tokens")
|
||||
if "reasoning_effort" not in self.accepts_settings:
|
||||
self.accepts_settings.append("reasoning_effort")
|
||||
|
||||
def apply_generic_model_settings(self, model):
|
||||
if "/o3-mini" in model:
|
||||
self.edit_format = "diff"
|
||||
self.use_repo_map = True
|
||||
self.use_temperature = False
|
||||
self.system_prompt_prefix = "Formatting re-enabled. "
|
||||
self.system_prompt_prefix = "Formatting re-enabled. "
|
||||
if "reasoning_effort" not in self.accepts_settings:
|
||||
self.accepts_settings.append("reasoning_effort")
|
||||
return # <--
|
||||
|
||||
if "gpt-4.1-mini" in model:
|
||||
self.edit_format = "diff"
|
||||
self.use_repo_map = True
|
||||
self.reminder = "sys"
|
||||
self.examples_as_sys_msg = False
|
||||
return # <--
|
||||
|
||||
if "gpt-4.1" in model:
|
||||
self.edit_format = "diff"
|
||||
self.use_repo_map = True
|
||||
self.reminder = "sys"
|
||||
self.examples_as_sys_msg = False
|
||||
return # <--
|
||||
|
||||
last_segment = model.split("/")[-1]
|
||||
if last_segment in ("gpt-5", "gpt-5-2025-08-07"):
|
||||
self.use_temperature = False
|
||||
self.edit_format = "diff"
|
||||
if "reasoning_effort" not in self.accepts_settings:
|
||||
self.accepts_settings.append("reasoning_effort")
|
||||
return # <--
|
||||
@@ -439,6 +548,14 @@ class Model(ModelSettings):
|
||||
self.extra_params = dict(top_p=0.95)
|
||||
return # <--
|
||||
|
||||
if "qwen3" in model and "235b" in model:
|
||||
self.edit_format = "diff"
|
||||
self.use_repo_map = True
|
||||
self.system_prompt_prefix = "/no_think"
|
||||
self.use_temperature = 0.7
|
||||
self.extra_params = {"top_p": 0.8, "top_k": 20, "min_p": 0.0}
|
||||
return # <--
|
||||
|
||||
# use the defaults
|
||||
if self.edit_format == "diff":
|
||||
self.use_repo_map = True
|
||||
@@ -486,6 +603,8 @@ class Model(ModelSettings):
|
||||
|
||||
if not self.editor_edit_format:
|
||||
self.editor_edit_format = self.editor_model.edit_format
|
||||
if self.editor_edit_format in ("diff", "whole", "diff-fenced"):
|
||||
self.editor_edit_format = "editor-" + self.editor_edit_format
|
||||
|
||||
return self.editor_model
|
||||
|
||||
@@ -636,11 +755,18 @@ class Model(ModelSettings):
|
||||
def set_reasoning_effort(self, effort):
|
||||
"""Set the reasoning effort parameter for models that support it"""
|
||||
if effort is not None:
|
||||
if not self.extra_params:
|
||||
self.extra_params = {}
|
||||
if "extra_body" not in self.extra_params:
|
||||
self.extra_params["extra_body"] = {}
|
||||
self.extra_params["extra_body"]["reasoning_effort"] = effort
|
||||
if self.name.startswith("openrouter/"):
|
||||
if not self.extra_params:
|
||||
self.extra_params = {}
|
||||
if "extra_body" not in self.extra_params:
|
||||
self.extra_params["extra_body"] = {}
|
||||
self.extra_params["extra_body"]["reasoning"] = {"effort": effort}
|
||||
else:
|
||||
if not self.extra_params:
|
||||
self.extra_params = {}
|
||||
if "extra_body" not in self.extra_params:
|
||||
self.extra_params["extra_body"] = {}
|
||||
self.extra_params["extra_body"]["reasoning_effort"] = effort
|
||||
|
||||
def parse_token_value(self, value):
|
||||
"""
|
||||
@@ -677,6 +803,7 @@ class Model(ModelSettings):
|
||||
"""
|
||||
Set the thinking token budget for models that support it.
|
||||
Accepts formats: 8096, "8k", "10.5k", "0.5M", "10K", etc.
|
||||
Pass "0" to disable thinking tokens.
|
||||
"""
|
||||
if value is not None:
|
||||
num_tokens = self.parse_token_value(value)
|
||||
@@ -686,9 +813,19 @@ class Model(ModelSettings):
|
||||
|
||||
# OpenRouter models use 'reasoning' instead of 'thinking'
|
||||
if self.name.startswith("openrouter/"):
|
||||
self.extra_params["reasoning"] = {"max_tokens": num_tokens}
|
||||
if "extra_body" not in self.extra_params:
|
||||
self.extra_params["extra_body"] = {}
|
||||
if num_tokens > 0:
|
||||
self.extra_params["extra_body"]["reasoning"] = {"max_tokens": num_tokens}
|
||||
else:
|
||||
if "reasoning" in self.extra_params["extra_body"]:
|
||||
del self.extra_params["extra_body"]["reasoning"]
|
||||
else:
|
||||
self.extra_params["thinking"] = {"type": "enabled", "budget_tokens": num_tokens}
|
||||
if num_tokens > 0:
|
||||
self.extra_params["thinking"] = {"type": "enabled", "budget_tokens": num_tokens}
|
||||
else:
|
||||
if "thinking" in self.extra_params:
|
||||
del self.extra_params["thinking"]
|
||||
|
||||
def get_raw_thinking_tokens(self):
|
||||
"""Get formatted thinking token budget if available"""
|
||||
@@ -696,8 +833,13 @@ class Model(ModelSettings):
|
||||
|
||||
if self.extra_params:
|
||||
# Check for OpenRouter reasoning format
|
||||
if "reasoning" in self.extra_params and "max_tokens" in self.extra_params["reasoning"]:
|
||||
budget = self.extra_params["reasoning"]["max_tokens"]
|
||||
if self.name.startswith("openrouter/"):
|
||||
if (
|
||||
"extra_body" in self.extra_params
|
||||
and "reasoning" in self.extra_params["extra_body"]
|
||||
and "max_tokens" in self.extra_params["extra_body"]["reasoning"]
|
||||
):
|
||||
budget = self.extra_params["extra_body"]["reasoning"]["max_tokens"]
|
||||
# Check for standard thinking format
|
||||
elif (
|
||||
"thinking" in self.extra_params and "budget_tokens" in self.extra_params["thinking"]
|
||||
@@ -727,12 +869,21 @@ class Model(ModelSettings):
|
||||
|
||||
def get_reasoning_effort(self):
|
||||
"""Get reasoning effort value if available"""
|
||||
if (
|
||||
self.extra_params
|
||||
and "extra_body" in self.extra_params
|
||||
and "reasoning_effort" in self.extra_params["extra_body"]
|
||||
):
|
||||
return self.extra_params["extra_body"]["reasoning_effort"]
|
||||
if self.extra_params:
|
||||
# Check for OpenRouter reasoning format
|
||||
if self.name.startswith("openrouter/"):
|
||||
if (
|
||||
"extra_body" in self.extra_params
|
||||
and "reasoning" in self.extra_params["extra_body"]
|
||||
and "effort" in self.extra_params["extra_body"]["reasoning"]
|
||||
):
|
||||
return self.extra_params["extra_body"]["reasoning"]["effort"]
|
||||
# Check for standard reasoning_effort format (e.g. in extra_body)
|
||||
elif (
|
||||
"extra_body" in self.extra_params
|
||||
and "reasoning_effort" in self.extra_params["extra_body"]
|
||||
):
|
||||
return self.extra_params["extra_body"]["reasoning_effort"]
|
||||
return None
|
||||
|
||||
def is_deepseek_r1(self):
|
||||
@@ -744,6 +895,57 @@ class Model(ModelSettings):
|
||||
def is_ollama(self):
|
||||
return self.name.startswith("ollama/") or self.name.startswith("ollama_chat/")
|
||||
|
||||
def github_copilot_token_to_open_ai_key(self, extra_headers):
|
||||
# check to see if there's an openai api key
|
||||
# If so, check to see if it's expire
|
||||
openai_api_key = "OPENAI_API_KEY"
|
||||
|
||||
if openai_api_key not in os.environ or (
|
||||
int(dict(x.split("=") for x in os.environ[openai_api_key].split(";"))["exp"])
|
||||
< int(datetime.now().timestamp())
|
||||
):
|
||||
import requests
|
||||
|
||||
class GitHubCopilotTokenError(Exception):
|
||||
"""Custom exception for GitHub Copilot token-related errors."""
|
||||
|
||||
pass
|
||||
|
||||
# Validate GitHub Copilot token exists
|
||||
if "GITHUB_COPILOT_TOKEN" not in os.environ:
|
||||
raise KeyError("GITHUB_COPILOT_TOKEN environment variable not found")
|
||||
|
||||
github_token = os.environ["GITHUB_COPILOT_TOKEN"]
|
||||
if not github_token.strip():
|
||||
raise KeyError("GITHUB_COPILOT_TOKEN environment variable is empty")
|
||||
|
||||
headers = {
|
||||
"Authorization": f"Bearer {os.environ['GITHUB_COPILOT_TOKEN']}",
|
||||
"Editor-Version": extra_headers["Editor-Version"],
|
||||
"Copilot-Integration-Id": extra_headers["Copilot-Integration-Id"],
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
url = "https://api.github.com/copilot_internal/v2/token"
|
||||
res = requests.get(url, headers=headers)
|
||||
if res.status_code != 200:
|
||||
safe_headers = {k: v for k, v in headers.items() if k != "Authorization"}
|
||||
token_preview = github_token[:5] + "..." if len(github_token) >= 5 else github_token
|
||||
safe_headers["Authorization"] = f"Bearer {token_preview}"
|
||||
raise GitHubCopilotTokenError(
|
||||
f"GitHub Copilot API request failed (Status: {res.status_code})\n"
|
||||
f"URL: {url}\n"
|
||||
f"Headers: {json.dumps(safe_headers, indent=2)}\n"
|
||||
f"JSON: {res.text}"
|
||||
)
|
||||
|
||||
response_data = res.json()
|
||||
token = response_data.get("token")
|
||||
if not token:
|
||||
raise GitHubCopilotTokenError("Response missing 'token' field")
|
||||
|
||||
os.environ[openai_api_key] = token
|
||||
|
||||
def send_completion(self, messages, functions, stream, temperature=None):
|
||||
if os.environ.get("AIDER_SANITY_CHECK_TURNS"):
|
||||
sanity_check_messages(messages)
|
||||
@@ -785,6 +987,16 @@ class Model(ModelSettings):
|
||||
dump(kwargs)
|
||||
kwargs["messages"] = messages
|
||||
|
||||
# Are we using github copilot?
|
||||
if "GITHUB_COPILOT_TOKEN" in os.environ:
|
||||
if "extra_headers" not in kwargs:
|
||||
kwargs["extra_headers"] = {
|
||||
"Editor-Version": f"aider/{__version__}",
|
||||
"Copilot-Integration-Id": "vscode-chat",
|
||||
}
|
||||
|
||||
self.github_copilot_token_to_open_ai_key(kwargs["extra_headers"])
|
||||
|
||||
res = litellm.completion(**kwargs)
|
||||
return hash_object, res
|
||||
|
||||
@@ -796,6 +1008,9 @@ class Model(ModelSettings):
|
||||
messages = ensure_alternating_roles(messages)
|
||||
retry_delay = 0.125
|
||||
|
||||
if self.verbose:
|
||||
dump(messages)
|
||||
|
||||
while True:
|
||||
try:
|
||||
kwargs = {
|
||||
@@ -846,12 +1061,10 @@ def register_models(model_settings_fnames):
|
||||
|
||||
for model_settings_dict in model_settings_list:
|
||||
model_settings = ModelSettings(**model_settings_dict)
|
||||
existing_model_settings = next(
|
||||
(ms for ms in MODEL_SETTINGS if ms.name == model_settings.name), None
|
||||
)
|
||||
|
||||
if existing_model_settings:
|
||||
MODEL_SETTINGS.remove(existing_model_settings)
|
||||
# Remove all existing settings for this model name
|
||||
MODEL_SETTINGS[:] = [ms for ms in MODEL_SETTINGS if ms.name != model_settings.name]
|
||||
# Add the new settings
|
||||
MODEL_SETTINGS.append(model_settings)
|
||||
except Exception as e:
|
||||
raise Exception(f"Error loading model settings from {model_settings_fname}: {e}")
|
||||
|
||||
@@ -55,9 +55,9 @@ def try_to_select_default_model():
|
||||
# Check if the user is on a free tier
|
||||
is_free_tier = check_openrouter_tier(openrouter_key)
|
||||
if is_free_tier:
|
||||
return "openrouter/google/gemini-2.5-pro-exp-03-25:free"
|
||||
return "openrouter/deepseek/deepseek-r1:free"
|
||||
else:
|
||||
return "openrouter/anthropic/claude-3.7-sonnet"
|
||||
return "openrouter/anthropic/claude-sonnet-4"
|
||||
|
||||
# Select model based on other available API keys
|
||||
model_key_pairs = [
|
||||
|
||||
128
aider/openrouter.py
Normal file
128
aider/openrouter.py
Normal file
@@ -0,0 +1,128 @@
|
||||
"""
|
||||
OpenRouter model metadata caching and lookup.
|
||||
|
||||
This module keeps a local cached copy of the OpenRouter model list
|
||||
(downloaded from ``https://openrouter.ai/api/v1/models``) and exposes a
|
||||
helper class that returns metadata for a given model in a format compatible
|
||||
with litellm’s ``get_model_info``.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import time
|
||||
from pathlib import Path
|
||||
from typing import Dict
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
def _cost_per_token(val: str | None) -> float | None:
|
||||
"""Convert a price string (USD per token) to a float."""
|
||||
if val in (None, "", "0"):
|
||||
return 0.0 if val == "0" else None
|
||||
try:
|
||||
return float(val)
|
||||
except Exception: # noqa: BLE001
|
||||
return None
|
||||
|
||||
|
||||
class OpenRouterModelManager:
|
||||
MODELS_URL = "https://openrouter.ai/api/v1/models"
|
||||
CACHE_TTL = 60 * 60 * 24 # 24 h
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.cache_dir = Path.home() / ".aider" / "caches"
|
||||
self.cache_file = self.cache_dir / "openrouter_models.json"
|
||||
self.content: Dict | None = None
|
||||
self.verify_ssl: bool = True
|
||||
self._cache_loaded = False
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# Public API #
|
||||
# ------------------------------------------------------------------ #
|
||||
def set_verify_ssl(self, verify_ssl: bool) -> None:
|
||||
"""Enable/disable SSL verification for API requests."""
|
||||
self.verify_ssl = verify_ssl
|
||||
|
||||
def get_model_info(self, model: str) -> Dict:
|
||||
"""
|
||||
Return metadata for *model* or an empty ``dict`` when unknown.
|
||||
|
||||
``model`` should use the aider naming convention, e.g.
|
||||
``openrouter/nousresearch/deephermes-3-mistral-24b-preview:free``.
|
||||
"""
|
||||
self._ensure_content()
|
||||
if not self.content or "data" not in self.content:
|
||||
return {}
|
||||
|
||||
route = self._strip_prefix(model)
|
||||
|
||||
# Consider both the exact id and id without any “:suffix”.
|
||||
candidates = {route}
|
||||
if ":" in route:
|
||||
candidates.add(route.split(":", 1)[0])
|
||||
|
||||
record = next((item for item in self.content["data"] if item.get("id") in candidates), None)
|
||||
if not record:
|
||||
return {}
|
||||
|
||||
context_len = (
|
||||
record.get("top_provider", {}).get("context_length")
|
||||
or record.get("context_length")
|
||||
or None
|
||||
)
|
||||
|
||||
pricing = record.get("pricing", {})
|
||||
return {
|
||||
"max_input_tokens": context_len,
|
||||
"max_tokens": context_len,
|
||||
"max_output_tokens": context_len,
|
||||
"input_cost_per_token": _cost_per_token(pricing.get("prompt")),
|
||||
"output_cost_per_token": _cost_per_token(pricing.get("completion")),
|
||||
"litellm_provider": "openrouter",
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# Internal helpers #
|
||||
# ------------------------------------------------------------------ #
|
||||
def _strip_prefix(self, model: str) -> str:
|
||||
return model[len("openrouter/") :] if model.startswith("openrouter/") else model
|
||||
|
||||
def _ensure_content(self) -> None:
|
||||
self._load_cache()
|
||||
if not self.content:
|
||||
self._update_cache()
|
||||
|
||||
def _load_cache(self) -> None:
|
||||
if self._cache_loaded:
|
||||
return
|
||||
try:
|
||||
self.cache_dir.mkdir(parents=True, exist_ok=True)
|
||||
if self.cache_file.exists():
|
||||
cache_age = time.time() - self.cache_file.stat().st_mtime
|
||||
if cache_age < self.CACHE_TTL:
|
||||
try:
|
||||
self.content = json.loads(self.cache_file.read_text())
|
||||
except json.JSONDecodeError:
|
||||
self.content = None
|
||||
except OSError:
|
||||
# Cache directory might be unwritable; ignore.
|
||||
pass
|
||||
|
||||
self._cache_loaded = True
|
||||
|
||||
def _update_cache(self) -> None:
|
||||
try:
|
||||
response = requests.get(self.MODELS_URL, timeout=10, verify=self.verify_ssl)
|
||||
if response.status_code == 200:
|
||||
self.content = response.json()
|
||||
try:
|
||||
self.cache_file.write_text(json.dumps(self.content, indent=2))
|
||||
except OSError:
|
||||
pass # Non-fatal if we can’t write the cache
|
||||
except Exception as ex: # noqa: BLE001
|
||||
print(f"Failed to fetch OpenRouter model list: {ex}")
|
||||
try:
|
||||
self.cache_file.write_text("{}")
|
||||
except OSError:
|
||||
pass
|
||||
@@ -13,13 +13,12 @@ Generate a one-line commit message for those changes.
|
||||
The commit message should be structured as follows: <type>: <description>
|
||||
Use these for <type>: fix, feat, build, chore, ci, docs, style, refactor, perf, test
|
||||
|
||||
Ensure the commit message:
|
||||
Ensure the commit message:{language_instruction}
|
||||
- Starts with the appropriate prefix.
|
||||
- Is in the imperative mood (e.g., \"Add feature\" not \"Added feature\" or \"Adding feature\").
|
||||
- Is in the imperative mood (e.g., \"add feature\" not \"added feature\" or \"adding feature\").
|
||||
- Does not exceed 72 characters.
|
||||
|
||||
Reply only with the one-line commit message, without any additional text, explanations, \
|
||||
or line breaks.
|
||||
Reply only with the one-line commit message, without any additional text, explanations, or line breaks.
|
||||
"""
|
||||
|
||||
# COMMANDS
|
||||
|
||||
7
aider/queries/tree-sitter-language-pack/clojure-tags.scm
Normal file
7
aider/queries/tree-sitter-language-pack/clojure-tags.scm
Normal file
@@ -0,0 +1,7 @@
|
||||
(list_lit
|
||||
meta: _*
|
||||
. (sym_lit name: (sym_name) @ignore)
|
||||
. (sym_lit name: (sym_name) @name.definition.method)
|
||||
(#match? @ignore "^def.*"))
|
||||
|
||||
(sym_lit name: (sym_name) @name.reference.call)
|
||||
10
aider/queries/tree-sitter-language-pack/matlab-tags.scm
Normal file
10
aider/queries/tree-sitter-language-pack/matlab-tags.scm
Normal file
@@ -0,0 +1,10 @@
|
||||
(class_definition
|
||||
name: (identifier) @name.definition.class) @definition.class
|
||||
|
||||
(function_definition
|
||||
name: (identifier) @name.definition.function) @definition.function
|
||||
|
||||
(function_call
|
||||
name: (identifier) @name.reference.call) @reference.call
|
||||
|
||||
(command (command_name) @name.reference.call) @reference.call
|
||||
115
aider/queries/tree-sitter-language-pack/ocaml-tags.scm
Normal file
115
aider/queries/tree-sitter-language-pack/ocaml-tags.scm
Normal file
@@ -0,0 +1,115 @@
|
||||
; Modules
|
||||
;--------
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(module_definition (module_binding (module_name) @name.definition.module) @definition.module)
|
||||
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
||||
)
|
||||
|
||||
(module_path (module_name) @name.reference.module) @reference.module
|
||||
|
||||
; Module types
|
||||
;--------------
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(module_type_definition (module_type_name) @name.definition.interface) @definition.interface
|
||||
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
||||
)
|
||||
|
||||
(module_type_path (module_type_name) @name.reference.implementation) @reference.implementation
|
||||
|
||||
; Functions
|
||||
;----------
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(value_definition
|
||||
[
|
||||
(let_binding
|
||||
pattern: (value_name) @name.definition.function
|
||||
(parameter))
|
||||
(let_binding
|
||||
pattern: (value_name) @name.definition.function
|
||||
body: [(fun_expression) (function_expression)])
|
||||
] @definition.function
|
||||
)
|
||||
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
||||
)
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(external (value_name) @name.definition.function) @definition.function
|
||||
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
||||
)
|
||||
|
||||
(application_expression
|
||||
function: (value_path (value_name) @name.reference.call)) @reference.call
|
||||
|
||||
(infix_expression
|
||||
left: (value_path (value_name) @name.reference.call)
|
||||
operator: (concat_operator) @reference.call
|
||||
(#eq? @reference.call "@@"))
|
||||
|
||||
(infix_expression
|
||||
operator: (rel_operator) @reference.call
|
||||
right: (value_path (value_name) @name.reference.call)
|
||||
(#eq? @reference.call "|>"))
|
||||
|
||||
; Operator
|
||||
;---------
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(value_definition
|
||||
(let_binding
|
||||
pattern: (parenthesized_operator (_) @name.definition.function)) @definition.function)
|
||||
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
||||
)
|
||||
|
||||
[
|
||||
(prefix_operator)
|
||||
(sign_operator)
|
||||
(pow_operator)
|
||||
(mult_operator)
|
||||
(add_operator)
|
||||
(concat_operator)
|
||||
(rel_operator)
|
||||
(and_operator)
|
||||
(or_operator)
|
||||
(assign_operator)
|
||||
(hash_operator)
|
||||
(indexing_operator)
|
||||
(let_operator)
|
||||
(let_and_operator)
|
||||
(match_operator)
|
||||
] @name.reference.call @reference.call
|
||||
|
||||
; Classes
|
||||
;--------
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
[
|
||||
(class_definition (class_binding (class_name) @name.definition.class) @definition.class)
|
||||
(class_type_definition (class_type_binding (class_type_name) @name.definition.class) @definition.class)
|
||||
]
|
||||
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
||||
)
|
||||
|
||||
[
|
||||
(class_path (class_name) @name.reference.class)
|
||||
(class_type_path (class_type_name) @name.reference.class)
|
||||
] @reference.class
|
||||
|
||||
; Methods
|
||||
;--------
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(method_definition (method_name) @name.definition.method) @definition.method
|
||||
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
||||
)
|
||||
|
||||
(method_invocation (method_name) @name.reference.call) @reference.call
|
||||
@@ -0,0 +1,98 @@
|
||||
; Modules
|
||||
;--------
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(module_definition
|
||||
(module_binding (module_name) @name) @definition.module
|
||||
)
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
|
||||
(module_path (module_name) @name) @reference.module
|
||||
(extended_module_path (module_name) @name) @reference.module
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(module_type_definition (module_type_name) @name) @definition.interface
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
|
||||
(module_type_path (module_type_name) @name) @reference.implementation
|
||||
|
||||
|
||||
; Classes
|
||||
;--------
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
[
|
||||
(class_definition
|
||||
(class_binding (class_name) @name) @definition.class
|
||||
)
|
||||
(class_type_definition
|
||||
(class_type_binding (class_type_name) @name) @definition.class
|
||||
)
|
||||
]
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
|
||||
[
|
||||
(class_path (class_name) @name)
|
||||
(class_type_path (class_type_name) @name)
|
||||
] @reference.class
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(method_definition (method_name) @name) @definition.method
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
|
||||
(method_invocation (method_name) @name) @reference.call
|
||||
|
||||
|
||||
; Types
|
||||
;------
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(type_definition
|
||||
(type_binding
|
||||
name: [
|
||||
(type_constructor) @name
|
||||
(type_constructor_path (type_constructor) @name)
|
||||
]
|
||||
) @definition.type
|
||||
)
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
|
||||
(type_constructor_path (type_constructor) @name) @reference.type
|
||||
|
||||
[
|
||||
(constructor_declaration (constructor_name) @name)
|
||||
(tag_specification (tag) @name)
|
||||
] @definition.enum_variant
|
||||
|
||||
[
|
||||
(constructor_path (constructor_name) @name)
|
||||
(tag) @name
|
||||
] @reference.enum_variant
|
||||
|
||||
(field_declaration (field_name) @name) @definition.field
|
||||
|
||||
(field_path (field_name) @name) @reference.field
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(external (value_name) @name) @definition.function
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(value_specification
|
||||
(value_name) @name.definition.function
|
||||
) @definition.function
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
10
aider/queries/tree-sitter-languages/matlab-tags.scm
Normal file
10
aider/queries/tree-sitter-languages/matlab-tags.scm
Normal file
@@ -0,0 +1,10 @@
|
||||
(class_definition
|
||||
name: (identifier) @name.definition.class) @definition.class
|
||||
|
||||
(function_definition
|
||||
name: (identifier) @name.definition.function) @definition.function
|
||||
|
||||
(function_call
|
||||
name: (identifier) @name.reference.call) @reference.call
|
||||
|
||||
(command (command_name) @name.reference.call) @reference.call
|
||||
98
aider/queries/tree-sitter-languages/ocaml_interface-tags.scm
Normal file
98
aider/queries/tree-sitter-languages/ocaml_interface-tags.scm
Normal file
@@ -0,0 +1,98 @@
|
||||
; Modules
|
||||
;--------
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(module_definition
|
||||
(module_binding (module_name) @name) @definition.module
|
||||
)
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
|
||||
(module_path (module_name) @name) @reference.module
|
||||
(extended_module_path (module_name) @name) @reference.module
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(module_type_definition (module_type_name) @name) @definition.interface
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
|
||||
(module_type_path (module_type_name) @name) @reference.implementation
|
||||
|
||||
|
||||
; Classes
|
||||
;--------
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
[
|
||||
(class_definition
|
||||
(class_binding (class_name) @name) @definition.class
|
||||
)
|
||||
(class_type_definition
|
||||
(class_type_binding (class_type_name) @name) @definition.class
|
||||
)
|
||||
]
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
|
||||
[
|
||||
(class_path (class_name) @name)
|
||||
(class_type_path (class_type_name) @name)
|
||||
] @reference.class
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(method_definition (method_name) @name) @definition.method
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
|
||||
(method_invocation (method_name) @name) @reference.call
|
||||
|
||||
|
||||
; Types
|
||||
;------
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(type_definition
|
||||
(type_binding
|
||||
name: [
|
||||
(type_constructor) @name
|
||||
(type_constructor_path (type_constructor) @name)
|
||||
]
|
||||
) @definition.type
|
||||
)
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
|
||||
(type_constructor_path (type_constructor) @name) @reference.type
|
||||
|
||||
[
|
||||
(constructor_declaration (constructor_name) @name)
|
||||
(tag_specification (tag) @name)
|
||||
] @definition.enum_variant
|
||||
|
||||
[
|
||||
(constructor_path (constructor_name) @name)
|
||||
(tag) @name
|
||||
] @reference.enum_variant
|
||||
|
||||
(field_declaration (field_name) @name) @definition.field
|
||||
|
||||
(field_path (field_name) @name) @reference.field
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(external (value_name) @name) @definition.function
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
|
||||
(
|
||||
(comment)? @doc .
|
||||
(value_specification
|
||||
(value_name) @name.definition.function
|
||||
) @definition.function
|
||||
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
||||
)
|
||||
257
aider/repo.py
257
aider/repo.py
@@ -1,3 +1,4 @@
|
||||
import contextlib
|
||||
import os
|
||||
import time
|
||||
from pathlib import Path, PurePosixPath
|
||||
@@ -20,6 +21,7 @@ import pathspec
|
||||
from aider import prompts, utils
|
||||
|
||||
from .dump import dump # noqa: F401
|
||||
from .waiting import WaitingSpinner
|
||||
|
||||
ANY_GIT_ERROR += [
|
||||
OSError,
|
||||
@@ -34,6 +36,19 @@ ANY_GIT_ERROR += [
|
||||
ANY_GIT_ERROR = tuple(ANY_GIT_ERROR)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def set_git_env(var_name, value, original_value):
|
||||
"""Temporarily set a Git environment variable."""
|
||||
os.environ[var_name] = value
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
if original_value is not None:
|
||||
os.environ[var_name] = original_value
|
||||
elif var_name in os.environ:
|
||||
del os.environ[var_name]
|
||||
|
||||
|
||||
class GitRepo:
|
||||
repo = None
|
||||
aider_ignore_file = None
|
||||
@@ -58,6 +73,7 @@ class GitRepo:
|
||||
commit_prompt=None,
|
||||
subtree_only=False,
|
||||
git_commit_verify=True,
|
||||
attribute_co_authored_by=False, # Added parameter
|
||||
):
|
||||
self.io = io
|
||||
self.models = models
|
||||
@@ -69,6 +85,7 @@ class GitRepo:
|
||||
self.attribute_committer = attribute_committer
|
||||
self.attribute_commit_message_author = attribute_commit_message_author
|
||||
self.attribute_commit_message_committer = attribute_commit_message_committer
|
||||
self.attribute_co_authored_by = attribute_co_authored_by # Assign from parameter
|
||||
self.commit_prompt = commit_prompt
|
||||
self.subtree_only = subtree_only
|
||||
self.git_commit_verify = git_commit_verify
|
||||
@@ -111,7 +128,76 @@ class GitRepo:
|
||||
if aider_ignore_file:
|
||||
self.aider_ignore_file = Path(aider_ignore_file)
|
||||
|
||||
def commit(self, fnames=None, context=None, message=None, aider_edits=False):
|
||||
def commit(self, fnames=None, context=None, message=None, aider_edits=False, coder=None):
|
||||
"""
|
||||
Commit the specified files or all dirty files if none are specified.
|
||||
|
||||
Args:
|
||||
fnames (list, optional): List of filenames to commit. Defaults to None (commit all
|
||||
dirty files).
|
||||
context (str, optional): Context for generating commit message. Defaults to None.
|
||||
message (str, optional): Explicit commit message. Defaults to None (generate message).
|
||||
aider_edits (bool, optional): Whether the changes were made by Aider. Defaults to False.
|
||||
This affects attribution logic.
|
||||
coder (Coder, optional): The Coder instance, used for config and model info.
|
||||
Defaults to None.
|
||||
|
||||
Returns:
|
||||
tuple(str, str) or None: The commit hash and commit message if successful,
|
||||
else None.
|
||||
|
||||
Attribution Logic:
|
||||
------------------
|
||||
This method handles Git commit attribution based on configuration flags and whether
|
||||
Aider generated the changes (`aider_edits`).
|
||||
|
||||
Key Concepts:
|
||||
- Author: The person who originally wrote the code changes.
|
||||
- Committer: The person who last applied the commit to the repository.
|
||||
- aider_edits=True: Changes were generated by Aider (LLM).
|
||||
- aider_edits=False: Commit is user-driven (e.g., /commit manually staged changes).
|
||||
- Explicit Setting: A flag (--attribute-...) is set to True or False
|
||||
via command line or config file.
|
||||
- Implicit Default: A flag is not explicitly set, defaulting to None in args, which is
|
||||
interpreted as True unless overridden by other logic.
|
||||
|
||||
Flags:
|
||||
- --attribute-author: Modify Author name to "User Name (aider)".
|
||||
- --attribute-committer: Modify Committer name to "User Name (aider)".
|
||||
- --attribute-co-authored-by: Add
|
||||
"Co-authored-by: aider (<model>) <aider@aider.chat>" trailer to commit message.
|
||||
|
||||
Behavior Summary:
|
||||
|
||||
1. When aider_edits = True (AI Changes):
|
||||
- If --attribute-co-authored-by=True:
|
||||
- Co-authored-by trailer IS ADDED.
|
||||
- Author/Committer names are NOT modified by default (co-authored-by takes precedence).
|
||||
- EXCEPTION: If --attribute-author/--attribute-committer is EXPLICITLY True, the
|
||||
respective name IS modified (explicit overrides precedence).
|
||||
- If --attribute-co-authored-by=False:
|
||||
- Co-authored-by trailer is NOT added.
|
||||
- Author/Committer names ARE modified by default (implicit True).
|
||||
- EXCEPTION: If --attribute-author/--attribute-committer is EXPLICITLY False,
|
||||
the respective name is NOT modified.
|
||||
|
||||
2. When aider_edits = False (User Changes):
|
||||
- --attribute-co-authored-by is IGNORED (trailer never added).
|
||||
- Author name is NEVER modified (--attribute-author ignored).
|
||||
- Committer name IS modified by default (implicit True, as Aider runs `git commit`).
|
||||
- EXCEPTION: If --attribute-committer is EXPLICITLY False, the name is NOT modified.
|
||||
|
||||
Resulting Scenarios:
|
||||
- Standard AI edit (defaults): Co-authored-by=False -> Author=You(aider),
|
||||
Committer=You(aider)
|
||||
- AI edit with Co-authored-by (default): Co-authored-by=True -> Author=You,
|
||||
Committer=You, Trailer added
|
||||
- AI edit with Co-authored-by + Explicit Author: Co-authored-by=True,
|
||||
--attribute-author -> Author=You(aider), Committer=You, Trailer added
|
||||
- User commit (defaults): aider_edits=False -> Author=You, Committer=You(aider)
|
||||
- User commit with explicit no-committer: aider_edits=False,
|
||||
--no-attribute-committer -> Author=You, Committer=You
|
||||
"""
|
||||
if not fnames and not self.repo.is_dirty():
|
||||
return
|
||||
|
||||
@@ -122,19 +208,71 @@ class GitRepo:
|
||||
if message:
|
||||
commit_message = message
|
||||
else:
|
||||
commit_message = self.get_commit_message(diffs, context)
|
||||
user_language = None
|
||||
if coder:
|
||||
user_language = coder.commit_language
|
||||
if not user_language:
|
||||
user_language = coder.get_user_language()
|
||||
commit_message = self.get_commit_message(diffs, context, user_language)
|
||||
|
||||
if aider_edits and self.attribute_commit_message_author:
|
||||
commit_message = "aider: " + commit_message
|
||||
elif self.attribute_commit_message_committer:
|
||||
commit_message = "aider: " + commit_message
|
||||
# Retrieve attribute settings, prioritizing coder.args if available
|
||||
if coder and hasattr(coder, "args"):
|
||||
attribute_author = coder.args.attribute_author
|
||||
attribute_committer = coder.args.attribute_committer
|
||||
attribute_commit_message_author = coder.args.attribute_commit_message_author
|
||||
attribute_commit_message_committer = coder.args.attribute_commit_message_committer
|
||||
attribute_co_authored_by = coder.args.attribute_co_authored_by
|
||||
else:
|
||||
# Fallback to self attributes (initialized from config/defaults)
|
||||
attribute_author = self.attribute_author
|
||||
attribute_committer = self.attribute_committer
|
||||
attribute_commit_message_author = self.attribute_commit_message_author
|
||||
attribute_commit_message_committer = self.attribute_commit_message_committer
|
||||
attribute_co_authored_by = self.attribute_co_authored_by
|
||||
|
||||
# Determine explicit settings (None means use default behavior)
|
||||
author_explicit = attribute_author is not None
|
||||
committer_explicit = attribute_committer is not None
|
||||
|
||||
# Determine effective settings (apply default True if not explicit)
|
||||
effective_author = True if attribute_author is None else attribute_author
|
||||
effective_committer = True if attribute_committer is None else attribute_committer
|
||||
|
||||
# Determine commit message prefixing
|
||||
prefix_commit_message = aider_edits and (
|
||||
attribute_commit_message_author or attribute_commit_message_committer
|
||||
)
|
||||
|
||||
# Determine Co-authored-by trailer
|
||||
commit_message_trailer = ""
|
||||
if aider_edits and attribute_co_authored_by:
|
||||
model_name = "unknown-model"
|
||||
if coder and hasattr(coder, "main_model") and coder.main_model.name:
|
||||
model_name = coder.main_model.name
|
||||
commit_message_trailer = f"\n\nCo-authored-by: aider ({model_name}) <aider@aider.chat>"
|
||||
|
||||
# Determine if author/committer names should be modified
|
||||
# Author modification applies only to aider edits.
|
||||
# It's used if effective_author is True AND
|
||||
# (co-authored-by is False OR author was explicitly set).
|
||||
use_attribute_author = (
|
||||
aider_edits and effective_author and (not attribute_co_authored_by or author_explicit)
|
||||
)
|
||||
|
||||
# Committer modification applies regardless of aider_edits (based on tests).
|
||||
# It's used if effective_committer is True AND
|
||||
# (it's not an aider edit with co-authored-by OR committer was explicitly set).
|
||||
use_attribute_committer = effective_committer and (
|
||||
not (aider_edits and attribute_co_authored_by) or committer_explicit
|
||||
)
|
||||
|
||||
if not commit_message:
|
||||
commit_message = "(no commit message provided)"
|
||||
|
||||
full_commit_message = commit_message
|
||||
# if context:
|
||||
# full_commit_message += "\n\n# Aider chat conversation:\n\n" + context
|
||||
if prefix_commit_message:
|
||||
commit_message = "aider: " + commit_message
|
||||
|
||||
full_commit_message = commit_message + commit_message_trailer
|
||||
|
||||
cmd = ["-m", full_commit_message]
|
||||
if not self.git_commit_verify:
|
||||
@@ -152,36 +290,32 @@ class GitRepo:
|
||||
|
||||
original_user_name = self.repo.git.config("--get", "user.name")
|
||||
original_committer_name_env = os.environ.get("GIT_COMMITTER_NAME")
|
||||
original_author_name_env = os.environ.get("GIT_AUTHOR_NAME")
|
||||
committer_name = f"{original_user_name} (aider)"
|
||||
|
||||
if self.attribute_committer:
|
||||
os.environ["GIT_COMMITTER_NAME"] = committer_name
|
||||
|
||||
if aider_edits and self.attribute_author:
|
||||
original_author_name_env = os.environ.get("GIT_AUTHOR_NAME")
|
||||
os.environ["GIT_AUTHOR_NAME"] = committer_name
|
||||
|
||||
try:
|
||||
self.repo.git.commit(cmd)
|
||||
commit_hash = self.get_head_commit_sha(short=True)
|
||||
self.io.tool_output(f"Commit {commit_hash} {commit_message}", bold=True)
|
||||
return commit_hash, commit_message
|
||||
# Use context managers to handle environment variables
|
||||
with contextlib.ExitStack() as stack:
|
||||
if use_attribute_committer:
|
||||
stack.enter_context(
|
||||
set_git_env(
|
||||
"GIT_COMMITTER_NAME", committer_name, original_committer_name_env
|
||||
)
|
||||
)
|
||||
if use_attribute_author:
|
||||
stack.enter_context(
|
||||
set_git_env("GIT_AUTHOR_NAME", committer_name, original_author_name_env)
|
||||
)
|
||||
|
||||
# Perform the commit
|
||||
self.repo.git.commit(cmd)
|
||||
commit_hash = self.get_head_commit_sha(short=True)
|
||||
self.io.tool_output(f"Commit {commit_hash} {commit_message}", bold=True)
|
||||
return commit_hash, commit_message
|
||||
|
||||
except ANY_GIT_ERROR as err:
|
||||
self.io.tool_error(f"Unable to commit: {err}")
|
||||
finally:
|
||||
# Restore the env
|
||||
|
||||
if self.attribute_committer:
|
||||
if original_committer_name_env is not None:
|
||||
os.environ["GIT_COMMITTER_NAME"] = original_committer_name_env
|
||||
else:
|
||||
del os.environ["GIT_COMMITTER_NAME"]
|
||||
|
||||
if aider_edits and self.attribute_author:
|
||||
if original_author_name_env is not None:
|
||||
os.environ["GIT_AUTHOR_NAME"] = original_author_name_env
|
||||
else:
|
||||
del os.environ["GIT_AUTHOR_NAME"]
|
||||
# No return here, implicitly returns None
|
||||
|
||||
def get_rel_repo_dir(self):
|
||||
try:
|
||||
@@ -189,7 +323,7 @@ class GitRepo:
|
||||
except (ValueError, OSError):
|
||||
return self.repo.git_dir
|
||||
|
||||
def get_commit_message(self, diffs, context):
|
||||
def get_commit_message(self, diffs, context, user_language=None):
|
||||
diffs = "# Diffs:\n" + diffs
|
||||
|
||||
content = ""
|
||||
@@ -198,20 +332,35 @@ class GitRepo:
|
||||
content += diffs
|
||||
|
||||
system_content = self.commit_prompt or prompts.commit_system
|
||||
messages = [
|
||||
dict(role="system", content=system_content),
|
||||
dict(role="user", content=content),
|
||||
]
|
||||
|
||||
language_instruction = ""
|
||||
if user_language:
|
||||
language_instruction = f"\n- Is written in {user_language}."
|
||||
system_content = system_content.format(language_instruction=language_instruction)
|
||||
|
||||
commit_message = None
|
||||
for model in self.models:
|
||||
num_tokens = model.token_count(messages)
|
||||
max_tokens = model.info.get("max_input_tokens") or 0
|
||||
if max_tokens and num_tokens > max_tokens:
|
||||
continue
|
||||
commit_message = model.simple_send_with_retries(messages)
|
||||
if commit_message:
|
||||
break
|
||||
spinner_text = f"Generating commit message with {model.name}"
|
||||
with WaitingSpinner(spinner_text):
|
||||
if model.system_prompt_prefix:
|
||||
current_system_content = model.system_prompt_prefix + "\n" + system_content
|
||||
else:
|
||||
current_system_content = system_content
|
||||
|
||||
messages = [
|
||||
dict(role="system", content=current_system_content),
|
||||
dict(role="user", content=content),
|
||||
]
|
||||
|
||||
num_tokens = model.token_count(messages)
|
||||
max_tokens = model.info.get("max_input_tokens") or 0
|
||||
|
||||
if max_tokens and num_tokens > max_tokens:
|
||||
continue
|
||||
|
||||
commit_message = model.simple_send_with_retries(messages)
|
||||
if commit_message:
|
||||
break # Found a model that could generate the message
|
||||
|
||||
if not commit_message:
|
||||
self.io.tool_error("Failed to generate commit message!")
|
||||
@@ -248,14 +397,20 @@ class GitRepo:
|
||||
try:
|
||||
if current_branch_has_commits:
|
||||
args = ["HEAD", "--"] + list(fnames)
|
||||
diffs += self.repo.git.diff(*args)
|
||||
diffs += self.repo.git.diff(*args, stdout_as_string=False).decode(
|
||||
self.io.encoding, "replace"
|
||||
)
|
||||
return diffs
|
||||
|
||||
wd_args = ["--"] + list(fnames)
|
||||
index_args = ["--cached"] + wd_args
|
||||
|
||||
diffs += self.repo.git.diff(*index_args)
|
||||
diffs += self.repo.git.diff(*wd_args)
|
||||
diffs += self.repo.git.diff(*index_args, stdout_as_string=False).decode(
|
||||
self.io.encoding, "replace"
|
||||
)
|
||||
diffs += self.repo.git.diff(*wd_args, stdout_as_string=False).decode(
|
||||
self.io.encoding, "replace"
|
||||
)
|
||||
|
||||
return diffs
|
||||
except ANY_GIT_ERROR as err:
|
||||
@@ -269,7 +424,9 @@ class GitRepo:
|
||||
args += ["--color=never"]
|
||||
|
||||
args += [from_commit, to_commit]
|
||||
diffs = self.repo.git.diff(*args)
|
||||
diffs = self.repo.git.diff(*args, stdout_as_string=False).decode(
|
||||
self.io.encoding, "replace"
|
||||
)
|
||||
|
||||
return diffs
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ from tqdm import tqdm
|
||||
|
||||
from aider.dump import dump
|
||||
from aider.special import filter_important_files
|
||||
from aider.utils import Spinner
|
||||
from aider.waiting import Spinner
|
||||
|
||||
# tree_sitter is throwing a FutureWarning
|
||||
warnings.simplefilter("ignore", category=FutureWarning)
|
||||
@@ -35,6 +35,8 @@ CACHE_VERSION = 3
|
||||
if USING_TSL_PACK:
|
||||
CACHE_VERSION = 4
|
||||
|
||||
UPDATING_REPO_MAP_MESSAGE = "Updating repo map"
|
||||
|
||||
|
||||
class RepoMap:
|
||||
TAGS_CACHE_DIR = f".aider.tags.cache.v{CACHE_VERSION}"
|
||||
@@ -380,7 +382,7 @@ class RepoMap:
|
||||
if self.verbose:
|
||||
self.io.tool_output(f"Processing {fname}")
|
||||
if progress and not showing_bar:
|
||||
progress()
|
||||
progress(f"{UPDATING_REPO_MAP_MESSAGE}: {fname}")
|
||||
|
||||
try:
|
||||
file_ok = Path(fname).is_file()
|
||||
@@ -459,17 +461,18 @@ class RepoMap:
|
||||
|
||||
for ident in idents:
|
||||
if progress:
|
||||
progress()
|
||||
progress(f"{UPDATING_REPO_MAP_MESSAGE}: {ident}")
|
||||
|
||||
definers = defines[ident]
|
||||
|
||||
mul = 1.0
|
||||
|
||||
is_snake = ("_" in ident) and any(c.isalpha() for c in ident)
|
||||
is_kebab = ("-" in ident) and any(c.isalpha() for c in ident)
|
||||
is_camel = any(c.isupper() for c in ident) and any(c.islower() for c in ident)
|
||||
if ident in mentioned_idents:
|
||||
mul *= 10
|
||||
if (is_snake or is_camel) and len(ident) >= 8:
|
||||
if (is_snake or is_kebab or is_camel) and len(ident) >= 8:
|
||||
mul *= 10
|
||||
if ident.startswith("_"):
|
||||
mul *= 0.1
|
||||
@@ -512,7 +515,7 @@ class RepoMap:
|
||||
ranked_definitions = defaultdict(float)
|
||||
for src in G.nodes:
|
||||
if progress:
|
||||
progress()
|
||||
progress(f"{UPDATING_REPO_MAP_MESSAGE}: {src}")
|
||||
|
||||
src_rank = ranked[src]
|
||||
total_weight = sum(data["weight"] for _src, _dst, data in G.out_edges(src, data=True))
|
||||
@@ -621,7 +624,7 @@ class RepoMap:
|
||||
if not mentioned_idents:
|
||||
mentioned_idents = set()
|
||||
|
||||
spin = Spinner("Updating repo map")
|
||||
spin = Spinner(UPDATING_REPO_MAP_MESSAGE)
|
||||
|
||||
ranked_tags = self.get_ranked_tags(
|
||||
chat_fnames,
|
||||
@@ -655,7 +658,11 @@ class RepoMap:
|
||||
while lower_bound <= upper_bound:
|
||||
# dump(lower_bound, middle, upper_bound)
|
||||
|
||||
spin.step()
|
||||
if middle > 1500:
|
||||
show_tokens = f"{middle / 1000.0:.1f}K"
|
||||
else:
|
||||
show_tokens = str(middle)
|
||||
spin.step(f"{UPDATING_REPO_MAP_MESSAGE}: {show_tokens} tokens")
|
||||
|
||||
tree = self.to_tree(ranked_tags[:middle], chat_rel_fnames)
|
||||
num_tokens = self.token_count(tree)
|
||||
|
||||
@@ -15,22 +15,6 @@
|
||||
//"supports_tool_choice": true,
|
||||
"supports_prompt_caching": true
|
||||
},
|
||||
"openrouter/deepseek/deepseek-r1": {
|
||||
"max_tokens": 8192,
|
||||
"max_input_tokens": 64000,
|
||||
"max_output_tokens": 8192,
|
||||
"input_cost_per_token": 0.00000055,
|
||||
"input_cost_per_token_cache_hit": 0.00000014,
|
||||
"cache_read_input_token_cost": 0.00000014,
|
||||
"cache_creation_input_token_cost": 0.0,
|
||||
"output_cost_per_token": 0.00000219,
|
||||
"litellm_provider": "openrouter",
|
||||
"mode": "chat",
|
||||
//"supports_function_calling": true,
|
||||
"supports_assistant_prefill": true,
|
||||
//"supports_tool_choice": true,
|
||||
"supports_prompt_caching": true
|
||||
},
|
||||
"openrouter/deepseek/deepseek-r1:free": {
|
||||
"max_tokens": 8192,
|
||||
"max_input_tokens": 64000,
|
||||
@@ -65,7 +49,7 @@
|
||||
},
|
||||
"openrouter/deepseek/deepseek-chat-v3-0324": {
|
||||
"max_tokens": 8192,
|
||||
"max_input_tokens": 64000,
|
||||
"max_input_tokens": 131072,
|
||||
"max_output_tokens": 8192,
|
||||
"input_cost_per_token": 0.00000055,
|
||||
"input_cost_per_token_cache_hit": 0.00000014,
|
||||
@@ -99,8 +83,8 @@
|
||||
"output_cost_per_token": 0.000008,
|
||||
"mode": "chat",
|
||||
},
|
||||
"fireworks_ai/accounts/fireworks/models/deepseek-v3": {
|
||||
"max_tokens": 128000,
|
||||
"fireworks_ai/accounts/fireworks/models/deepseek-v3-0324": {
|
||||
"max_tokens": 160000,
|
||||
"max_input_tokens": 100000,
|
||||
"max_output_tokens": 8192,
|
||||
"litellm_provider": "fireworks_ai",
|
||||
@@ -108,54 +92,6 @@
|
||||
"output_cost_per_token": 0.0000009,
|
||||
"mode": "chat",
|
||||
},
|
||||
"o3-mini": {
|
||||
"max_tokens": 100000,
|
||||
"max_input_tokens": 200000,
|
||||
"max_output_tokens": 100000,
|
||||
"input_cost_per_token": 0.0000011,
|
||||
"output_cost_per_token": 0.0000044,
|
||||
"cache_read_input_token_cost": 0.00000055,
|
||||
"litellm_provider": "openai",
|
||||
"mode": "chat",
|
||||
"supports_function_calling": true,
|
||||
"supports_parallel_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_response_schema": true
|
||||
},
|
||||
"openrouter/openai/o3-mini": {
|
||||
"max_tokens": 100000,
|
||||
"max_input_tokens": 200000,
|
||||
"max_output_tokens": 100000,
|
||||
"input_cost_per_token": 0.0000011,
|
||||
"output_cost_per_token": 0.0000044,
|
||||
"cache_read_input_token_cost": 0.00000055,
|
||||
"litellm_provider": "openrouter",
|
||||
"mode": "chat",
|
||||
"supports_function_calling": true,
|
||||
"supports_parallel_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_response_schema": true
|
||||
},
|
||||
"openrouter/openai/o3-mini-high": {
|
||||
"max_tokens": 100000,
|
||||
"max_input_tokens": 200000,
|
||||
"max_output_tokens": 100000,
|
||||
"input_cost_per_token": 0.0000011,
|
||||
"output_cost_per_token": 0.0000044,
|
||||
"cache_read_input_token_cost": 0.00000055,
|
||||
"litellm_provider": "openrouter",
|
||||
"mode": "chat",
|
||||
"supports_function_calling": true,
|
||||
"supports_parallel_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_response_schema": true
|
||||
},
|
||||
"openrouter/openrouter/quasar-alpha": {
|
||||
"max_input_tokens": 1000000,
|
||||
"max_output_tokens": 32000,
|
||||
@@ -168,6 +104,14 @@
|
||||
"supports_system_messages": true,
|
||||
"supports_prompt_caching": true
|
||||
},
|
||||
"openrouter/openrouter/optimus-alpha": {
|
||||
"max_input_tokens": 1000000,
|
||||
"max_output_tokens": 32000,
|
||||
"input_cost_per_token": 0.0,
|
||||
"output_cost_per_token": 0.0,
|
||||
"litellm_provider": "openrouter",
|
||||
"mode": "chat"
|
||||
},
|
||||
"openrouter/openai/gpt-4o-mini": {
|
||||
"max_tokens": 16384,
|
||||
"max_input_tokens": 128000,
|
||||
@@ -186,26 +130,6 @@
|
||||
"supports_prompt_caching": true,
|
||||
"supports_system_messages": true
|
||||
},
|
||||
"claude-3-7-sonnet-20250219": {
|
||||
"max_tokens": 8192,
|
||||
"max_input_tokens": 200000,
|
||||
"max_output_tokens": 8192,
|
||||
"input_cost_per_token": 0.000003,
|
||||
"output_cost_per_token": 0.000015,
|
||||
"cache_creation_input_token_cost": 0.00000375,
|
||||
"cache_read_input_token_cost": 0.0000003,
|
||||
"litellm_provider": "anthropic",
|
||||
"mode": "chat",
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"tool_use_system_prompt_tokens": 159,
|
||||
"supports_assistant_prefill": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_response_schema": true,
|
||||
"deprecation_date": "2025-10-01",
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"anthropic/claude-3-7-sonnet-20250219": {
|
||||
"max_tokens": 8192,
|
||||
"max_input_tokens": 200000,
|
||||
@@ -226,43 +150,6 @@
|
||||
"deprecation_date": "2025-10-01",
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"openrouter/anthropic/claude-3.7-sonnet": {
|
||||
"max_tokens": 8192,
|
||||
"max_input_tokens": 200000,
|
||||
"max_output_tokens": 8192,
|
||||
"input_cost_per_token": 0.000003,
|
||||
"output_cost_per_token": 0.000015,
|
||||
"cache_creation_input_token_cost": 0.00000375,
|
||||
"cache_read_input_token_cost": 0.0000003,
|
||||
"litellm_provider": "openrouter",
|
||||
"mode": "chat",
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"tool_use_system_prompt_tokens": 159,
|
||||
"supports_assistant_prefill": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_response_schema": true,
|
||||
"deprecation_date": "2025-10-01",
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"gpt-4.5-preview": {
|
||||
"max_tokens": 16384,
|
||||
"max_input_tokens": 128000,
|
||||
"max_output_tokens": 16384,
|
||||
"input_cost_per_token": 0.000075,
|
||||
"output_cost_per_token": 0.00015,
|
||||
"cache_read_input_token_cost": 0.0000375,
|
||||
"litellm_provider": "openai",
|
||||
"mode": "chat",
|
||||
"supports_function_calling": true,
|
||||
"supports_parallel_function_calling": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_vision": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"openai/gpt-4.5-preview": {
|
||||
"max_tokens": 16384,
|
||||
"max_input_tokens": 128000,
|
||||
@@ -317,42 +204,6 @@
|
||||
"supports_tool_choice": true,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
|
||||
},
|
||||
"gemini/gemini-2.5-pro-preview-03-25": {
|
||||
"max_tokens": 8192,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 64000,
|
||||
"max_images_per_prompt": 3000,
|
||||
"max_videos_per_prompt": 10,
|
||||
"max_video_length": 1,
|
||||
"max_audio_length_hours": 8.4,
|
||||
"max_audio_per_prompt": 1,
|
||||
"max_pdf_size_mb": 30,
|
||||
"input_cost_per_image": 0,
|
||||
"input_cost_per_video_per_second": 0,
|
||||
"input_cost_per_audio_per_second": 0,
|
||||
"input_cost_per_token": 0.00000125,
|
||||
"input_cost_per_character": 0,
|
||||
"input_cost_per_token_above_128k_tokens": 0,
|
||||
"input_cost_per_character_above_128k_tokens": 0,
|
||||
"input_cost_per_image_above_128k_tokens": 0,
|
||||
"input_cost_per_video_per_second_above_128k_tokens": 0,
|
||||
"input_cost_per_audio_per_second_above_128k_tokens": 0,
|
||||
"output_cost_per_token": 0.000010,
|
||||
"output_cost_per_character": 0,
|
||||
"output_cost_per_token_above_128k_tokens": 0,
|
||||
"output_cost_per_character_above_128k_tokens": 0,
|
||||
"litellm_provider": "gemini",
|
||||
"mode": "chat",
|
||||
"supports_system_messages": true,
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_audio_input": true,
|
||||
"supports_video_input": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_tool_choice": true,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
|
||||
},
|
||||
"vertex_ai/gemini-2.5-pro-exp-03-25": {
|
||||
"max_tokens": 8192,
|
||||
"max_input_tokens": 1048576,
|
||||
@@ -425,7 +276,98 @@
|
||||
"supports_tool_choice": true,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
|
||||
},
|
||||
"openrouter/google/gemini-2.5-pro-exp-03-25:free": {
|
||||
"vertex_ai/gemini-2.5-pro": {
|
||||
"max_tokens": 65536,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 65536,
|
||||
"max_images_per_prompt": 3000,
|
||||
"max_videos_per_prompt": 10,
|
||||
"max_video_length": 1,
|
||||
"max_audio_length_hours": 8.4,
|
||||
"max_audio_per_prompt": 1,
|
||||
"max_pdf_size_mb": 20,
|
||||
"input_cost_per_token": 0.00000125,
|
||||
"input_cost_per_token_above_200k_tokens": 0.0000025,
|
||||
"output_cost_per_token": 0.00001,
|
||||
"output_cost_per_token_above_200k_tokens": 0.000015,
|
||||
"litellm_provider": "vertex_ai-language-models",
|
||||
"mode": "chat",
|
||||
"rpm": 2000,
|
||||
"tpm": 8000000,
|
||||
"supports_system_messages": true,
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_audio_output": false,
|
||||
"supports_tool_choice": true,
|
||||
"supported_modalities": ["text", "image", "audio", "video"],
|
||||
"supported_output_modalities": ["text"],
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
|
||||
},
|
||||
"vertex_ai/gemini-2.5-flash": {
|
||||
"max_tokens": 65536,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 65536,
|
||||
"max_images_per_prompt": 3000,
|
||||
"max_videos_per_prompt": 10,
|
||||
"max_video_length": 1,
|
||||
"max_audio_length_hours": 8.4,
|
||||
"max_audio_per_prompt": 1,
|
||||
"max_pdf_size_mb": 20,
|
||||
"input_cost_per_token": 0.0000003,
|
||||
"input_cost_per_audio_token": 0.000001,
|
||||
"output_cost_per_token": 0.0000025,
|
||||
"litellm_provider": "vertex_ai-language-models",
|
||||
"mode": "chat",
|
||||
"rpm": 10000,
|
||||
"tpm": 8000000,
|
||||
"supports_system_messages": true,
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_audio_output": false,
|
||||
"supports_tool_choice": true,
|
||||
"supported_modalities": ["text", "image", "audio", "video"],
|
||||
"supported_output_modalities": ["text"],
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
|
||||
},
|
||||
"openrouter/google/gemini-2.5-pro-preview-03-25": {
|
||||
"max_tokens": 8192,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 64000,
|
||||
"max_images_per_prompt": 3000,
|
||||
"max_videos_per_prompt": 10,
|
||||
"max_video_length": 1,
|
||||
"max_audio_length_hours": 8.4,
|
||||
"max_audio_per_prompt": 1,
|
||||
"max_pdf_size_mb": 30,
|
||||
"input_cost_per_image": 0,
|
||||
"input_cost_per_video_per_second": 0,
|
||||
"input_cost_per_audio_per_second": 0,
|
||||
"input_cost_per_token": 0.00000125,
|
||||
"input_cost_per_character": 0,
|
||||
"input_cost_per_token_above_128k_tokens": 0,
|
||||
"input_cost_per_character_above_128k_tokens": 0,
|
||||
"input_cost_per_image_above_128k_tokens": 0,
|
||||
"input_cost_per_video_per_second_above_128k_tokens": 0,
|
||||
"input_cost_per_audio_per_second_above_128k_tokens": 0,
|
||||
"output_cost_per_token": 0.000010,
|
||||
"output_cost_per_character": 0,
|
||||
"output_cost_per_token_above_128k_tokens": 0,
|
||||
"output_cost_per_character_above_128k_tokens": 0,
|
||||
"litellm_provider": "vertex_ai-language-models",
|
||||
"mode": "chat",
|
||||
"supports_system_messages": true,
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_audio_input": true,
|
||||
"supports_video_input": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_tool_choice": true,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
|
||||
},
|
||||
"openrouter/google/gemini-2.5-pro-exp-03-25": {
|
||||
"max_tokens": 8192,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 64000,
|
||||
@@ -439,9 +381,9 @@
|
||||
"input_cost_per_video_per_second": 0,
|
||||
"input_cost_per_audio_per_second": 0,
|
||||
"input_cost_per_token": 0,
|
||||
"input_cost_per_character": 0,
|
||||
"input_cost_per_token_above_128k_tokens": 0,
|
||||
"input_cost_per_character_above_128k_tokens": 0,
|
||||
"input_cost_per_character": 0,
|
||||
"input_cost_per_token_above_128k_tokens": 0,
|
||||
"input_cost_per_character_above_128k_tokens": 0,
|
||||
"input_cost_per_image_above_128k_tokens": 0,
|
||||
"input_cost_per_video_per_second_above_128k_tokens": 0,
|
||||
"input_cost_per_audio_per_second_above_128k_tokens": 0,
|
||||
@@ -461,7 +403,79 @@
|
||||
"supports_tool_choice": true,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
|
||||
},
|
||||
"openrouter/google/gemini-2.0-flash-exp:free": {
|
||||
"openrouter/google/gemini-2.5": {
|
||||
"max_tokens": 8192,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 64000,
|
||||
"max_images_per_prompt": 3000,
|
||||
"max_videos_per_prompt": 10,
|
||||
"max_video_length": 1,
|
||||
"max_audio_length_hours": 8.4,
|
||||
"max_audio_per_prompt": 1,
|
||||
"max_pdf_size_mb": 30,
|
||||
"input_cost_per_image": 0,
|
||||
"input_cost_per_video_per_second": 0,
|
||||
"input_cost_per_audio_per_second": 0,
|
||||
"input_cost_per_token": 0,
|
||||
"input_cost_per_character": 0,
|
||||
"input_cost_per_token_above_128k_tokens": 0,
|
||||
"input_cost_per_character_above_128k_tokens": 0,
|
||||
"input_cost_per_image_above_128k_tokens": 0,
|
||||
"input_cost_per_video_per_second_above_128k_tokens": 0,
|
||||
"input_cost_per_audio_per_second_above_128k_tokens": 0,
|
||||
"output_cost_per_token": 0,
|
||||
"output_cost_per_character": 0,
|
||||
"output_cost_per_token_above_128k_tokens": 0,
|
||||
"output_cost_per_character_above_128k_tokens": 0,
|
||||
"litellm_provider": "openrouter",
|
||||
"mode": "chat",
|
||||
"supports_system_messages": true,
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_audio_input": true,
|
||||
"supports_video_input": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_tool_choice": true,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
|
||||
},
|
||||
"openrouter/x-ai/grok-3-beta": {
|
||||
"max_tokens": 131072,
|
||||
"max_input_tokens": 131072,
|
||||
"max_output_tokens": 131072,
|
||||
"input_cost_per_token": 0.000003,
|
||||
"output_cost_per_token": 0.000015,
|
||||
"litellm_provider": "openrouter",
|
||||
"mode": "chat"
|
||||
},
|
||||
"openrouter/x-ai/grok-3-mini-beta": {
|
||||
"max_tokens": 131072,
|
||||
"max_input_tokens": 131072,
|
||||
"max_output_tokens": 131072,
|
||||
"input_cost_per_token": 0.0000003,
|
||||
"output_cost_per_token": 0.0000005,
|
||||
"litellm_provider": "openrouter",
|
||||
"mode": "chat"
|
||||
},
|
||||
"openrouter/x-ai/grok-3-fast-beta": {
|
||||
"max_tokens": 131072,
|
||||
"max_input_tokens": 131072,
|
||||
"max_output_tokens": 131072,
|
||||
"input_cost_per_token": 0.000005,
|
||||
"output_cost_per_token": 0.000025,
|
||||
"litellm_provider": "openrouter",
|
||||
"mode": "chat"
|
||||
},
|
||||
"openrouter/x-ai/grok-3-mini-fast-beta": {
|
||||
"max_tokens": 131072,
|
||||
"max_input_tokens": 131072,
|
||||
"max_output_tokens": 131072,
|
||||
"input_cost_per_token": 0.0000006,
|
||||
"output_cost_per_token": 0.000004,
|
||||
"litellm_provider": "openrouter",
|
||||
"mode": "chat"
|
||||
},
|
||||
"openrouter/google/gemini-2.0-flash-exp:free": {
|
||||
"max_tokens": 8192,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 8192,
|
||||
@@ -480,4 +494,206 @@
|
||||
"supports_audio_output": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"gemini-2.5-pro-preview-05-06": {
|
||||
"max_tokens": 65536,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 65536,
|
||||
"max_images_per_prompt": 3000,
|
||||
"max_videos_per_prompt": 10,
|
||||
"max_video_length": 1,
|
||||
"max_audio_length_hours": 8.4,
|
||||
"max_audio_per_prompt": 1,
|
||||
"max_pdf_size_mb": 30,
|
||||
"input_cost_per_audio_token": 0.00000125,
|
||||
"input_cost_per_token": 0.00000125,
|
||||
"input_cost_per_token_above_200k_tokens": 0.0000025,
|
||||
"output_cost_per_token": 0.00001,
|
||||
"output_cost_per_token_above_200k_tokens": 0.000015,
|
||||
"litellm_provider": "vertex_ai-language-models",
|
||||
"mode": "chat",
|
||||
"supports_reasoning": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_audio_output": false,
|
||||
"supports_tool_choice": true,
|
||||
"supported_endpoints": ["/v1/chat/completions", "/v1/completions", "/v1/batch"],
|
||||
"supported_modalities": ["text", "image", "audio", "video"],
|
||||
"supported_output_modalities": ["text"],
|
||||
"source": "https://ai.google.dev/gemini-api/docs/models#gemini-2.5-flash-preview"
|
||||
},
|
||||
"gemini-2.5-pro-preview-06-05": {
|
||||
"max_tokens": 65536,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 65536,
|
||||
"max_images_per_prompt": 3000,
|
||||
"max_videos_per_prompt": 10,
|
||||
"max_video_length": 1,
|
||||
"max_audio_length_hours": 8.4,
|
||||
"max_audio_per_prompt": 1,
|
||||
"max_pdf_size_mb": 30,
|
||||
"input_cost_per_audio_token": 0.00000125,
|
||||
"input_cost_per_token": 0.00000125,
|
||||
"input_cost_per_token_above_200k_tokens": 0.0000025,
|
||||
"output_cost_per_token": 0.00001,
|
||||
"output_cost_per_token_above_200k_tokens": 0.000015,
|
||||
"litellm_provider": "vertex_ai-language-models",
|
||||
"mode": "chat",
|
||||
"supports_reasoning": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_audio_output": false,
|
||||
"supports_tool_choice": true,
|
||||
"supported_endpoints": ["/v1/chat/completions", "/v1/completions", "/v1/batch"],
|
||||
"supported_modalities": ["text", "image", "audio", "video"],
|
||||
"supported_output_modalities": ["text"],
|
||||
"source": "https://ai.google.dev/gemini-api/docs/models#gemini-2.5-flash-preview"
|
||||
},
|
||||
"gemini/gemini-2.5-pro-preview-05-06": {
|
||||
"max_tokens": 65536,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 65536,
|
||||
"max_images_per_prompt": 3000,
|
||||
"max_videos_per_prompt": 10,
|
||||
"max_video_length": 1,
|
||||
"max_audio_length_hours": 8.4,
|
||||
"max_audio_per_prompt": 1,
|
||||
"max_pdf_size_mb": 30,
|
||||
"input_cost_per_audio_token": 0.0000007,
|
||||
"input_cost_per_token": 0.00000125,
|
||||
"input_cost_per_token_above_200k_tokens": 0.0000025,
|
||||
"output_cost_per_token": 0.00001,
|
||||
"output_cost_per_token_above_200k_tokens": 0.000015,
|
||||
"litellm_provider": "gemini",
|
||||
"mode": "chat",
|
||||
"rpm": 10000,
|
||||
"tpm": 10000000,
|
||||
"supports_system_messages": true,
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_audio_output": false,
|
||||
"supports_tool_choice": true,
|
||||
"supported_modalities": ["text", "image", "audio", "video"],
|
||||
"supported_output_modalities": ["text"],
|
||||
"source": "https://ai.google.dev/gemini-api/docs/pricing#gemini-2.5-pro-preview"
|
||||
},
|
||||
"gemini/gemini-2.5-pro-preview-06-05": {
|
||||
"max_tokens": 65536,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 65536,
|
||||
"max_images_per_prompt": 3000,
|
||||
"max_videos_per_prompt": 10,
|
||||
"max_video_length": 1,
|
||||
"max_audio_length_hours": 8.4,
|
||||
"max_audio_per_prompt": 1,
|
||||
"max_pdf_size_mb": 30,
|
||||
"input_cost_per_audio_token": 0.0000007,
|
||||
"input_cost_per_token": 0.00000125,
|
||||
"input_cost_per_token_above_200k_tokens": 0.0000025,
|
||||
"output_cost_per_token": 0.00001,
|
||||
"output_cost_per_token_above_200k_tokens": 0.000015,
|
||||
"litellm_provider": "gemini",
|
||||
"mode": "chat",
|
||||
"rpm": 10000,
|
||||
"tpm": 10000000,
|
||||
"supports_system_messages": true,
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_audio_output": false,
|
||||
"supports_tool_choice": true,
|
||||
"supported_modalities": ["text", "image", "audio", "video"],
|
||||
"supported_output_modalities": ["text"],
|
||||
"source": "https://ai.google.dev/gemini-api/docs/pricing#gemini-2.5-pro-preview"
|
||||
},
|
||||
"gemini/gemini-2.5-pro": {
|
||||
"max_tokens": 65536,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 65536,
|
||||
"max_images_per_prompt": 3000,
|
||||
"max_videos_per_prompt": 10,
|
||||
"max_video_length": 1,
|
||||
"max_audio_length_hours": 8.4,
|
||||
"max_audio_per_prompt": 1,
|
||||
"max_pdf_size_mb": 20,
|
||||
"input_cost_per_token": 0.00000125,
|
||||
"input_cost_per_token_above_200k_tokens": 0.0000025,
|
||||
"output_cost_per_token": 0.00001,
|
||||
"output_cost_per_token_above_200k_tokens": 0.000015,
|
||||
"litellm_provider": "gemini",
|
||||
"mode": "chat",
|
||||
"rpm": 2000,
|
||||
"tpm": 8000000,
|
||||
"supports_system_messages": true,
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_audio_output": false,
|
||||
"supports_tool_choice": true,
|
||||
"supported_modalities": ["text", "image", "audio", "video"],
|
||||
"supported_output_modalities": ["text"],
|
||||
"source": "https://ai.google.dev/gemini-api/docs/pricing#gemini-2.5-pro"
|
||||
},
|
||||
"gemini/gemini-2.5-flash": {
|
||||
"max_tokens": 65536,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 65536,
|
||||
"max_images_per_prompt": 3000,
|
||||
"max_videos_per_prompt": 10,
|
||||
"max_video_length": 1,
|
||||
"max_audio_length_hours": 8.4,
|
||||
"max_audio_per_prompt": 1,
|
||||
"max_pdf_size_mb": 20,
|
||||
"input_cost_per_token": 0.00000035,
|
||||
"input_cost_per_audio_token": 0.000001,
|
||||
"output_cost_per_token": 0.0000025,
|
||||
"litellm_provider": "gemini",
|
||||
"mode": "chat",
|
||||
"rpm": 10000,
|
||||
"tpm": 8000000,
|
||||
"supports_system_messages": true,
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_audio_output": false,
|
||||
"supports_tool_choice": true,
|
||||
"supported_modalities": ["text", "image", "audio", "video"],
|
||||
"supported_output_modalities": ["text"],
|
||||
"source": "https://ai.google.dev/gemini-api/docs/pricing#gemini-2.5-flash"
|
||||
},
|
||||
"gemini/gemini-2.5-flash-lite-preview-06-17": {
|
||||
"max_tokens": 64000,
|
||||
"max_input_tokens": 1000000,
|
||||
"max_output_tokens": 64000,
|
||||
"max_images_per_prompt": 3000,
|
||||
"max_videos_per_prompt": 10,
|
||||
"max_video_length": 1,
|
||||
"max_audio_length_hours": 8.4,
|
||||
"max_audio_per_prompt": 1,
|
||||
"max_pdf_size_mb": 20,
|
||||
"input_cost_per_token": 0.00000001,
|
||||
"input_cost_per_audio_token": 0.0000005,
|
||||
"output_cost_per_token": 0.0000004,
|
||||
"litellm_provider": "gemini",
|
||||
"mode": "chat",
|
||||
"rpm": 30000,
|
||||
"tpm": 30000000,
|
||||
"supports_system_messages": true,
|
||||
"supports_function_calling": true,
|
||||
"supports_vision": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_audio_output": false,
|
||||
"supports_tool_choice": true,
|
||||
"supported_modalities": ["text", "image", "audio", "video"],
|
||||
"supported_output_modalities": ["text"],
|
||||
"source": "https://ai.google.dev/gemini-api/docs/pricing#gemini-2.5-flash-lite"
|
||||
},
|
||||
"together_ai/Qwen/Qwen3-235B-A22B-fp8-tput": {
|
||||
"input_cost_per_token": 0.0000002,
|
||||
"output_cost_per_token": 0.0000006,
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,7 @@ aider_user_agent = f"Aider/{__version__} +{urls.website}"
|
||||
# platforms.
|
||||
|
||||
|
||||
def install_playwright(io):
|
||||
def check_env():
|
||||
try:
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
@@ -29,6 +29,16 @@ def install_playwright(io):
|
||||
except Exception:
|
||||
has_chromium = False
|
||||
|
||||
return has_pip, has_chromium
|
||||
|
||||
|
||||
def has_playwright():
|
||||
has_pip, has_chromium = check_env()
|
||||
return has_pip and has_chromium
|
||||
|
||||
|
||||
def install_playwright(io):
|
||||
has_pip, has_chromium = check_env()
|
||||
if has_pip and has_chromium:
|
||||
return True
|
||||
|
||||
@@ -262,7 +272,7 @@ def slimdown_html(soup):
|
||||
|
||||
|
||||
def main(url):
|
||||
scraper = Scraper()
|
||||
scraper = Scraper(playwright_available=has_playwright())
|
||||
content = scraper.scrape(url)
|
||||
print(content)
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import itertools
|
||||
import os
|
||||
import platform
|
||||
import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
import oslex
|
||||
|
||||
from aider.dump import dump # noqa: F401
|
||||
from aider.waiting import Spinner
|
||||
|
||||
IMAGE_EXTENSIONS = {".png", ".jpg", ".jpeg", ".gif", ".bmp", ".tiff", ".webp", ".pdf"}
|
||||
|
||||
@@ -211,6 +211,13 @@ def run_install(cmd):
|
||||
print()
|
||||
print("Installing:", printable_shell_command(cmd))
|
||||
|
||||
# First ensure pip is available
|
||||
ensurepip_cmd = [sys.executable, "-m", "ensurepip", "--upgrade"]
|
||||
try:
|
||||
subprocess.run(ensurepip_cmd, capture_output=True, check=False)
|
||||
except Exception:
|
||||
pass # Continue even if ensurepip fails
|
||||
|
||||
try:
|
||||
output = []
|
||||
process = subprocess.Popen(
|
||||
@@ -250,55 +257,6 @@ def run_install(cmd):
|
||||
return False, output
|
||||
|
||||
|
||||
class Spinner:
|
||||
unicode_spinner = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]
|
||||
ascii_spinner = ["|", "/", "-", "\\"]
|
||||
|
||||
def __init__(self, text):
|
||||
self.text = text
|
||||
self.start_time = time.time()
|
||||
self.last_update = 0
|
||||
self.visible = False
|
||||
self.is_tty = sys.stdout.isatty()
|
||||
self.tested = False
|
||||
|
||||
def test_charset(self):
|
||||
if self.tested:
|
||||
return
|
||||
self.tested = True
|
||||
# Try unicode first, fall back to ascii if needed
|
||||
try:
|
||||
# Test if we can print unicode characters
|
||||
print(self.unicode_spinner[0], end="", flush=True)
|
||||
print("\r", end="", flush=True)
|
||||
self.spinner_chars = itertools.cycle(self.unicode_spinner)
|
||||
except UnicodeEncodeError:
|
||||
self.spinner_chars = itertools.cycle(self.ascii_spinner)
|
||||
|
||||
def step(self):
|
||||
if not self.is_tty:
|
||||
return
|
||||
|
||||
current_time = time.time()
|
||||
if not self.visible and current_time - self.start_time >= 0.5:
|
||||
self.visible = True
|
||||
self._step()
|
||||
elif self.visible and current_time - self.last_update >= 0.1:
|
||||
self._step()
|
||||
self.last_update = current_time
|
||||
|
||||
def _step(self):
|
||||
if not self.visible:
|
||||
return
|
||||
|
||||
self.test_charset()
|
||||
print(f"\r{self.text} {next(self.spinner_chars)}\r{self.text} ", end="", flush=True)
|
||||
|
||||
def end(self):
|
||||
if self.visible and self.is_tty:
|
||||
print("\r" + " " * (len(self.text) + 3))
|
||||
|
||||
|
||||
def find_common_root(abs_fnames):
|
||||
try:
|
||||
if len(abs_fnames) == 1:
|
||||
@@ -384,19 +342,4 @@ def printable_shell_command(cmd_list):
|
||||
Returns:
|
||||
str: Shell-escaped command string.
|
||||
"""
|
||||
if platform.system() == "Windows":
|
||||
return subprocess.list2cmdline(cmd_list)
|
||||
else:
|
||||
return shlex.join(cmd_list)
|
||||
|
||||
|
||||
def main():
|
||||
spinner = Spinner("Running spinner...")
|
||||
for _ in range(40): # 40 steps * 0.25 seconds = 10 seconds
|
||||
time.sleep(0.25)
|
||||
spinner.step()
|
||||
spinner.end()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
return oslex.join(cmd_list)
|
||||
|
||||
221
aider/waiting.py
Normal file
221
aider/waiting.py
Normal file
@@ -0,0 +1,221 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Thread-based, killable spinner utility.
|
||||
|
||||
Use it like:
|
||||
|
||||
from aider.waiting import WaitingSpinner
|
||||
|
||||
spinner = WaitingSpinner("Waiting for LLM")
|
||||
spinner.start()
|
||||
... # long task
|
||||
spinner.stop()
|
||||
"""
|
||||
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
|
||||
from rich.console import Console
|
||||
|
||||
|
||||
class Spinner:
|
||||
"""
|
||||
Minimal spinner that scans a single marker back and forth across a line.
|
||||
|
||||
The animation is pre-rendered into a list of frames. If the terminal
|
||||
cannot display unicode the frames are converted to plain ASCII.
|
||||
"""
|
||||
|
||||
last_frame_idx = 0 # Class variable to store the last frame index
|
||||
|
||||
def __init__(self, text: str, width: int = 7):
|
||||
self.text = text
|
||||
self.start_time = time.time()
|
||||
self.last_update = 0.0
|
||||
self.visible = False
|
||||
self.is_tty = sys.stdout.isatty()
|
||||
self.console = Console()
|
||||
|
||||
# Pre-render the animation frames using pure ASCII so they will
|
||||
# always display, even on very limited terminals.
|
||||
ascii_frames = [
|
||||
"#= ", # C1 C2 space(8)
|
||||
"=# ", # C2 C1 space(8)
|
||||
" =# ", # space(1) C2 C1 space(7)
|
||||
" =# ", # space(2) C2 C1 space(6)
|
||||
" =# ", # space(3) C2 C1 space(5)
|
||||
" =# ", # space(4) C2 C1 space(4)
|
||||
" =# ", # space(5) C2 C1 space(3)
|
||||
" =# ", # space(6) C2 C1 space(2)
|
||||
" =# ", # space(7) C2 C1 space(1)
|
||||
" =#", # space(8) C2 C1
|
||||
" #=", # space(8) C1 C2
|
||||
" #= ", # space(7) C1 C2 space(1)
|
||||
" #= ", # space(6) C1 C2 space(2)
|
||||
" #= ", # space(5) C1 C2 space(3)
|
||||
" #= ", # space(4) C1 C2 space(4)
|
||||
" #= ", # space(3) C1 C2 space(5)
|
||||
" #= ", # space(2) C1 C2 space(6)
|
||||
" #= ", # space(1) C1 C2 space(7)
|
||||
]
|
||||
|
||||
self.unicode_palette = "░█"
|
||||
xlate_from, xlate_to = ("=#", self.unicode_palette)
|
||||
|
||||
# If unicode is supported, swap the ASCII chars for nicer glyphs.
|
||||
if self._supports_unicode():
|
||||
translation_table = str.maketrans(xlate_from, xlate_to)
|
||||
frames = [f.translate(translation_table) for f in ascii_frames]
|
||||
self.scan_char = xlate_to[xlate_from.find("#")]
|
||||
else:
|
||||
frames = ascii_frames
|
||||
self.scan_char = "#"
|
||||
|
||||
# Bounce the scanner back and forth.
|
||||
self.frames = frames
|
||||
self.frame_idx = Spinner.last_frame_idx # Initialize from class variable
|
||||
self.width = len(frames[0]) - 2 # number of chars between the brackets
|
||||
self.animation_len = len(frames[0])
|
||||
self.last_display_len = 0 # Length of the last spinner line (frame + text)
|
||||
|
||||
def _supports_unicode(self) -> bool:
|
||||
if not self.is_tty:
|
||||
return False
|
||||
try:
|
||||
out = self.unicode_palette
|
||||
out += "\b" * len(self.unicode_palette)
|
||||
out += " " * len(self.unicode_palette)
|
||||
out += "\b" * len(self.unicode_palette)
|
||||
sys.stdout.write(out)
|
||||
sys.stdout.flush()
|
||||
return True
|
||||
except UnicodeEncodeError:
|
||||
return False
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def _next_frame(self) -> str:
|
||||
frame = self.frames[self.frame_idx]
|
||||
self.frame_idx = (self.frame_idx + 1) % len(self.frames)
|
||||
Spinner.last_frame_idx = self.frame_idx # Update class variable
|
||||
return frame
|
||||
|
||||
def step(self, text: str = None) -> None:
|
||||
if text is not None:
|
||||
self.text = text
|
||||
|
||||
if not self.is_tty:
|
||||
return
|
||||
|
||||
now = time.time()
|
||||
if not self.visible and now - self.start_time >= 0.5:
|
||||
self.visible = True
|
||||
self.last_update = 0.0
|
||||
if self.is_tty:
|
||||
self.console.show_cursor(False)
|
||||
|
||||
if not self.visible or now - self.last_update < 0.1:
|
||||
return
|
||||
|
||||
self.last_update = now
|
||||
frame_str = self._next_frame()
|
||||
|
||||
# Determine the maximum width for the spinner line
|
||||
# Subtract 2 as requested, to leave a margin or prevent cursor wrapping issues
|
||||
max_spinner_width = self.console.width - 2
|
||||
if max_spinner_width < 0: # Handle extremely narrow terminals
|
||||
max_spinner_width = 0
|
||||
|
||||
current_text_payload = f" {self.text}"
|
||||
line_to_display = f"{frame_str}{current_text_payload}"
|
||||
|
||||
# Truncate the line if it's too long for the console width
|
||||
if len(line_to_display) > max_spinner_width:
|
||||
line_to_display = line_to_display[:max_spinner_width]
|
||||
|
||||
len_line_to_display = len(line_to_display)
|
||||
|
||||
# Calculate padding to clear any remnants from a longer previous line
|
||||
padding_to_clear = " " * max(0, self.last_display_len - len_line_to_display)
|
||||
|
||||
# Write the spinner frame, text, and any necessary clearing spaces
|
||||
sys.stdout.write(f"\r{line_to_display}{padding_to_clear}")
|
||||
self.last_display_len = len_line_to_display
|
||||
|
||||
# Calculate number of backspaces to position cursor at the scanner character
|
||||
scan_char_abs_pos = frame_str.find(self.scan_char)
|
||||
|
||||
# Total characters written to the line (frame + text + padding)
|
||||
total_chars_written_on_line = len_line_to_display + len(padding_to_clear)
|
||||
|
||||
# num_backspaces will be non-positive if scan_char_abs_pos is beyond
|
||||
# total_chars_written_on_line (e.g., if the scan char itself was truncated).
|
||||
# (e.g., if the scan char itself was truncated).
|
||||
# In such cases, (effectively) 0 backspaces are written,
|
||||
# and the cursor stays at the end of the line.
|
||||
num_backspaces = total_chars_written_on_line - scan_char_abs_pos
|
||||
sys.stdout.write("\b" * num_backspaces)
|
||||
sys.stdout.flush()
|
||||
|
||||
def end(self) -> None:
|
||||
if self.visible and self.is_tty:
|
||||
clear_len = self.last_display_len # Use the length of the last displayed content
|
||||
sys.stdout.write("\r" + " " * clear_len + "\r")
|
||||
sys.stdout.flush()
|
||||
self.console.show_cursor(True)
|
||||
self.visible = False
|
||||
|
||||
|
||||
class WaitingSpinner:
|
||||
"""Background spinner that can be started/stopped safely."""
|
||||
|
||||
def __init__(self, text: str = "Waiting for LLM", delay: float = 0.15):
|
||||
self.spinner = Spinner(text)
|
||||
self.delay = delay
|
||||
self._stop_event = threading.Event()
|
||||
self._thread = threading.Thread(target=self._spin, daemon=True)
|
||||
|
||||
def _spin(self):
|
||||
while not self._stop_event.is_set():
|
||||
self.spinner.step()
|
||||
time.sleep(self.delay)
|
||||
self.spinner.end()
|
||||
|
||||
def start(self):
|
||||
"""Start the spinner in a background thread."""
|
||||
if not self._thread.is_alive():
|
||||
self._thread.start()
|
||||
|
||||
def stop(self):
|
||||
"""Request the spinner to stop and wait briefly for the thread to exit."""
|
||||
self._stop_event.set()
|
||||
if self._thread.is_alive():
|
||||
self._thread.join(timeout=self.delay)
|
||||
self.spinner.end()
|
||||
|
||||
# Allow use as a context-manager
|
||||
def __enter__(self):
|
||||
self.start()
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
self.stop()
|
||||
|
||||
|
||||
def main():
|
||||
spinner = Spinner("Running spinner...")
|
||||
try:
|
||||
for _ in range(100):
|
||||
time.sleep(0.15)
|
||||
spinner.step()
|
||||
print("Success!")
|
||||
except KeyboardInterrupt:
|
||||
print("\nInterrupted by user.")
|
||||
finally:
|
||||
spinner.end()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -34,6 +34,8 @@ def load_gitignores(gitignore_paths: list[Path]) -> Optional[PathSpec]:
|
||||
"__pycache__/", # Python cache dir
|
||||
".DS_Store", # macOS metadata
|
||||
"Thumbs.db", # Windows thumbnail cache
|
||||
"*.svg",
|
||||
"*.pdf",
|
||||
# IDE files
|
||||
".idea/", # JetBrains IDEs
|
||||
".vscode/", # VS Code
|
||||
@@ -64,7 +66,9 @@ class FileWatcher:
|
||||
"""Watches source files for changes and AI comments"""
|
||||
|
||||
# Compiled regex pattern for AI comments
|
||||
ai_comment_pattern = re.compile(r"(?:#|//|--|;+) *(ai\b.*|ai\b.*|.*\bai[?!]?) *$", re.IGNORECASE)
|
||||
ai_comment_pattern = re.compile(
|
||||
r"(?:#|//|--|;+) *(ai\b.*|ai\b.*|.*\bai[?!]?) *$", re.IGNORECASE
|
||||
)
|
||||
|
||||
def __init__(self, coder, gitignores=None, verbose=False, analytics=None, root=None):
|
||||
self.coder = coder
|
||||
@@ -93,15 +97,19 @@ class FileWatcher:
|
||||
|
||||
rel_path = path_abs.relative_to(self.root)
|
||||
if self.verbose:
|
||||
dump(rel_path)
|
||||
print("Changed", rel_path)
|
||||
|
||||
if self.gitignore_spec and self.gitignore_spec.match_file(
|
||||
rel_path.as_posix() + ("/" if path_abs.is_dir() else "")
|
||||
):
|
||||
return False
|
||||
|
||||
# Check file size before reading content
|
||||
if path_abs.is_file() and path_abs.stat().st_size > 1 * 1024 * 1024: # 1MB limit
|
||||
return False
|
||||
|
||||
if self.verbose:
|
||||
dump("ok", rel_path)
|
||||
print("Checking", rel_path)
|
||||
|
||||
# Check if file contains AI markers
|
||||
try:
|
||||
|
||||
@@ -24,12 +24,189 @@ cog.out(text)
|
||||
]]]-->
|
||||
|
||||
|
||||
### Aider v0.86.0
|
||||
|
||||
- Expanded GPT-5 model support across family variants and providers (OpenAI, Azure, OpenRouter), including dated and chat/mini/nano variants.
|
||||
- Aider wrote 88% of the code in this release.
|
||||
|
||||
### Aider v0.85.5
|
||||
|
||||
- Enforced diff edit format for GPT-5 models.
|
||||
- Added support for the reasoning_effort setting for GPT-5 models.
|
||||
- Fixed model detection to correctly apply GPT-5 settings to versioned names (gpt-5 and gpt-5-2025-08-07).
|
||||
|
||||
### Aider v0.85.4
|
||||
|
||||
- Added support for openai/gpt-5
|
||||
- Fixed analytics to support the latest PostHog SDK event-capture API.
|
||||
- Disabled temperature when using GPT-5 models for more deterministic outputs.
|
||||
|
||||
### Aider v0.85.3
|
||||
|
||||
- Bumped dependencies to pick up latest litellm==1.75.0.
|
||||
|
||||
### Aider v0.85.2
|
||||
|
||||
- Added support for Grok-4 via `xai/grok-4` and `openrouter/x-ai/grok-4` model names.
|
||||
- Added support for `gemini/gemini-2.5-flash-lite-preview-06-17` model, by Tamir Zahavi-Brunner.
|
||||
- `/clear` now prints “All chat history cleared.” so you know it worked, by Zexin Yuan.
|
||||
- `/undo` output now shows only the first line of each commit message, making it easier to read.
|
||||
- Fixed an issue where new settings for an existing model didn't replace the old ones, by Andrew Grigorev.
|
||||
- Added support for `openrouter/moonshotai/kimi-k2` model, by Jack Harrington.
|
||||
|
||||
### Aider v0.85.1
|
||||
|
||||
- Display model announcements with no-arg `/model` command.
|
||||
|
||||
### Aider v0.85.0
|
||||
|
||||
- Support for Responses API models like o1-pro, o3-pro.
|
||||
- Updated pricing for o3.
|
||||
- Added support for new Gemini models including `gemini-2.5-pro`, `gemini-2.5-flash`, and `gemini-2.5-pro-preview-06-05` with thinking tokens support.
|
||||
- Updated model aliases: `flash` now points to `gemini-2.5-flash` and `gemini` now points to `gemini-2.5-pro`.
|
||||
- Added `--add-gitignore-files` flag to enable adding files listed in .gitignore to Aider's editing scope, by omarcinkonis.
|
||||
- Added `--commit-language` option to specify the language for commit messages, by Kyosuke Takayama.
|
||||
- Enhanced thinking tokens support: can now be disabled by setting to 0, and improved help text with examples.
|
||||
- Added MATLAB language support for repository maps, by Matthew Tofano.
|
||||
- Added support for OpenAI o3-pro model across multiple providers.
|
||||
- Improved GitHub Copilot token handling with better validation and error messages, by Vincent Taverna and Sebastian Estrella.
|
||||
- Fixed encoding issues in git diff output and LLM history logging.
|
||||
- Enhanced commit message generation to use system prompt prefixes, by Luke Reeves.
|
||||
- Improved inline code rendering in Rich markdown output, by Vamsi Talupula.
|
||||
- Fixed Vertex AI model name prefixes in settings, by Wietse Venema.
|
||||
- Improved `/read-only` command to resolve literal paths correctly, by Matteo Landi.
|
||||
- Skip expensive file tracking operations when `--skip-sanity-check-repo` is enabled for better performance, by Makar Ivashko.
|
||||
- Ensure pip is available before package installation.
|
||||
- Auto-create parent directories for chat history files to prevent startup errors, by contributor.
|
||||
- Fixed search block regex to accept optional closing tags when working with HTML content, by Mathis Beer.
|
||||
- Co-authored-by attribution is now enabled by default for commit messages.
|
||||
- Added Clojure language support for repository maps, by Garrett Hopper.
|
||||
- Added custom PostHog analytics configuration options with `--analytics-posthog-host` and `--analytics-posthog-project-api-key` flags, by Vasil Markoukin.
|
||||
- Optimized chat history summarization performance, by jayeshthk.
|
||||
- Improved kebab-case identifier recognition in repository maps for better code analysis.
|
||||
- Increased max tokens for Deepseek models to 65536 for better performance.
|
||||
- Aider wrote 21% of the code in this release.
|
||||
|
||||
### Aider v0.84.0
|
||||
|
||||
- Added support for new Claude models including the Sonnet 4 and Opus 4 series (e.g., `claude-sonnet-4-20250514`,
|
||||
`claude-opus-4-20250514`) across various providers. The default `sonnet` and `opus` aliases were updated to these newer
|
||||
versions.
|
||||
- Added support for the `vertex_ai/gemini-2.5-flash-preview-05-20` model.
|
||||
- Fixed OpenRouter token cost calculation for improved accuracy.
|
||||
- Updated default OpenRouter models during onboarding to `deepseek/deepseek-r1:free` for the free tier and
|
||||
`anthropic/claude-sonnet-4` for paid tiers.
|
||||
- Automatically refresh GitHub Copilot tokens when used as OpenAI API keys, by Lih Chen.
|
||||
- Aider wrote 79% of the code in this release.
|
||||
|
||||
### Aider v0.83.2
|
||||
|
||||
- Bumped configargparse to 1.7.1 as 1.7 was pulled.
|
||||
- Added shell tab completion for file path arguments (by saviour) and for `--edit-format`/`--editor-edit-format` options.
|
||||
- Improved OpenRouter model metadata handling by introducing a local cache, increasing reliability and performance.
|
||||
- The `/settings` command now displays detailed metadata for active main, editor, and weak models.
|
||||
- Fixed an issue where files explicitly added via the command line were not correctly ignored if listed in `.gitignore`.
|
||||
- Improved automatic commit messages by providing more context during their generation, by wangboxue.
|
||||
|
||||
### Aider v0.83.1
|
||||
|
||||
- Improved user language detection by correctly normalizing hyphenated language codes (e.g., `en-US` to `en`) and enhancing the validation of locale results.
|
||||
- Prevented Aider from instructing the LLM to reply in 'C' or 'POSIX' when these are detected as the system locale.
|
||||
- Displayed a spinner with the model name when generating commit messages.
|
||||
|
||||
### Aider v0.83.0
|
||||
|
||||
- Added support for `gemini-2.5-pro-preview-05-06` models.
|
||||
- Added support for `qwen3-235b` models.
|
||||
- Added repo-map support for OCaml and OCaml interface files, by Andrey Popp.
|
||||
- Added a spinner animation while waiting for the LLM to start streaming its response.
|
||||
- Updated the spinner animation to a Knight Rider style.
|
||||
- Introduced `--attribute-co-authored-by` option to add co-author trailer to commit messages, by Andrew Grigorev.
|
||||
- Updated Gemini model aliases (e.g., `gemini`, `gemini-2.5-pro`) to point to the `05-06` preview versions.
|
||||
- Marked Gemini 2.5 Pro preview models as `overeager` by default.
|
||||
- Commit message prompt specifies the user's language.
|
||||
- Updated the default weak model for Gemini 2.5 Pro models to `gemini/gemini-2.5-flash-preview-04-17`.
|
||||
- Corrected `gemini-2.5-pro-exp-03-25` model settings to reflect its lack of support for `thinking_budget`.
|
||||
- Ensured model-specific system prompt prefixes are placed on a new line before the main system prompt.
|
||||
- Added tracking of total tokens sent and received, now included in benchmark statistics.
|
||||
- Automatically fetch model parameters (context window, pricing) for OpenRouter models directly from their website, by Stefan Hladnik.
|
||||
- Enabled support for `thinking_tokens` and `reasoning_effort` parameters for OpenRouter models.
|
||||
- Improved cost calculation using `litellm.completion_cost` where available.
|
||||
- Added model settings for `openrouter/google/gemini-2.5-pro-preview-03-25`.
|
||||
- Added `--disable-playwright` flag to prevent Playwright installation prompts and usage, by Andrew Grigorev.
|
||||
- The `aider scrape` command-line tool will now use Playwright for web scraping if it is available, by Jon Keys.
|
||||
- Fixed linter command execution on Windows by adopting `oslex` for argument quoting, by Titusz Pan.
|
||||
- Improved cross-platform display of shell commands by using `oslex` for robust argument quoting, by Titusz Pan.
|
||||
- Improved `/ask` mode to instruct the LLM to elide unchanging code in its responses.
|
||||
- Ensured web scraping in the GUI also respects Playwright availability and the `--disable-playwright` flag.
|
||||
- Improved display of filenames in the prompt header using rich Text formatting.
|
||||
- Enabled `reasoning_effort` for Gemini 2.5 Flash models.
|
||||
- Added a `--shell-completions` argument to generate shell completion scripts (e.g., for bash, zsh).
|
||||
- Explicit `--attribute-author` or `--attribute-committer` flags now override the default behavior when `--attribute-co-authored-by` is used, allowing finer control over commit attribution, by Andrew Grigorev.
|
||||
- Fixed an issue where read-only status of files might not be preserved correctly by some commands (e.g. `/drop` after adding a read-only file).
|
||||
- The `aider-args` utility (or `python -m aider.args`) now defaults to printing a sample YAML configuration if no arguments are provided.
|
||||
- Displayed token count progress and the name of the file or identifier being processed during repo map updates.
|
||||
- Extended the waiting spinner to also show for non-streaming responses and further enhanced its animation with console width clipping, cursor hiding, and a more continuous appearance.
|
||||
- Dropped support for Python 3.9.
|
||||
- Aider wrote 55% of the code in this release.
|
||||
|
||||
### Aider v0.82.3
|
||||
|
||||
- Add support for `gemini-2.5-flash-preview-04-17` models.
|
||||
- Improved robustness of edit block parsing when filenames start with backticks or fences.
|
||||
- Add new `udiff-simple` edit format, for Gemini 2.5 Pro.
|
||||
- Update default weak/editor models for Gemini 2.5 Pro models to use `gemini-2.5-flash-preview-04-17`.
|
||||
- Instruct models to reply in the user's detected system language.
|
||||
- Fix parsing of diffs for newly created files (`--- /dev/null`).
|
||||
- Add markdown syntax highlighting support when editing multi-line commit messages via `/commit`, by Kay Gosho.
|
||||
- Set Gemini 2.5 Pro models to use the `overeager` prompt setting by default.
|
||||
- Add common file types (`.svg`, `.pdf`) to the default list of ignored files for AI comment scanning (`--watch`).
|
||||
- Skip scanning files larger than 1MB for AI comments (`--watch`).
|
||||
|
||||
### Aider v0.82.2
|
||||
|
||||
- Fix editing shell files with diff-fenced, by zjy1412.
|
||||
- Improve robustness of patch application by allowing multiple update/delete actions for the same file within a single response.
|
||||
- Update prompts to instruct LLMs to consolidate all edits for a given file into a single block within the patch.
|
||||
|
||||
### Aider v0.82.1
|
||||
|
||||
- Added support for `o3` and `o4-mini` including provider-specific versions for OpenAI, OpenRouter, and Azure.
|
||||
- Added support for Azure specific `gpt-4.1` and `gpt-4.1-mini` models.
|
||||
- Disabled streaming for `o3` models since you need identity verification to stream.
|
||||
- Fixed handling of file paths in unified diffs, especially those generated by git.
|
||||
|
||||
### Aider v0.82.0
|
||||
|
||||
- Support for GPT 4.1, mini and nano.
|
||||
- Added new `patch` edit format for OpenAI's GPT-4.1 model.
|
||||
- Improved support for using architect mode with Gemini 2.5 Pro.
|
||||
- Added new `editor-diff`, `editor-whole`, and `editor-diff-fenced` edit formats.
|
||||
- Bugfix for automatically selecting the best edit format to use in architect mode.
|
||||
- Added support for `grok-3-fast-beta` and `grok-3-mini-fast-beta` models.
|
||||
- Aider wrote 92% of the code in this release.
|
||||
|
||||
### Aider v0.81.3
|
||||
|
||||
- Commit messages generated by aider are no longer forced to be entirely lowercase, by Peter Hadlaw.
|
||||
- Updated default settings for Grok models.
|
||||
|
||||
### Aider v0.81.2
|
||||
|
||||
- Add support for `xai/grok-3-beta`, `xai/grok-3-mini-beta`, `openrouter/x-ai/grok-3-beta`, `openrouter/x-ai/grok-3-mini-beta`, and `openrouter/openrouter/optimus-alpha` models.
|
||||
- Add alias "grok3" for `xai/grok-3-beta`.
|
||||
- Add alias "optimus" for `openrouter/openrouter/optimus-alpha`.
|
||||
- Fix URL extraction from error messages.
|
||||
- Allow adding files by full path even if a file with the same basename is already in the chat.
|
||||
- Fix quoting of values containing '#' in the sample `aider.conf.yml`.
|
||||
- Add support for Fireworks AI model 'deepseek-v3-0324', by Felix Lisczyk.
|
||||
- Commit messages generated by aider are now lowercase, by Anton Ödman.
|
||||
|
||||
### Aider v0.81.1
|
||||
|
||||
- Added support for the `gemini/gemini-2.5-pro-preview-03-25` model.
|
||||
- Updated the `gemini` alias to point to `gemini/gemini-2.5-pro-preview-03-25`.
|
||||
- Added the `gemini-exp` alias for `gemini/gemini-2.5-pro-exp-03-25`.
|
||||
- Aider wrote 87% of the code in this release.
|
||||
|
||||
### Aider v0.81.0
|
||||
|
||||
@@ -341,7 +518,7 @@ cog.out(text)
|
||||
- [Aider works with LLM web chat UIs](https://aider.chat/docs/usage/copypaste.html).
|
||||
- New `--copy-paste` mode.
|
||||
- New `/copy-context` command.
|
||||
- [Set API keys and other environment variables for all providers from command line or yaml conf file](https://aider.chat/docs/config/aider_conf.html#storing-llm-keys).
|
||||
- [Set API keys and other environment variables for all providers from command line or YAML conf file](https://aider.chat/docs/config/aider_conf.html#storing-llm-keys).
|
||||
- New `--api-key provider=key` setting.
|
||||
- New `--set-env VAR=value` setting.
|
||||
- Added bash and zsh support to `--watch-files`.
|
||||
@@ -509,7 +686,7 @@ cog.out(text)
|
||||
|
||||
### Aider v0.59.1
|
||||
|
||||
- Check for obsolete `yes: true` in yaml config, show helpful error.
|
||||
- Check for obsolete `yes: true` in YAML config, show helpful error.
|
||||
- Model settings for openrouter/anthropic/claude-3.5-sonnet:beta
|
||||
|
||||
### Aider v0.59.0
|
||||
@@ -519,7 +696,7 @@ cog.out(text)
|
||||
- Still auto-completes the full paths of the repo files like `/add`.
|
||||
- Now supports globs like `src/**/*.py`
|
||||
- Renamed `--yes` to `--yes-always`.
|
||||
- Now uses `AIDER_YES_ALWAYS` env var and `yes-always:` yaml key.
|
||||
- Now uses `AIDER_YES_ALWAYS` env var and `yes-always:` YAML key.
|
||||
- Existing YAML and .env files will need to be updated.
|
||||
- Can still abbreviate to `--yes` on the command line.
|
||||
- Config file now uses standard YAML list syntax with ` - list entries`, one per line.
|
||||
@@ -726,7 +903,7 @@ cog.out(text)
|
||||
- Use `--map-refresh <always|files|manual|auto>` to configure.
|
||||
- Improved cost estimate logic for caching.
|
||||
- Improved editing performance on Jupyter Notebook `.ipynb` files.
|
||||
- Show which config yaml file is loaded with `--verbose`.
|
||||
- Show which config YAML file is loaded with `--verbose`.
|
||||
- Bumped dependency versions.
|
||||
- Bugfix: properly load `.aider.models.metadata.json` data.
|
||||
- Bugfix: Using `--msg /ask ...` caused an exception.
|
||||
|
||||
@@ -32,7 +32,7 @@ aux_links:
|
||||
"GitHub":
|
||||
- "https://github.com/Aider-AI/aider"
|
||||
"Discord":
|
||||
- "https://discord.gg/Tv2uQnR88V"
|
||||
- "https://discord.gg/Y7X7bhMQFV"
|
||||
"Blog":
|
||||
- "/blog/"
|
||||
|
||||
@@ -40,7 +40,7 @@ nav_external_links:
|
||||
- title: "GitHub"
|
||||
url: "https://github.com/Aider-AI/aider"
|
||||
- title: "Discord"
|
||||
url: "https://discord.gg/Tv2uQnR88V"
|
||||
url: "https://discord.gg/Y7X7bhMQFV"
|
||||
|
||||
repository: Aider-AI/aider
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -643,7 +643,7 @@
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 1
|
||||
total_tests: 225
|
||||
command: "aider --model anthropic/claude-3-7-sonnet-20250219 # plus yml config"
|
||||
command: "aider --model anthropic/claude-3-7-sonnet-20250219 --thinking-tokens 32k"
|
||||
date: 2025-02-24
|
||||
versions: 0.75.1.dev
|
||||
seconds_per_case: 105.2
|
||||
@@ -807,31 +807,31 @@
|
||||
seconds_per_case: 290.0
|
||||
total_cost: 1.1164
|
||||
|
||||
- dirname: 2025-03-25-19-46-45--gemini-25-pro-exp-diff-fenced
|
||||
- dirname: 2025-04-12-04-55-50--gemini-25-pro-diff-fenced
|
||||
test_cases: 225
|
||||
model: Gemini 2.5 Pro exp-03-25
|
||||
model: Gemini 2.5 Pro Preview 03-25
|
||||
edit_format: diff-fenced
|
||||
commit_hash: 33413ec
|
||||
pass_rate_1: 39.1
|
||||
commit_hash: 0282574
|
||||
pass_rate_1: 40.9
|
||||
pass_rate_2: 72.9
|
||||
pass_num_1: 88
|
||||
pass_num_1: 92
|
||||
pass_num_2: 164
|
||||
percent_cases_well_formed: 89.8
|
||||
error_outputs: 30
|
||||
num_malformed_responses: 30
|
||||
num_with_malformed_responses: 23
|
||||
user_asks: 57
|
||||
percent_cases_well_formed: 92.4
|
||||
error_outputs: 21
|
||||
num_malformed_responses: 21
|
||||
num_with_malformed_responses: 17
|
||||
user_asks: 69
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 3
|
||||
test_timeouts: 2
|
||||
total_tests: 225
|
||||
command: aider --model gemini/gemini-2.5-pro-exp-03-25
|
||||
date: 2025-03-25
|
||||
versions: 0.78.1.dev
|
||||
seconds_per_case: 47.1
|
||||
total_cost: 0.0000
|
||||
command: aider --model gemini/gemini-2.5-pro-preview-03-25
|
||||
date: 2025-04-12
|
||||
versions: 0.81.3.dev
|
||||
seconds_per_case: 45.3
|
||||
total_cost: 0 # incorrect: 6.3174
|
||||
|
||||
- dirname: 2025-03-29-05-24-55--chatgpt4o-mar28-diff
|
||||
test_cases: 225
|
||||
@@ -883,4 +883,831 @@
|
||||
date: 2025-04-04
|
||||
versions: 0.80.5.dev
|
||||
seconds_per_case: 14.8
|
||||
total_cost: 0.0000
|
||||
total_cost: 0.0000
|
||||
|
||||
- dirname: 2025-04-06-08-39-52--llama-4-maverick-17b-128e-instruct-polyglot-whole
|
||||
test_cases: 225
|
||||
model: Llama 4 Maverick
|
||||
edit_format: whole
|
||||
commit_hash: 9445a31
|
||||
pass_rate_1: 4.4
|
||||
pass_rate_2: 15.6
|
||||
pass_num_1: 10
|
||||
pass_num_2: 35
|
||||
percent_cases_well_formed: 99.1
|
||||
error_outputs: 12
|
||||
num_malformed_responses: 2
|
||||
num_with_malformed_responses: 2
|
||||
user_asks: 248
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 4
|
||||
total_tests: 225
|
||||
command: aider --model nvidia_nim/meta/llama-4-maverick-17b-128e-instruct
|
||||
date: 2025-04-06
|
||||
versions: 0.81.2.dev
|
||||
seconds_per_case: 20.5
|
||||
total_cost: 0.0000
|
||||
|
||||
- dirname: 2025-04-10-04-21-31--grok3-diff-exuser
|
||||
test_cases: 225
|
||||
model: Grok 3 Beta
|
||||
edit_format: diff
|
||||
commit_hash: 2dd40fc-dirty
|
||||
pass_rate_1: 22.2
|
||||
pass_rate_2: 53.3
|
||||
pass_num_1: 50
|
||||
pass_num_2: 120
|
||||
percent_cases_well_formed: 99.6
|
||||
error_outputs: 1
|
||||
num_malformed_responses: 1
|
||||
num_with_malformed_responses: 1
|
||||
user_asks: 68
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 2
|
||||
total_tests: 225
|
||||
command: aider --model openrouter/x-ai/grok-3-beta
|
||||
date: 2025-04-10
|
||||
versions: 0.81.2.dev
|
||||
seconds_per_case: 15.3
|
||||
total_cost: 11.0338
|
||||
|
||||
- dirname: 2025-04-10-18-47-24--grok3-mini-whole-exuser
|
||||
test_cases: 225
|
||||
model: Grok 3 Mini Beta (low)
|
||||
edit_format: whole
|
||||
commit_hash: 14ffe77-dirty
|
||||
pass_rate_1: 11.1
|
||||
pass_rate_2: 34.7
|
||||
pass_num_1: 25
|
||||
pass_num_2: 78
|
||||
percent_cases_well_formed: 100.0
|
||||
error_outputs: 3
|
||||
num_malformed_responses: 0
|
||||
num_with_malformed_responses: 0
|
||||
user_asks: 73
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 5
|
||||
total_tests: 225
|
||||
command: aider --model openrouter/x-ai/grok-3-mini-beta
|
||||
date: 2025-04-10
|
||||
versions: 0.81.2.dev
|
||||
seconds_per_case: 35.1
|
||||
total_cost: 0.7856
|
||||
|
||||
- dirname: 2025-04-10-23-59-02--xai-grok3-mini-whole-high
|
||||
test_cases: 225
|
||||
model: Grok 3 Mini Beta (high)
|
||||
edit_format: whole
|
||||
commit_hash: 8ee33da-dirty
|
||||
pass_rate_1: 17.3
|
||||
pass_rate_2: 49.3
|
||||
pass_num_1: 39
|
||||
pass_num_2: 111
|
||||
percent_cases_well_formed: 99.6
|
||||
error_outputs: 1
|
||||
num_malformed_responses: 1
|
||||
num_with_malformed_responses: 1
|
||||
user_asks: 64
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 0
|
||||
total_tests: 225
|
||||
command: aider --model xai/grok-3-mini-beta --reasoning-effort high
|
||||
date: 2025-04-10
|
||||
versions: 0.81.3.dev
|
||||
seconds_per_case: 79.1
|
||||
total_cost: 0.7346
|
||||
|
||||
- dirname: 2025-04-10-19-02-44--oalpha-diff-exsys
|
||||
test_cases: 225
|
||||
model: Optimus Alpha
|
||||
edit_format: diff
|
||||
commit_hash: 532bc45-dirty
|
||||
pass_rate_1: 21.3
|
||||
pass_rate_2: 52.9
|
||||
pass_num_1: 48
|
||||
pass_num_2: 119
|
||||
percent_cases_well_formed: 97.3
|
||||
error_outputs: 7
|
||||
num_malformed_responses: 6
|
||||
num_with_malformed_responses: 6
|
||||
user_asks: 182
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 3
|
||||
total_tests: 225
|
||||
command: aider --model openrouter/openrouter/optimus-alpha
|
||||
date: 2025-04-10
|
||||
versions: 0.81.2.dev
|
||||
seconds_per_case: 18.4
|
||||
total_cost: 0.0000
|
||||
|
||||
- dirname: 2025-04-14-21-05-54--gpt41-diff-exuser
|
||||
test_cases: 225
|
||||
model: gpt-4.1
|
||||
edit_format: diff
|
||||
commit_hash: 7a87db5-dirty
|
||||
pass_rate_1: 20.0
|
||||
pass_rate_2: 52.4
|
||||
pass_num_1: 45
|
||||
pass_num_2: 118
|
||||
percent_cases_well_formed: 98.2
|
||||
error_outputs: 6
|
||||
num_malformed_responses: 5
|
||||
num_with_malformed_responses: 4
|
||||
user_asks: 171
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 1
|
||||
test_timeouts: 5
|
||||
total_tests: 225
|
||||
command: aider --model gpt-4.1
|
||||
date: 2025-04-14
|
||||
versions: 0.81.4.dev
|
||||
seconds_per_case: 20.5
|
||||
total_cost: 9.8556
|
||||
|
||||
- dirname: 2025-04-14-21-27-53--gpt41mini-diff
|
||||
test_cases: 225
|
||||
model: gpt-4.1-mini
|
||||
edit_format: diff
|
||||
commit_hash: ffb743e-dirty
|
||||
pass_rate_1: 11.1
|
||||
pass_rate_2: 32.4
|
||||
pass_num_1: 25
|
||||
pass_num_2: 73
|
||||
percent_cases_well_formed: 92.4
|
||||
error_outputs: 64
|
||||
num_malformed_responses: 62
|
||||
num_with_malformed_responses: 17
|
||||
user_asks: 159
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 2
|
||||
test_timeouts: 2
|
||||
total_tests: 225
|
||||
command: aider --model gpt-4.1-mini
|
||||
date: 2025-04-14
|
||||
versions: 0.81.4.dev
|
||||
seconds_per_case: 19.5
|
||||
total_cost: 1.9918
|
||||
|
||||
- dirname: 2025-04-14-22-46-01--gpt41nano-diff
|
||||
test_cases: 225
|
||||
model: gpt-4.1-nano
|
||||
edit_format: whole
|
||||
commit_hash: 71d1591-dirty
|
||||
pass_rate_1: 3.1
|
||||
pass_rate_2: 8.9
|
||||
pass_num_1: 7
|
||||
pass_num_2: 20
|
||||
percent_cases_well_formed: 94.2
|
||||
error_outputs: 20
|
||||
num_malformed_responses: 20
|
||||
num_with_malformed_responses: 13
|
||||
user_asks: 316
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 8
|
||||
total_tests: 225
|
||||
command: aider --model gpt-4.1-nano
|
||||
date: 2025-04-14
|
||||
versions: 0.81.4.dev
|
||||
seconds_per_case: 12.0
|
||||
total_cost: 0.4281
|
||||
|
||||
- dirname: 2025-04-16-22-01-58--o4-mini-high-diff-exsys
|
||||
test_cases: 225
|
||||
model: o4-mini (high)
|
||||
edit_format: diff
|
||||
commit_hash: b66901f-dirty
|
||||
pass_rate_1: 19.6
|
||||
pass_rate_2: 72.0
|
||||
pass_num_1: 44
|
||||
pass_num_2: 162
|
||||
percent_cases_well_formed: 90.7
|
||||
error_outputs: 26
|
||||
num_malformed_responses: 24
|
||||
num_with_malformed_responses: 21
|
||||
user_asks: 66
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 1
|
||||
test_timeouts: 2
|
||||
total_tests: 225
|
||||
command: aider --model o4-mini
|
||||
date: 2025-04-16
|
||||
versions: 0.82.1.dev
|
||||
seconds_per_case: 176.5
|
||||
total_cost: 19.6399
|
||||
|
||||
- dirname: 2025-04-19-14-43-04--o4-mini-patch
|
||||
test_cases: 225
|
||||
model: openhands-lm-32b-v0.1
|
||||
edit_format: whole
|
||||
commit_hash: c08336f
|
||||
pass_rate_1: 4.0
|
||||
pass_rate_2: 10.2
|
||||
pass_num_1: 9
|
||||
pass_num_2: 23
|
||||
percent_cases_well_formed: 95.1
|
||||
error_outputs: 55
|
||||
num_malformed_responses: 41
|
||||
num_with_malformed_responses: 11
|
||||
user_asks: 166
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 11
|
||||
total_tests: 225
|
||||
command: aider --model openrouter/all-hands/openhands-lm-32b-v0.1
|
||||
date: 2025-04-19
|
||||
versions: 0.82.2.dev
|
||||
seconds_per_case: 195.6
|
||||
total_cost: 0.0000
|
||||
|
||||
- dirname: 2025-04-20-19-54-31--flash25-diff-no-think
|
||||
test_cases: 225
|
||||
model: gemini-2.5-flash-preview-04-17 (default)
|
||||
edit_format: diff
|
||||
commit_hash: 7fcce5d-dirty
|
||||
pass_rate_1: 21.8
|
||||
pass_rate_2: 47.1
|
||||
pass_num_1: 49
|
||||
pass_num_2: 106
|
||||
percent_cases_well_formed: 85.3
|
||||
error_outputs: 60
|
||||
num_malformed_responses: 55
|
||||
num_with_malformed_responses: 33
|
||||
user_asks: 82
|
||||
lazy_comments: 1
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 5
|
||||
test_timeouts: 4
|
||||
total_tests: 225
|
||||
command: aider --model gemini/gemini-2.5-flash-preview-04-17
|
||||
date: 2025-04-20
|
||||
versions: 0.82.3.dev
|
||||
seconds_per_case: 50.1
|
||||
total_cost: 1.8451
|
||||
|
||||
- dirname: 2025-05-07-19-32-40--gemini0506-diff-fenced-completion_cost
|
||||
test_cases: 225
|
||||
model: Gemini 2.5 Pro Preview 05-06
|
||||
edit_format: diff-fenced
|
||||
commit_hash: 3b08327-dirty
|
||||
pass_rate_1: 36.4
|
||||
pass_rate_2: 76.9
|
||||
pass_num_1: 82
|
||||
pass_num_2: 173
|
||||
percent_cases_well_formed: 97.3
|
||||
error_outputs: 15
|
||||
num_malformed_responses: 7
|
||||
num_with_malformed_responses: 6
|
||||
user_asks: 105
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 2
|
||||
total_tests: 225
|
||||
command: aider --model gemini/gemini-2.5-pro-preview-05-06
|
||||
date: 2025-05-07
|
||||
versions: 0.82.4.dev
|
||||
seconds_per_case: 165.3
|
||||
total_cost: 37.4104
|
||||
|
||||
- dirname: 2025-05-08-03-20-24--qwen3-32b-default
|
||||
test_cases: 225
|
||||
model: Qwen3 32B
|
||||
edit_format: diff
|
||||
commit_hash: aaacee5-dirty, aeaf259
|
||||
pass_rate_1: 14.2
|
||||
pass_rate_2: 40.0
|
||||
pass_num_1: 32
|
||||
pass_num_2: 90
|
||||
percent_cases_well_formed: 83.6
|
||||
error_outputs: 119
|
||||
num_malformed_responses: 50
|
||||
num_with_malformed_responses: 37
|
||||
user_asks: 97
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 12
|
||||
prompt_tokens: 317591
|
||||
completion_tokens: 120418
|
||||
test_timeouts: 5
|
||||
total_tests: 225
|
||||
command: aider --model openrouter/qwen/qwen3-32b
|
||||
date: 2025-05-08
|
||||
versions: 0.82.4.dev
|
||||
seconds_per_case: 372.2
|
||||
total_cost: 0.7603
|
||||
|
||||
- dirname: 2025-05-09-17-02-02--qwen3-235b-a22b.unthink_16k_diff
|
||||
test_cases: 225
|
||||
model: Qwen3 235B A22B diff, no think, Alibaba API
|
||||
edit_format: diff
|
||||
commit_hash: 91d7fbd-dirty
|
||||
pass_rate_1: 28.9
|
||||
pass_rate_2: 59.6
|
||||
pass_num_1: 65
|
||||
pass_num_2: 134
|
||||
percent_cases_well_formed: 92.9
|
||||
error_outputs: 22
|
||||
num_malformed_responses: 22
|
||||
num_with_malformed_responses: 16
|
||||
user_asks: 111
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 2816192
|
||||
completion_tokens: 342062
|
||||
test_timeouts: 1
|
||||
total_tests: 225
|
||||
command: aider --model openai/qwen3-235b-a22b
|
||||
date: 2025-05-09
|
||||
versions: 0.82.4.dev
|
||||
seconds_per_case: 45.4
|
||||
total_cost: 0.0000
|
||||
|
||||
- dirname: 2025-05-24-21-17-54--sonnet4-diff-exuser
|
||||
test_cases: 225
|
||||
model: claude-sonnet-4-20250514 (no thinking)
|
||||
edit_format: diff
|
||||
commit_hash: ef3f8bb-dirty
|
||||
pass_rate_1: 20.4
|
||||
pass_rate_2: 56.4
|
||||
pass_num_1: 46
|
||||
pass_num_2: 127
|
||||
percent_cases_well_formed: 98.2
|
||||
error_outputs: 6
|
||||
num_malformed_responses: 4
|
||||
num_with_malformed_responses: 4
|
||||
user_asks: 129
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 1
|
||||
prompt_tokens: 3460663
|
||||
completion_tokens: 433373
|
||||
test_timeouts: 7
|
||||
total_tests: 225
|
||||
command: aider --model claude-sonnet-4-20250514
|
||||
date: 2025-05-24
|
||||
versions: 0.83.3.dev
|
||||
seconds_per_case: 29.8
|
||||
total_cost: 15.8155
|
||||
|
||||
- dirname: 2025-05-24-22-10-36--sonnet4-diff-exuser-think32k
|
||||
test_cases: 225
|
||||
model: claude-sonnet-4-20250514 (32k thinking)
|
||||
edit_format: diff
|
||||
commit_hash: e3cb907
|
||||
thinking_tokens: 32000
|
||||
pass_rate_1: 25.8
|
||||
pass_rate_2: 61.3
|
||||
pass_num_1: 58
|
||||
pass_num_2: 138
|
||||
percent_cases_well_formed: 97.3
|
||||
error_outputs: 10
|
||||
num_malformed_responses: 10
|
||||
num_with_malformed_responses: 6
|
||||
user_asks: 111
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 2863068
|
||||
completion_tokens: 1271074
|
||||
test_timeouts: 6
|
||||
total_tests: 225
|
||||
command: aider --model claude-sonnet-4-20250514
|
||||
date: 2025-05-24
|
||||
versions: 0.83.3.dev
|
||||
seconds_per_case: 79.9
|
||||
total_cost: 26.5755
|
||||
|
||||
- dirname: 2025-05-25-19-57-20--opus4-diff-exuser
|
||||
test_cases: 225
|
||||
model: claude-opus-4-20250514 (no think)
|
||||
edit_format: diff
|
||||
commit_hash: 9ef3211
|
||||
pass_rate_1: 32.9
|
||||
pass_rate_2: 70.7
|
||||
pass_num_1: 74
|
||||
pass_num_2: 159
|
||||
percent_cases_well_formed: 98.7
|
||||
error_outputs: 3
|
||||
num_malformed_responses: 3
|
||||
num_with_malformed_responses: 3
|
||||
user_asks: 105
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 2671437
|
||||
completion_tokens: 380717
|
||||
test_timeouts: 3
|
||||
total_tests: 225
|
||||
command: aider --model claude-opus-4-20250514
|
||||
date: 2025-05-25
|
||||
versions: 0.83.3.dev
|
||||
seconds_per_case: 42.5
|
||||
total_cost: 68.6253
|
||||
|
||||
- dirname: 2025-05-25-20-40-51--opus4-diff-exuser
|
||||
test_cases: 225
|
||||
model: claude-opus-4-20250514 (32k thinking)
|
||||
edit_format: diff
|
||||
commit_hash: 9ef3211
|
||||
thinking_tokens: 32000
|
||||
pass_rate_1: 37.3
|
||||
pass_rate_2: 72.0
|
||||
pass_num_1: 84
|
||||
pass_num_2: 162
|
||||
percent_cases_well_formed: 97.3
|
||||
error_outputs: 10
|
||||
num_malformed_responses: 6
|
||||
num_with_malformed_responses: 6
|
||||
user_asks: 97
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 2567514
|
||||
completion_tokens: 363142
|
||||
test_timeouts: 4
|
||||
total_tests: 225
|
||||
command: aider --model claude-opus-4-20250514
|
||||
date: 2025-05-25
|
||||
versions: 0.83.3.dev
|
||||
seconds_per_case: 44.1
|
||||
total_cost: 65.7484
|
||||
|
||||
- dirname: 2025-05-26-15-56-31--flash25-05-20-24k-think # dirname is misleading
|
||||
test_cases: 225
|
||||
model: gemini-2.5-flash-preview-05-20 (no think)
|
||||
edit_format: diff
|
||||
commit_hash: 214b811-dirty
|
||||
thinking_tokens: 0 # <-- no thinking
|
||||
pass_rate_1: 20.9
|
||||
pass_rate_2: 44.0
|
||||
pass_num_1: 47
|
||||
pass_num_2: 99
|
||||
percent_cases_well_formed: 93.8
|
||||
error_outputs: 16
|
||||
num_malformed_responses: 16
|
||||
num_with_malformed_responses: 14
|
||||
user_asks: 79
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 5512458
|
||||
completion_tokens: 514145
|
||||
test_timeouts: 4
|
||||
total_tests: 225
|
||||
command: aider --model gemini/gemini-2.5-flash-preview-05-20
|
||||
date: 2025-05-26
|
||||
versions: 0.83.3.dev
|
||||
seconds_per_case: 12.2
|
||||
total_cost: 1.1354
|
||||
|
||||
- dirname: 2025-05-25-22-58-44--flash25-05-20-24k-think
|
||||
test_cases: 225
|
||||
model: gemini-2.5-flash-preview-05-20 (24k think)
|
||||
edit_format: diff
|
||||
commit_hash: a8568c3-dirty
|
||||
thinking_tokens: 24576
|
||||
pass_rate_1: 26.2
|
||||
pass_rate_2: 55.1
|
||||
pass_num_1: 59
|
||||
pass_num_2: 124
|
||||
percent_cases_well_formed: 95.6
|
||||
error_outputs: 15
|
||||
num_malformed_responses: 15
|
||||
num_with_malformed_responses: 10
|
||||
user_asks: 101
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 3666792
|
||||
completion_tokens: 2703162
|
||||
test_timeouts: 4
|
||||
total_tests: 225
|
||||
command: aider --model gemini/gemini-2.5-flash-preview-05-20
|
||||
date: 2025-05-25
|
||||
versions: 0.83.3.dev
|
||||
seconds_per_case: 53.9
|
||||
total_cost: 8.5625
|
||||
|
||||
- dirname: 2025-06-06-18-38-56--gemini0605-diff-fenced
|
||||
test_cases: 225
|
||||
model: gemini-2.5-pro-preview-06-05 (default think)
|
||||
edit_format: diff-fenced
|
||||
commit_hash: 4c161f9-dirty
|
||||
pass_rate_1: 44.9
|
||||
pass_rate_2: 79.1
|
||||
pass_num_1: 101
|
||||
pass_num_2: 178
|
||||
percent_cases_well_formed: 100.0
|
||||
error_outputs: 4
|
||||
num_malformed_responses: 0
|
||||
num_with_malformed_responses: 0
|
||||
user_asks: 105
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 4
|
||||
prompt_tokens: 2751296
|
||||
completion_tokens: 4142197
|
||||
test_timeouts: 1
|
||||
total_tests: 225
|
||||
command: aider --model gemini/gemini-2.5-pro-preview-06-05
|
||||
date: 2025-06-06
|
||||
versions: 0.84.1.dev
|
||||
seconds_per_case: 175.2
|
||||
total_cost: 45.5961
|
||||
|
||||
- dirname: 2025-06-06-16-36-21--gemini0605-32k-think-diff-fenced
|
||||
test_cases: 225
|
||||
model: gemini-2.5-pro-preview-06-05 (32k think)
|
||||
edit_format: diff-fenced
|
||||
commit_hash: f827f22
|
||||
thinking_tokens: 32768
|
||||
pass_rate_1: 46.2
|
||||
pass_rate_2: 83.1
|
||||
pass_num_1: 104
|
||||
pass_num_2: 187
|
||||
percent_cases_well_formed: 99.6
|
||||
error_outputs: 1
|
||||
num_malformed_responses: 1
|
||||
num_with_malformed_responses: 1
|
||||
user_asks: 112
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 2719961
|
||||
completion_tokens: 4648227
|
||||
test_timeouts: 0
|
||||
total_tests: 225
|
||||
command: aider --model gemini/gemini-2.5-pro-preview-06-05 --thinking-tokens 32k
|
||||
date: 2025-06-06
|
||||
versions: 0.84.1.dev
|
||||
seconds_per_case: 200.3
|
||||
total_cost: 49.8822
|
||||
|
||||
- dirname: 2025-06-06-16-47-07--r1-diff
|
||||
test_cases: 224
|
||||
model: DeepSeek R1 (0528)
|
||||
edit_format: diff
|
||||
commit_hash: 4c161f9-dirty
|
||||
pass_rate_1: 34.4
|
||||
pass_rate_2: 71.4
|
||||
pass_num_1: 77
|
||||
pass_num_2: 160
|
||||
percent_cases_well_formed: 94.6
|
||||
error_outputs: 28
|
||||
num_malformed_responses: 15
|
||||
num_with_malformed_responses: 12
|
||||
user_asks: 105
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 2644169
|
||||
completion_tokens: 1842168
|
||||
test_timeouts: 2
|
||||
total_tests: 225
|
||||
command: aider --model deepseek/deepseek-reasoner
|
||||
date: 2025-06-06
|
||||
versions: 0.84.1.dev
|
||||
seconds_per_case: 716.6
|
||||
total_cost: 4.8016
|
||||
|
||||
- dirname: 2025-06-25-21-04-24--o3-price-reduction-high
|
||||
test_cases: 225
|
||||
model: o3 (high)
|
||||
edit_format: diff
|
||||
commit_hash: c48fea6
|
||||
reasoning_effort: high
|
||||
pass_rate_1: 40.0
|
||||
pass_rate_2: 81.3
|
||||
pass_num_1: 90
|
||||
pass_num_2: 183
|
||||
percent_cases_well_formed: 94.7
|
||||
error_outputs: 25
|
||||
num_malformed_responses: 23
|
||||
num_with_malformed_responses: 12
|
||||
user_asks: 116
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 1
|
||||
prompt_tokens: 3148932
|
||||
completion_tokens: 2047615
|
||||
test_timeouts: 2
|
||||
total_tests: 225
|
||||
command: aider --model o3 --reasoning-effort high
|
||||
date: 2025-06-25
|
||||
versions: 0.84.1.dev
|
||||
seconds_per_case: 197.3
|
||||
total_cost: 21.2259
|
||||
|
||||
- dirname: 2025-06-25-20-30-16--o3-price-reduction
|
||||
test_cases: 225
|
||||
model: o3
|
||||
edit_format: diff
|
||||
commit_hash: c48fea6
|
||||
pass_rate_1: 40.9
|
||||
pass_rate_2: 76.9
|
||||
pass_num_1: 92
|
||||
pass_num_2: 173
|
||||
percent_cases_well_formed: 93.8
|
||||
error_outputs: 22
|
||||
num_malformed_responses: 22
|
||||
num_with_malformed_responses: 14
|
||||
user_asks: 108
|
||||
lazy_comments: 2
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 2893189
|
||||
completion_tokens: 1154767
|
||||
test_timeouts: 1
|
||||
total_tests: 225
|
||||
command: aider --model o3
|
||||
date: 2025-06-25
|
||||
versions: 0.84.1.dev
|
||||
seconds_per_case: 101.7
|
||||
total_cost: 13.7517
|
||||
|
||||
- dirname: 2025-06-27-23-53-57--o3-mini-high-diff-arch
|
||||
test_cases: 224
|
||||
model: o3 (high) + gpt-4.1
|
||||
edit_format: architect
|
||||
commit_hash: 4f4f00f-dirty
|
||||
editor_model: gpt-4.1
|
||||
editor_edit_format: editor-diff
|
||||
reasoning_effort: high
|
||||
pass_rate_1: 34.8
|
||||
pass_rate_2: 78.2
|
||||
pass_num_1: 78
|
||||
pass_num_2: 176
|
||||
percent_cases_well_formed: 100.0
|
||||
error_outputs: 18
|
||||
num_malformed_responses: 0
|
||||
num_with_malformed_responses: 0
|
||||
user_asks: 172
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 1
|
||||
prompt_tokens: 1306877
|
||||
completion_tokens: 1327154
|
||||
test_timeouts: 1
|
||||
total_tests: 225
|
||||
command: aider --model o3
|
||||
date: 2025-06-27
|
||||
versions: 0.85.1.dev
|
||||
seconds_per_case: 121.8
|
||||
total_cost: 17.5518
|
||||
|
||||
- dirname: 2025-06-28-00-38-18--o3-pro-high
|
||||
test_cases: 225
|
||||
model: o3-pro (high)
|
||||
edit_format: diff
|
||||
commit_hash: 5318380
|
||||
reasoning_effort: high
|
||||
pass_rate_1: 43.6
|
||||
pass_rate_2: 84.9
|
||||
pass_num_1: 98
|
||||
pass_num_2: 191
|
||||
percent_cases_well_formed: 97.8
|
||||
error_outputs: 20
|
||||
num_malformed_responses: 8
|
||||
num_with_malformed_responses: 5
|
||||
user_asks: 100
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 2372636
|
||||
completion_tokens: 1235902
|
||||
test_timeouts: 1
|
||||
total_tests: 225
|
||||
command: aider --model o3-pro
|
||||
date: 2025-06-28
|
||||
versions: 0.85.1.dev
|
||||
seconds_per_case: 449.0
|
||||
total_cost: 146.3249
|
||||
|
||||
- dirname: 2025-07-11-19-37-40--xai-or-grok4-high
|
||||
test_cases: 225
|
||||
model: grok-4 (high)
|
||||
edit_format: diff
|
||||
commit_hash: f7870b6-dirty
|
||||
reasoning_effort: high
|
||||
pass_rate_1: 40.9
|
||||
pass_rate_2: 79.6
|
||||
pass_num_1: 92
|
||||
pass_num_2: 179
|
||||
percent_cases_well_formed: 97.3
|
||||
error_outputs: 11
|
||||
num_malformed_responses: 8
|
||||
num_with_malformed_responses: 6
|
||||
user_asks: 133
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 2815347
|
||||
completion_tokens: 3411480
|
||||
test_timeouts: 0
|
||||
total_tests: 225
|
||||
command: aider --model openrouter/x-ai/grok-4
|
||||
date: 2025-07-11
|
||||
versions: 0.85.2.dev
|
||||
seconds_per_case: 403.2
|
||||
total_cost: 59.6182
|
||||
|
||||
- dirname: 2025-07-17-17-41-54--kimi-k2-diff-or-pricing
|
||||
test_cases: 225
|
||||
model: Kimi K2
|
||||
edit_format: diff
|
||||
commit_hash: 915ebff-dirty
|
||||
pass_rate_1: 20.4
|
||||
pass_rate_2: 59.1
|
||||
pass_num_1: 46
|
||||
pass_num_2: 133
|
||||
percent_cases_well_formed: 92.9
|
||||
error_outputs: 19
|
||||
num_malformed_responses: 19
|
||||
num_with_malformed_responses: 16
|
||||
user_asks: 61
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 2355141
|
||||
completion_tokens: 363846
|
||||
test_timeouts: 4
|
||||
total_tests: 225
|
||||
command: aider --model openrouter/moonshotai/kimi-k2
|
||||
date: 2025-07-17
|
||||
versions: 0.85.3.dev
|
||||
seconds_per_case: 67.6
|
||||
total_cost: 1.2357
|
||||
|
||||
- dirname: 2025-08-06-04-54-48--gpt-oss-120b-high-polyglot
|
||||
test_cases: 225
|
||||
model: gpt-oss-120b (high)
|
||||
edit_format: diff
|
||||
commit_hash: 1af0e59
|
||||
pass_rate_1: 13.8
|
||||
pass_rate_2: 41.8
|
||||
pass_num_1: 31
|
||||
pass_num_2: 94
|
||||
percent_cases_well_formed: 79.1
|
||||
error_outputs: 95
|
||||
num_malformed_responses: 77
|
||||
num_with_malformed_responses: 47
|
||||
user_asks: 142
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 3123768
|
||||
completion_tokens: 856495
|
||||
test_timeouts: 4
|
||||
total_tests: 225
|
||||
command: aider --model openrouter/openai/gpt-oss-120b --reasoning-effort high
|
||||
date: 2025-08-06
|
||||
versions: 0.85.3.dev
|
||||
seconds_per_case: 35.5
|
||||
total_cost: 0.7406
|
||||
|
||||
272
aider/website/_data/qwen3_leaderboard.yml
Normal file
272
aider/website/_data/qwen3_leaderboard.yml
Normal file
@@ -0,0 +1,272 @@
|
||||
- dirname: 2025-05-08-03-20-24--qwen3-32b-default
|
||||
test_cases: 225
|
||||
model: Qwen3 32B diff on OpenRouter, all providers, default settings (thinking)
|
||||
edit_format: diff
|
||||
commit_hash: aaacee5-dirty, aeaf259
|
||||
pass_rate_1: 14.2
|
||||
pass_rate_2: 40.0
|
||||
pass_num_1: 32
|
||||
pass_num_2: 90
|
||||
percent_cases_well_formed: 83.6
|
||||
error_outputs: 119
|
||||
num_malformed_responses: 50
|
||||
num_with_malformed_responses: 37
|
||||
user_asks: 97
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 12
|
||||
prompt_tokens: 317591
|
||||
completion_tokens: 120418
|
||||
test_timeouts: 5
|
||||
total_tests: 225
|
||||
command: aider --model openrouter/qwen/qwen3-32b
|
||||
date: 2025-05-08
|
||||
versions: 0.82.4.dev
|
||||
seconds_per_case: 372.2
|
||||
total_cost: 0.7603
|
||||
|
||||
- dirname: 2025-05-08-03-22-37--qwen3-235b-defaults
|
||||
test_cases: 225
|
||||
model: Qwen3 235B A22B diff on OpenRouter, all providers, default settings (thinking)
|
||||
edit_format: diff
|
||||
commit_hash: aaacee5-dirty
|
||||
pass_rate_1: 17.3
|
||||
pass_rate_2: 49.8
|
||||
pass_num_1: 39
|
||||
pass_num_2: 112
|
||||
percent_cases_well_formed: 91.6
|
||||
error_outputs: 58
|
||||
num_malformed_responses: 29
|
||||
num_with_malformed_responses: 19
|
||||
user_asks: 102
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 0
|
||||
completion_tokens: 0
|
||||
test_timeouts: 1
|
||||
total_tests: 225
|
||||
command: aider --model openrouter/qwen/qwen3-235b-a22b
|
||||
date: 2025-05-08
|
||||
versions: 0.82.4.dev
|
||||
seconds_per_case: 428.1
|
||||
total_cost: 1.8037
|
||||
|
||||
|
||||
- dirname: 2025-05-08-17-39-14--qwen3-235b-or-together-only
|
||||
test_cases: 225
|
||||
model: Qwen3 235B A22B diff on OpenRouter only TogetherAI, recommended /no_think settings
|
||||
edit_format: diff
|
||||
commit_hash: 328584e
|
||||
pass_rate_1: 28.0
|
||||
pass_rate_2: 54.7
|
||||
pass_num_1: 63
|
||||
pass_num_2: 123
|
||||
percent_cases_well_formed: 90.7
|
||||
error_outputs: 39
|
||||
num_malformed_responses: 32
|
||||
num_with_malformed_responses: 21
|
||||
user_asks: 106
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 2816606
|
||||
completion_tokens: 362346
|
||||
test_timeouts: 2
|
||||
total_tests: 225
|
||||
command: aider --model openrouter/qwen/qwen3-235b-a22b
|
||||
date: 2025-05-08
|
||||
versions: 0.82.4.dev
|
||||
seconds_per_case: 77.2
|
||||
total_cost: 0.6399
|
||||
|
||||
|
||||
- dirname: 2025-04-30-04-49-37--Qwen3-235B-A22B-whole-nothink
|
||||
test_cases: 225
|
||||
model: Qwen3-235B-A22B whole with VLLM, bfloat16, recommended /no_think settings
|
||||
edit_format: whole
|
||||
commit_hash: 0c383df-dirty
|
||||
pass_rate_1: 28.0
|
||||
pass_rate_2: 65.3
|
||||
pass_num_1: 63
|
||||
pass_num_2: 147
|
||||
percent_cases_well_formed: 100.0
|
||||
error_outputs: 3
|
||||
num_malformed_responses: 0
|
||||
num_with_malformed_responses: 0
|
||||
user_asks: 166
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 3
|
||||
test_timeouts: 0
|
||||
total_tests: 225
|
||||
command: aider --model openai/Qwen3-235B-A22B
|
||||
date: 2025-04-30
|
||||
versions: 0.81.4.dev
|
||||
seconds_per_case: 166.0
|
||||
total_cost: 0.0000
|
||||
|
||||
- dirname: 2025-04-30-04-49-50--Qwen3-235B-A22B-diff-nothink
|
||||
test_cases: 225
|
||||
model: Qwen3-235B-A22B diff with VLLM, bfloat16, recommended /no_think settings
|
||||
edit_format: diff
|
||||
commit_hash: 0c383df-dirty
|
||||
pass_rate_1: 29.8
|
||||
pass_rate_2: 61.3
|
||||
pass_num_1: 67
|
||||
pass_num_2: 138
|
||||
percent_cases_well_formed: 94.7
|
||||
error_outputs: 25
|
||||
num_malformed_responses: 25
|
||||
num_with_malformed_responses: 12
|
||||
user_asks: 97
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 2
|
||||
total_tests: 225
|
||||
command: aider --model openai/Qwen3-235B-A22B
|
||||
date: 2025-04-30
|
||||
versions: 0.81.4.dev
|
||||
seconds_per_case: 158.2
|
||||
total_cost: 0.0000
|
||||
|
||||
- dirname: 2025-04-30-04-08-41--Qwen3-32B-whole-nothink
|
||||
test_cases: 225
|
||||
model: Qwen3-32B whole with VLLM, bfloat16, recommended /no_think settings
|
||||
edit_format: whole
|
||||
commit_hash: 0c383df-dirty
|
||||
pass_rate_1: 20.4
|
||||
pass_rate_2: 45.8
|
||||
pass_num_1: 46
|
||||
pass_num_2: 103
|
||||
percent_cases_well_formed: 100.0
|
||||
error_outputs: 3
|
||||
num_malformed_responses: 0
|
||||
num_with_malformed_responses: 0
|
||||
user_asks: 94
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 3
|
||||
test_timeouts: 5
|
||||
total_tests: 225
|
||||
command: aider --model openai/Qwen3-32B
|
||||
date: 2025-04-30
|
||||
versions: 0.81.4.dev
|
||||
seconds_per_case: 48.1
|
||||
total_cost: 0.0000
|
||||
|
||||
- dirname: 2025-04-30-04-08-51--Qwen3-32B-diff-nothink
|
||||
test_cases: 225
|
||||
model: Qwen3-32B diff with VLLM, bfloat16, recommended /no_think settings
|
||||
edit_format: diff
|
||||
commit_hash: 0c383df-dirty
|
||||
pass_rate_1: 20.4
|
||||
pass_rate_2: 41.3
|
||||
pass_num_1: 46
|
||||
pass_num_2: 93
|
||||
percent_cases_well_formed: 94.2
|
||||
error_outputs: 17
|
||||
num_malformed_responses: 14
|
||||
num_with_malformed_responses: 13
|
||||
user_asks: 83
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 3
|
||||
test_timeouts: 4
|
||||
total_tests: 225
|
||||
command: aider --model openai/Qwen3-32B
|
||||
date: 2025-04-30
|
||||
versions: 0.81.4.dev
|
||||
seconds_per_case: 59.4
|
||||
total_cost: 0.0000
|
||||
|
||||
- dirname: 2025-05-07-03-15-59--Qwen3-235B-A22B-Q5_K_M-whole-nothink
|
||||
test_cases: 225
|
||||
model: Qwen3-235B-A22B whole with llama.cpp, Q5_K_M (unsloth), recommended /no_think settings
|
||||
edit_format: whole
|
||||
commit_hash: 8159cbf
|
||||
pass_rate_1: 27.1
|
||||
pass_rate_2: 59.1
|
||||
pass_num_1: 61
|
||||
pass_num_2: 133
|
||||
percent_cases_well_formed: 100.0
|
||||
error_outputs: 1
|
||||
num_malformed_responses: 0
|
||||
num_with_malformed_responses: 0
|
||||
user_asks: 169
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 1
|
||||
total_tests: 225
|
||||
command: aider --model openai/Qwen3-235B-A22B-Q5_K_M
|
||||
date: 2025-05-07
|
||||
versions: 0.82.4.dev
|
||||
seconds_per_case: 635.2
|
||||
total_cost: 0.0000
|
||||
|
||||
|
||||
- dirname: 2025-05-09-17-02-02--qwen3-235b-a22b.unthink_16k_diff
|
||||
test_cases: 225
|
||||
model: Qwen3 235B A22B diff, no think, via official Alibaba API
|
||||
edit_format: diff
|
||||
commit_hash: 91d7fbd-dirty
|
||||
pass_rate_1: 28.9
|
||||
pass_rate_2: 59.6
|
||||
pass_num_1: 65
|
||||
pass_num_2: 134
|
||||
percent_cases_well_formed: 92.9
|
||||
error_outputs: 22
|
||||
num_malformed_responses: 22
|
||||
num_with_malformed_responses: 16
|
||||
user_asks: 111
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 2816192
|
||||
completion_tokens: 342062
|
||||
test_timeouts: 1
|
||||
total_tests: 225
|
||||
command: aider --model openai/qwen3-235b-a22b
|
||||
date: 2025-05-09
|
||||
versions: 0.82.4.dev
|
||||
seconds_per_case: 45.4
|
||||
total_cost: 0.0000
|
||||
|
||||
- dirname: 2025-05-09-23-01-22--qwen3-235b-a22b.unthink_16k_whole
|
||||
test_cases: 225
|
||||
model: Qwen3 235B A22B whole, no think, via official Alibaba API
|
||||
edit_format: whole
|
||||
commit_hash: 425fb6d
|
||||
pass_rate_1: 26.7
|
||||
pass_rate_2: 61.8
|
||||
pass_num_1: 60
|
||||
pass_num_2: 139
|
||||
percent_cases_well_formed: 100.0
|
||||
error_outputs: 0
|
||||
num_malformed_responses: 0
|
||||
num_with_malformed_responses: 0
|
||||
user_asks: 175
|
||||
lazy_comments: 0
|
||||
syntax_errors: 0
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
prompt_tokens: 2768173
|
||||
completion_tokens: 384000
|
||||
test_timeouts: 1
|
||||
total_tests: 225
|
||||
command: aider --model openai/qwen3-235b-a22b
|
||||
date: 2025-05-09
|
||||
versions: 0.82.4.dev
|
||||
seconds_per_case: 50.8
|
||||
total_cost: 0.0000
|
||||
@@ -27,7 +27,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
labels: labels,
|
||||
datasets: [{
|
||||
label: 'Aider\'s percent of new code by release',
|
||||
data: [{% for row in site.data.blame %}{ x: '{{ row.end_tag }}', y: {{ row.aider_percentage }}, lines: {{ row.aider_total }} },{% endfor %}],
|
||||
data: [{% for row in site.data.blame %}{ x: '{{ row.end_tag }}', y: {{ row.aider_percentage }}, lines: {{ row.aider_total }}, end_date: '{{ row.end_date }}' },{% endfor %}],
|
||||
backgroundColor: 'rgba(54, 162, 235, 0.8)',
|
||||
borderColor: 'rgba(54, 162, 235, 1)',
|
||||
borderWidth: 1
|
||||
@@ -88,6 +88,10 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
var value = context.parsed.y || 0;
|
||||
var lines = context.raw.lines || 0;
|
||||
return `${label}: ${Math.round(value)}% (${lines} lines)`;
|
||||
},
|
||||
afterLabel: function(context) {
|
||||
let date = context.raw.end_date || 'n/a';
|
||||
return `Date: ` + date;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
3
aider/website/_includes/footer_custom.html
Normal file
3
aider/website/_includes/footer_custom.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<div class="ea-ad ea-ad--mobile" aria-label="Advertisement">
|
||||
<div data-ea-publisher="aiderchat" data-ea-type="text"></div>
|
||||
</div>
|
||||
@@ -1,10 +1,13 @@
|
||||
|
||||
If you already have python 3.8-3.13 installed, you can get started quickly like this:
|
||||
If you already have python 3.8-3.13 installed, you can get started quickly like this.
|
||||
|
||||
First, install aider:
|
||||
|
||||
{% include install.md %}
|
||||
|
||||
Start working with aider on your codebase:
|
||||
|
||||
```bash
|
||||
python -m pip install aider-install
|
||||
aider-install
|
||||
|
||||
# Change directory into your codebase
|
||||
cd /to/your/project
|
||||
|
||||
|
||||
@@ -32,12 +32,19 @@
|
||||
.side-bar {
|
||||
background: linear-gradient(135deg, #ffffff 0%, rgba(20, 176, 20, 0.01) 25%, rgba(20, 176, 20, 0.04) 40%, rgba(220, 230, 255, 0.4) 60%, rgba(205, 218, 255, 0.4) 80%, #F5F6FA 100%);
|
||||
}
|
||||
|
||||
@media (max-width: 50em) {
|
||||
.ea-ad--sidebar { display: none; }
|
||||
.ea-ad--mobile { display: block; }
|
||||
}
|
||||
</style>
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="{{ site.url }}/feed.xml">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link rel="preload" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap" as="style" type="text/css" crossorigin>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<script async src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
|
||||
|
||||
<!-- Logo Progressive Enhancement for Jekyll pages -->
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
@@ -2,7 +2,7 @@ If you need more help, please check our
|
||||
[GitHub issues](https://github.com/Aider-AI/aider/issues)
|
||||
and file a new issue if your problem isn't discussed.
|
||||
Or drop into our
|
||||
[Discord](https://discord.gg/Tv2uQnR88V)
|
||||
[Discord](https://discord.gg/Y7X7bhMQFV)
|
||||
to chat with us.
|
||||
|
||||
When reporting problems, it is very helpful if you can provide:
|
||||
|
||||
5
aider/website/_includes/install.md
Normal file
5
aider/website/_includes/install.md
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
```bash
|
||||
python -m pip install aider-install
|
||||
aider-install
|
||||
```
|
||||
@@ -17,14 +17,14 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
backgroundColor: function(context) {
|
||||
const row = allData[context.dataIndex];
|
||||
if (row && row.edit_format === 'whole') {
|
||||
return diagonalPattern;
|
||||
return redDiagonalPattern; // Use red pattern for highlighted whole format
|
||||
}
|
||||
const label = leaderboardData.labels[context.dataIndex] || '';
|
||||
return (label && label.includes(HIGHLIGHT_MODEL)) ? 'rgba(255, 99, 132, 0.2)' : 'rgba(54, 162, 235, 0.2)';
|
||||
return (label && HIGHLIGHT_MODEL && label.toLowerCase().includes(HIGHLIGHT_MODEL.toLowerCase())) ? 'rgba(255, 99, 132, 0.2)' : 'rgba(54, 162, 235, 0.2)';
|
||||
},
|
||||
borderColor: function(context) {
|
||||
const label = context.chart.data.labels[context.dataIndex] || '';
|
||||
return (label && label.includes(HIGHLIGHT_MODEL)) ? 'rgba(255, 99, 132, 1)' : 'rgba(54, 162, 235, 1)';
|
||||
return (label && HIGHLIGHT_MODEL && label.toLowerCase().includes(HIGHLIGHT_MODEL.toLowerCase())) ? 'rgba(255, 99, 132, 1)' : 'rgba(54, 162, 235, 1)';
|
||||
},
|
||||
borderWidth: 1
|
||||
}, {
|
||||
@@ -78,11 +78,13 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
leaderboardChart.render();
|
||||
}
|
||||
|
||||
// Use displayedData in the backgroundColor callback instead of allData
|
||||
// Update backgroundColor and borderColor for the main dataset based on displayedData
|
||||
leaderboardData.datasets[0].backgroundColor = function(context) {
|
||||
const row = displayedData[context.dataIndex];
|
||||
const label = leaderboardData.labels[context.dataIndex] || '';
|
||||
if (label && label.includes(HIGHLIGHT_MODEL)) {
|
||||
const isHighlighted = label && HIGHLIGHT_MODEL && label.toLowerCase().includes(HIGHLIGHT_MODEL.toLowerCase());
|
||||
|
||||
if (isHighlighted) {
|
||||
if (row && row.edit_format === 'whole') return redDiagonalPattern;
|
||||
else return 'rgba(255, 99, 132, 0.2)';
|
||||
} else if (row && row.edit_format === 'whole') {
|
||||
|
||||
520
aider/website/_includes/leaderboard_table.js
Normal file
520
aider/website/_includes/leaderboard_table.js
Normal file
@@ -0,0 +1,520 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
let currentMode = 'view'; // 'view', 'select', 'detail'
|
||||
let selectedRows = new Set(); // Store indices of selected rows
|
||||
const MAX_DISPLAY_COST_CAP = 200; // Define the constant here
|
||||
|
||||
const allMainRows = document.querySelectorAll('tr[id^="main-row-"]');
|
||||
const allDetailsRows = document.querySelectorAll('tr[id^="details-"]');
|
||||
const searchInput = document.getElementById('editSearchInput');
|
||||
const modeViewButton = document.getElementById('mode-view-btn');
|
||||
const modeDetailButton = document.getElementById('mode-detail-btn');
|
||||
const modeSelectButton = document.getElementById('mode-select-btn');
|
||||
const modeButtons = [modeViewButton, modeSelectButton, modeDetailButton];
|
||||
const selectAllCheckbox = document.getElementById('select-all-checkbox');
|
||||
const leaderboardTitle = document.getElementById('leaderboard-title'); // Get title element
|
||||
const defaultTitle = "Aider polyglot coding leaderboard";
|
||||
const filteredTitle = "Aider polyglot coding benchmark results (selected)";
|
||||
|
||||
function applySearchFilter() {
|
||||
const searchTerm = searchInput.value.toLowerCase();
|
||||
allMainRows.forEach(row => {
|
||||
const textContent = row.textContent.toLowerCase();
|
||||
const detailsRow = document.getElementById(row.id.replace('main-row-', 'details-'));
|
||||
const matchesSearch = textContent.includes(searchTerm);
|
||||
|
||||
if (matchesSearch) {
|
||||
row.classList.remove('hidden-by-search');
|
||||
if (detailsRow) detailsRow.classList.remove('hidden-by-search');
|
||||
} else {
|
||||
row.classList.add('hidden-by-search');
|
||||
if (detailsRow) detailsRow.classList.add('hidden-by-search');
|
||||
}
|
||||
});
|
||||
// After applying search filter, re-apply view mode filter and update select-all state
|
||||
updateTableView(currentMode);
|
||||
if (currentMode === 'select') {
|
||||
updateSelectAllCheckboxState();
|
||||
}
|
||||
|
||||
// Update cost bars and ticks since visible rows may have changed
|
||||
updateCostBars();
|
||||
updateCostTicks();
|
||||
}
|
||||
|
||||
function getVisibleMainRows() {
|
||||
// Helper to get rows currently visible (not hidden by search or mode)
|
||||
return Array.from(allMainRows).filter(row =>
|
||||
!row.classList.contains('hidden-by-search') && !row.classList.contains('hidden-by-mode')
|
||||
);
|
||||
}
|
||||
|
||||
function updateSelectAllCheckboxState() {
|
||||
// Update the header checkbox based on the selection state of *visible* rows
|
||||
if (currentMode !== 'select') return; // Only relevant in select mode
|
||||
|
||||
const visibleRows = getVisibleMainRows();
|
||||
const visibleRowCount = visibleRows.length;
|
||||
const selectedVisibleRowCount = visibleRows.filter(row => selectedRows.has(row.querySelector('.row-selector')?.dataset.rowIndex)).length;
|
||||
|
||||
if (visibleRowCount === 0) {
|
||||
selectAllCheckbox.checked = false;
|
||||
selectAllCheckbox.indeterminate = false;
|
||||
} else if (selectedVisibleRowCount === visibleRowCount) {
|
||||
selectAllCheckbox.checked = true;
|
||||
selectAllCheckbox.indeterminate = false;
|
||||
} else if (selectedVisibleRowCount > 0) {
|
||||
selectAllCheckbox.checked = false;
|
||||
selectAllCheckbox.indeterminate = true;
|
||||
} else {
|
||||
selectAllCheckbox.checked = false;
|
||||
selectAllCheckbox.indeterminate = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function updateTableView(mode) {
|
||||
currentMode = mode; // Update global state ('view', 'select', 'detail')
|
||||
|
||||
// Update button styles first
|
||||
modeButtons.forEach(btn => {
|
||||
btn.classList.remove('active');
|
||||
// Reset specific styles potentially added by .active
|
||||
btn.style.backgroundColor = '';
|
||||
btn.style.color = '';
|
||||
});
|
||||
let activeButton;
|
||||
if (mode === 'view') activeButton = modeViewButton;
|
||||
else if (mode === 'select') activeButton = modeSelectButton;
|
||||
else if (mode === 'detail') activeButton = modeDetailButton;
|
||||
|
||||
activeButton.classList.add('active');
|
||||
activeButton.style.backgroundColor = '#e7f3ff'; // Use selected row highlight blue
|
||||
activeButton.style.color = '#495057'; // Use dark text for contrast on light blue
|
||||
|
||||
// Get the first header cell (for the toggle/checkbox column)
|
||||
const firstHeaderCell = document.querySelector('table thead th:first-child');
|
||||
|
||||
// Show/hide header checkbox based on mode
|
||||
selectAllCheckbox.style.display = mode === 'select' ? 'inline-block' : 'none';
|
||||
|
||||
allMainRows.forEach(row => {
|
||||
const rowIndex = row.querySelector('.row-selector')?.dataset.rowIndex;
|
||||
const toggleButton = row.querySelector('.toggle-details');
|
||||
const selectorCheckbox = row.querySelector('.row-selector');
|
||||
const firstCell = row.querySelector('td:first-child'); // Get the first cell of the main row
|
||||
const detailsRow = document.getElementById(`details-${rowIndex}`);
|
||||
const isSelected = selectedRows.has(rowIndex);
|
||||
|
||||
// Reset visibility classes before applying mode logic
|
||||
row.classList.remove('hidden-by-mode');
|
||||
if (detailsRow) detailsRow.classList.remove('hidden-by-mode');
|
||||
|
||||
// Show/hide the first column (header and data cells) based on mode
|
||||
if (firstHeaderCell) {
|
||||
firstHeaderCell.style.display = mode === 'view' ? 'none' : '';
|
||||
}
|
||||
if (firstCell) {
|
||||
firstCell.style.display = mode === 'view' ? 'none' : '';
|
||||
}
|
||||
|
||||
// Apply mode-specific logic
|
||||
if (mode === 'view') { // --- VIEW MODE ---
|
||||
toggleButton.style.display = 'none'; // Hide toggle in view mode
|
||||
selectorCheckbox.style.display = 'none';
|
||||
row.classList.remove('row-selected'); // Ensure no selection highlight
|
||||
// view-highlighted is handled by row click listener
|
||||
|
||||
// In 'view' mode, hide row if selections exist AND this row is NOT selected
|
||||
if (selectedRows.size > 0 && !isSelected) {
|
||||
row.classList.add('hidden-by-mode');
|
||||
if (detailsRow) detailsRow.classList.add('hidden-by-mode');
|
||||
} else {
|
||||
// Ensure row is not hidden by mode if it's selected or no selections exist
|
||||
// This is handled by the reset at the start of the loop:
|
||||
// row.classList.remove('hidden-by-mode');
|
||||
// if (detailsRow) detailsRow.classList.remove('hidden-by-mode');
|
||||
}
|
||||
// Always hide details row content in view mode regardless of visibility class
|
||||
if (detailsRow) {
|
||||
detailsRow.style.display = 'none';
|
||||
}
|
||||
|
||||
} else if (mode === 'select') { // --- SELECT MODE ---
|
||||
toggleButton.style.display = 'none';
|
||||
selectorCheckbox.style.display = 'inline-block';
|
||||
selectorCheckbox.checked = isSelected;
|
||||
row.classList.toggle('row-selected', isSelected);
|
||||
row.classList.remove('view-highlighted'); // Clear view highlight when switching to select
|
||||
// Always hide details row in select mode
|
||||
if (detailsRow) detailsRow.style.display = 'none';
|
||||
|
||||
// In 'select' mode, no rows should be hidden based on selection status
|
||||
row.classList.remove('hidden-by-mode');
|
||||
if (detailsRow) detailsRow.classList.remove('hidden-by-mode');
|
||||
|
||||
} else { // --- DETAIL MODE --- (mode === 'detail')
|
||||
toggleButton.style.display = 'inline-block'; // Show toggle
|
||||
selectorCheckbox.style.display = 'none';
|
||||
row.classList.remove('row-selected'); // Clear selection highlight
|
||||
row.classList.remove('view-highlighted'); // Clear view highlight when switching to detail
|
||||
// Details row visibility is controlled by the toggle button state, don't force hide/show here
|
||||
// Ensure main row is visible if not hidden by search
|
||||
row.classList.remove('hidden-by-mode');
|
||||
if (detailsRow) {
|
||||
detailsRow.classList.remove('hidden-by-mode');
|
||||
// Preserve existing display state (controlled by toggle) unless hidden by search
|
||||
if (detailsRow.classList.contains('hidden-by-search')) {
|
||||
detailsRow.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Ensure rows hidden by search remain hidden regardless of mode
|
||||
if (row.classList.contains('hidden-by-search')) {
|
||||
row.style.display = 'none';
|
||||
if (detailsRow) detailsRow.style.display = 'none';
|
||||
} else if (!row.classList.contains('hidden-by-mode')) {
|
||||
// Make row visible if not hidden by search or mode
|
||||
row.style.display = ''; // Or 'table-row' if needed, but '' usually works
|
||||
} else {
|
||||
// Row is hidden by mode, ensure it's hidden
|
||||
row.style.display = 'none';
|
||||
if (detailsRow) detailsRow.style.display = 'none';
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// Update the leaderboard title based on mode and selection
|
||||
if (leaderboardTitle) {
|
||||
// Check if a custom title is provided globally
|
||||
if (typeof LEADERBOARD_CUSTOM_TITLE !== 'undefined' && LEADERBOARD_CUSTOM_TITLE) {
|
||||
leaderboardTitle.textContent = LEADERBOARD_CUSTOM_TITLE;
|
||||
} else {
|
||||
if (currentMode === 'view' && selectedRows.size > 0) {
|
||||
leaderboardTitle.textContent = filteredTitle;
|
||||
} else {
|
||||
leaderboardTitle.textContent = defaultTitle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update the select-all checkbox state after updating the view
|
||||
updateSelectAllCheckboxState();
|
||||
|
||||
// Update cost bars and ticks since visible/selected rows may have changed
|
||||
updateCostBars();
|
||||
updateCostTicks();
|
||||
}
|
||||
|
||||
|
||||
// --- Existing Initializations ---
|
||||
// Add percentage ticks
|
||||
const percentCells = document.querySelectorAll('.bar-cell:not(.cost-bar-cell)');
|
||||
percentCells.forEach(cell => {
|
||||
// Add ticks at 0%, 10%, 20%, ..., 100%
|
||||
for (let i = 0; i <= 100; i += 10) {
|
||||
const tick = document.createElement('div');
|
||||
tick.className = 'percent-tick';
|
||||
tick.style.left = `${i}%`;
|
||||
cell.appendChild(tick);
|
||||
}
|
||||
});
|
||||
|
||||
// Function to calculate the appropriate max display cost based on visible/selected entries
|
||||
function calculateDisplayMaxCost() {
|
||||
// Get the appropriate set of rows based on the current mode and selection state
|
||||
let rowsToConsider;
|
||||
|
||||
if (currentMode === 'view' && selectedRows.size > 0) {
|
||||
// In view mode with selections, only consider selected rows
|
||||
rowsToConsider = Array.from(allMainRows).filter(row => {
|
||||
const rowIndex = row.querySelector('.row-selector')?.dataset.rowIndex;
|
||||
return rowIndex && selectedRows.has(rowIndex) && !row.classList.contains('hidden-by-search');
|
||||
});
|
||||
} else {
|
||||
// In other modes or without selections, consider all visible rows
|
||||
rowsToConsider = getVisibleMainRows();
|
||||
}
|
||||
|
||||
// Find the maximum cost among the rows to consider
|
||||
let maxCost = 0;
|
||||
rowsToConsider.forEach(row => {
|
||||
const costBar = row.querySelector('.cost-bar');
|
||||
if (costBar) {
|
||||
const cost = parseFloat(costBar.dataset.cost || '0');
|
||||
if (cost > maxCost) maxCost = cost;
|
||||
}
|
||||
});
|
||||
|
||||
// Cap at MAX_DISPLAY_COST_CAP if any entries exceed that amount, otherwise use actual max
|
||||
return maxCost > MAX_DISPLAY_COST_CAP ? MAX_DISPLAY_COST_CAP : Math.max(1, maxCost); // Ensure at least 1 to avoid division by zero
|
||||
}
|
||||
|
||||
// Process cost bars with dynamic scale
|
||||
function updateCostBars() {
|
||||
const costBars = document.querySelectorAll('.cost-bar');
|
||||
const currentMaxDisplayCost = calculateDisplayMaxCost();
|
||||
|
||||
// Remove existing special indicators first
|
||||
document.querySelectorAll('.dark-section, .tear-line').forEach(el => el.remove());
|
||||
|
||||
costBars.forEach(bar => {
|
||||
const cost = parseFloat(bar.dataset.cost);
|
||||
|
||||
if (cost > 0) {
|
||||
// Calculate percentage based on the dynamic display max
|
||||
const percent = Math.min(cost, currentMaxDisplayCost) / currentMaxDisplayCost * 100;
|
||||
// Clamp percentage between 0 and 100
|
||||
bar.style.width = Math.max(0, Math.min(100, percent)) + '%';
|
||||
|
||||
// Mark bars that exceed the limit (only if our display max is capped at 50)
|
||||
if (currentMaxDisplayCost === MAX_DISPLAY_COST_CAP && cost > MAX_DISPLAY_COST_CAP) {
|
||||
// Create a darker section at the end with diagonal stripes
|
||||
const darkSection = document.createElement('div');
|
||||
darkSection.className = 'bar-viz dark-section';
|
||||
darkSection.style.width = '15%'; // From 85% to 100%
|
||||
darkSection.style.left = '85%';
|
||||
darkSection.style.backgroundColor = 'rgba(13, 110, 253, 0.6)'; // Darker blue
|
||||
darkSection.style.borderRight = '1px solid rgba(13, 110, 253, 0.8)';
|
||||
darkSection.style.zIndex = '1';
|
||||
// Add diagonal stripes with CSS background
|
||||
darkSection.style.backgroundImage = 'repeating-linear-gradient(45deg, rgba(255,255,255,0.3), rgba(255,255,255,0.3) 5px, transparent 5px, transparent 10px)';
|
||||
bar.parentNode.appendChild(darkSection);
|
||||
|
||||
// Add a dashed "tear line" at the transition point
|
||||
const tearLine = document.createElement('div');
|
||||
tearLine.className = 'tear-line';
|
||||
tearLine.style.position = 'absolute';
|
||||
tearLine.style.left = '85%';
|
||||
// Center the tear line vertically and make it 1.5x as tall as the bar
|
||||
tearLine.style.top = '50%';
|
||||
tearLine.style.transform = 'translateY(-50%)';
|
||||
tearLine.style.height = '54px'; // 1.5x the bar height (36px)
|
||||
tearLine.style.width = '2px';
|
||||
tearLine.style.backgroundColor = 'white';
|
||||
tearLine.style.borderLeft = '2px dashed rgba(0, 0, 0, 0.3)';
|
||||
tearLine.style.zIndex = '2'; // Above the bar
|
||||
bar.parentNode.appendChild(tearLine);
|
||||
}
|
||||
} else {
|
||||
// Set width to 0 if cost is 0 or negative
|
||||
bar.style.width = '0%';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Call this initially to set up the bars
|
||||
updateCostBars();
|
||||
|
||||
// Update cost ticks dynamically based on current max display cost
|
||||
function updateCostTicks() {
|
||||
const costCells = document.querySelectorAll('.cost-bar-cell');
|
||||
if (costCells.length === 0) return;
|
||||
|
||||
const currentMaxDisplayCost = calculateDisplayMaxCost();
|
||||
|
||||
// Remove existing ticks first
|
||||
document.querySelectorAll('.cost-tick').forEach(tick => tick.remove());
|
||||
|
||||
// Generate appropriate tick values based on current max
|
||||
let tickValues = [];
|
||||
|
||||
// Always use $10 increments, regardless of the max
|
||||
const maxTickValue = Math.ceil(currentMaxDisplayCost / 10) * 10; // Round up to nearest $10
|
||||
|
||||
for (let i = 0; i <= maxTickValue; i += 10) {
|
||||
tickValues.push(i);
|
||||
}
|
||||
|
||||
// Calculate percentage positions for each tick
|
||||
const tickPercentages = tickValues.map(tickCost => {
|
||||
return (tickCost / currentMaxDisplayCost) * 100;
|
||||
});
|
||||
|
||||
// Add tick divs to each cost cell
|
||||
costCells.forEach(cell => {
|
||||
const costBar = cell.querySelector('.cost-bar');
|
||||
// Use optional chaining and provide '0' as fallback if costBar or dataset.cost is missing
|
||||
const cost = parseFloat(costBar?.dataset?.cost || '0');
|
||||
|
||||
// Only add ticks if the cost is actually greater than 0
|
||||
if (cost > 0) {
|
||||
tickPercentages.forEach((percent, index) => {
|
||||
// Ensure percentage is within valid range
|
||||
if (percent >= 0 && percent <= 100) {
|
||||
const tick = document.createElement('div');
|
||||
tick.className = 'cost-tick';
|
||||
tick.style.left = `${percent}%`;
|
||||
cell.appendChild(tick);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Call this initially to set up the ticks
|
||||
updateCostTicks();
|
||||
|
||||
|
||||
// --- New Event Listeners ---
|
||||
|
||||
// Listener for mode toggle buttons
|
||||
modeButtons.forEach(button => {
|
||||
button.addEventListener('click', function(event) {
|
||||
const newMode = this.dataset.mode;
|
||||
if (newMode !== currentMode) {
|
||||
// Update active button style
|
||||
modeButtons.forEach(btn => {
|
||||
btn.classList.remove('active');
|
||||
// Reset specific styles potentially added by .active
|
||||
btn.style.backgroundColor = '';
|
||||
btn.style.color = '';
|
||||
});
|
||||
this.classList.add('active');
|
||||
// Apply active styles directly as inline styles might interfere
|
||||
this.style.backgroundColor = '#e7f3ff'; // Use selected row highlight blue
|
||||
this.style.color = '#495057'; // Use dark text for contrast on light blue
|
||||
|
||||
// Update table view and apply filters
|
||||
updateTableView(newMode);
|
||||
applySearchFilter(); // Re-apply search filter when mode changes
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Listener for row selector checkboxes (using event delegation on table body)
|
||||
const tableBody = document.querySelector('table tbody');
|
||||
tableBody.addEventListener('change', function(event) {
|
||||
if (event.target.classList.contains('row-selector') && currentMode === 'select') {
|
||||
const checkbox = event.target;
|
||||
const rowIndex = checkbox.dataset.rowIndex;
|
||||
const mainRow = checkbox.closest('tr');
|
||||
|
||||
if (checkbox.checked) {
|
||||
selectedRows.add(rowIndex);
|
||||
mainRow.classList.add('row-selected');
|
||||
} else {
|
||||
selectedRows.delete(rowIndex);
|
||||
mainRow.classList.remove('row-selected');
|
||||
}
|
||||
// Update select-all checkbox state
|
||||
updateSelectAllCheckboxState();
|
||||
|
||||
// Update cost bars and ticks if in view mode, as selection affects what's shown
|
||||
if (currentMode === 'view') {
|
||||
updateCostBars();
|
||||
updateCostTicks();
|
||||
}
|
||||
}
|
||||
}); // End of tableBody listener
|
||||
|
||||
// Listener for Select All checkbox
|
||||
selectAllCheckbox.addEventListener('change', function() {
|
||||
if (currentMode !== 'select') return;
|
||||
|
||||
const isChecked = selectAllCheckbox.checked;
|
||||
// Select/deselect only the rows that are currently visible
|
||||
const visibleRows = getVisibleMainRows();
|
||||
|
||||
visibleRows.forEach(row => {
|
||||
const checkbox = row.querySelector('.row-selector');
|
||||
const rowIndex = checkbox?.dataset.rowIndex;
|
||||
if (!checkbox || !rowIndex) return; // Skip if no checkbox/index found
|
||||
|
||||
// Only change state if it differs from target state
|
||||
if (checkbox.checked !== isChecked) {
|
||||
checkbox.checked = isChecked;
|
||||
row.classList.toggle('row-selected', isChecked);
|
||||
if (isChecked) {
|
||||
selectedRows.add(rowIndex);
|
||||
} else {
|
||||
selectedRows.delete(rowIndex);
|
||||
}
|
||||
}
|
||||
});
|
||||
// After bulk change, ensure the selectAll checkbox state is correct (not indeterminate)
|
||||
updateSelectAllCheckboxState();
|
||||
|
||||
// Update cost bars and ticks after selection changes
|
||||
updateCostBars();
|
||||
updateCostTicks();
|
||||
});
|
||||
|
||||
// Listener for search input
|
||||
searchInput.addEventListener('input', applySearchFilter);
|
||||
|
||||
// Add toggle functionality for details (Modified to respect modes)
|
||||
const toggleButtons = document.querySelectorAll('.toggle-details');
|
||||
toggleButtons.forEach(button => {
|
||||
button.addEventListener('click', function() {
|
||||
// Only allow toggling in 'detail' mode
|
||||
if (currentMode !== 'detail') return;
|
||||
|
||||
const targetId = this.getAttribute('data-target');
|
||||
const targetRow = document.getElementById(targetId);
|
||||
const mainRow = this.closest('tr'); // Get the main row associated with this button
|
||||
|
||||
if (targetRow && !mainRow.classList.contains('hidden-by-mode') && !mainRow.classList.contains('hidden-by-search')) {
|
||||
const isVisible = targetRow.style.display !== 'none';
|
||||
targetRow.style.display = isVisible ? 'none' : 'table-row';
|
||||
this.textContent = isVisible ? '▶' : '▼';
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Listener for clicking anywhere on a row
|
||||
tableBody.addEventListener('click', function(event) {
|
||||
const clickedRow = event.target.closest('tr');
|
||||
|
||||
// Ensure it's a main row and not a details row or header/footer
|
||||
if (!clickedRow || !clickedRow.id.startsWith('main-row-')) return;
|
||||
|
||||
// --- START conditional logic ---
|
||||
if (currentMode === 'select') {
|
||||
// --- SELECT MODE LOGIC (Existing) ---
|
||||
// Find the checkbox within this row
|
||||
const checkbox = clickedRow.querySelector('.row-selector');
|
||||
if (!checkbox) return; // No checkbox found in this row
|
||||
|
||||
// If the click was directly on the checkbox or its label (if any),
|
||||
// let the default behavior and the 'change' event listener handle it.
|
||||
// Otherwise, toggle the checkbox state programmatically.
|
||||
if (event.target !== checkbox && event.target.tagName !== 'LABEL' /* Add if you use labels */) {
|
||||
checkbox.checked = !checkbox.checked;
|
||||
// Manually trigger the change event to update state and UI
|
||||
checkbox.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
}
|
||||
// --- END SELECT MODE LOGIC ---
|
||||
|
||||
} else if (currentMode === 'view') {
|
||||
// --- VIEW MODE LOGIC (New) ---
|
||||
// Don't highlight if the click was on the details toggle button
|
||||
if (event.target.classList.contains('toggle-details')) {
|
||||
return;
|
||||
}
|
||||
// Toggle the highlight class on the clicked row
|
||||
clickedRow.classList.toggle('view-highlighted');
|
||||
// --- END VIEW MODE LOGIC ---
|
||||
}
|
||||
// --- END conditional logic ---
|
||||
});
|
||||
|
||||
|
||||
// --- Initial Setup ---
|
||||
updateTableView('view'); // Initialize view to 'view' mode
|
||||
applySearchFilter(); // Apply initial search filter (if any text is pre-filled or just to set initial state)
|
||||
|
||||
// Close button functionality
|
||||
const closeControlsBtn = document.getElementById('close-controls-btn');
|
||||
if (closeControlsBtn) {
|
||||
closeControlsBtn.addEventListener('click', function() {
|
||||
const controlsContainer = document.getElementById('controls-container');
|
||||
if (controlsContainer) {
|
||||
controlsContainer.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
@@ -4,7 +4,7 @@ You can send long, multi-line messages in the chat in a few ways:
|
||||
- Or, start with `{tag` (where "tag" is any sequence of letters/numbers) and end with `tag}`. This is useful when you need to include closing braces `}` in your message.
|
||||
- Use Meta-ENTER to start a new line without sending the message (Esc+ENTER in some environments).
|
||||
- Use `/paste` to paste text from the clipboard into the chat.
|
||||
- Use the `/editor` command to open your editor to create the next chat message. See [editor configuration docs](/docs/config/editor.html) for more info.
|
||||
- Use the `/editor` command (or press `Ctrl-X Ctrl-E` if your terminal allows) to open your editor to create the next chat message. See [editor configuration docs](/docs/config/editor.html) for more info.
|
||||
- Use multiline-mode, which swaps the function of Meta-Enter and Enter, so that Enter inserts a newline, and Meta-Enter submits your command. To enable multiline mode:
|
||||
- Use the `/multiline-mode` command to toggle it during a session.
|
||||
- Use the `--multiline` switch.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<footer class="site-footer">
|
||||
<div class="ea-ad ea-ad--sidebar" aria-label="Advertisement">
|
||||
<div data-ea-publisher="aiderchat" data-ea-type="text"></div>
|
||||
</div>
|
||||
Aider is AI pair programming in your terminal.
|
||||
Aider is on
|
||||
<a href="https://github.com/Aider-AI/aider">GitHub</a>
|
||||
and
|
||||
<a href="https://discord.gg/Tv2uQnR88V">Discord</a>.
|
||||
<a href="https://discord.gg/Y7X7bhMQFV">Discord</a>.
|
||||
</footer>
|
||||
|
||||
@@ -15,12 +15,12 @@ nav_exclude: true
|
||||
I recently wanted to draw a graph showing how LLM code editing skill has been
|
||||
changing over time as new models have been released by OpenAI, Anthropic and others.
|
||||
I have all the
|
||||
[data in a yaml file](https://github.com/Aider-AI/aider/blob/main/website/_data/edit_leaderboard.yml) that is used to render
|
||||
[data in a YAML file](https://github.com/Aider-AI/aider/blob/main/website/_data/edit_leaderboard.yml) that is used to render
|
||||
[aider's LLM leaderboards](https://aider.chat/docs/leaderboards/).
|
||||
|
||||
Below is the aider chat transcript, which shows:
|
||||
|
||||
- I launch aider with the yaml file, a file with other plots I've done recently (so GPT can crib the style) and an empty file called `over_time.py`.
|
||||
- I launch aider with the YAML file, a file with other plots I've done recently (so GPT can crib the style) and an empty file called `over_time.py`.
|
||||
- Then I ask GPT to draw the scatterplot I want.
|
||||
- I run the resulting script and share the error output with GPT so it can fix a small bug.
|
||||
- I ask it to color the points for GPT-4 and GPT-3.5 family models differently, to better see trends within those model families.
|
||||
@@ -28,7 +28,7 @@ Below is the aider chat transcript, which shows:
|
||||
- I work through a series of other small style changes, like changing fonts and the graph border.
|
||||
|
||||
In the end I have the graph, but I also have the python code in my repo.
|
||||
So I can update this graph easily whenever I add new entries to the yaml data file.
|
||||
So I can update this graph easily whenever I add new entries to the YAML data file.
|
||||
|
||||
|
||||
## Aider chat transcript
|
||||
|
||||
114
aider/website/_posts/2025-05-07-gemini-cost.md
Normal file
114
aider/website/_posts/2025-05-07-gemini-cost.md
Normal file
@@ -0,0 +1,114 @@
|
||||
---
|
||||
title: Gemini 2.5 Pro Preview 03-25 benchmark cost
|
||||
excerpt: The $6.32 benchmark cost reported for Gemini 2.5 Pro Preview 03-25 was incorrect.
|
||||
draft: false
|
||||
nav_exclude: true
|
||||
---
|
||||
{% if page.date %}
|
||||
<p class="post-date">{{ page.date | date: "%B %d, %Y" }}</p>
|
||||
{% endif %}
|
||||
|
||||
# Gemini 2.5 Pro Preview 03-25 benchmark cost
|
||||
|
||||
## Summary
|
||||
The $6.32 cost reported to run the aider polyglot benchmark on
|
||||
Gemini 2.5 Pro Preview 03-25 was incorrect.
|
||||
The true cost was higher, possibly significantly so.
|
||||
The incorrect cost has been removed from the leaderboard.
|
||||
|
||||
An investigation determined the primary cause was that the litellm
|
||||
package (used by aider for LLM API connections) was not properly including reasoning tokens in
|
||||
the token counts it reported.
|
||||
While an incorrect price-per-token entry for the model also existed in litellm's cost
|
||||
database at that time, this was found not to be a contributing factor.
|
||||
Aider's own internal, correct pricing data was utilized during the benchmark.
|
||||
|
||||
## Resolution
|
||||
|
||||
Litellm began correctly including reasoning tokens in the reported counts
|
||||
on April 21, 2025 in
|
||||
commit [a7db0df](https://github.com/BerriAI/litellm/commit/a7db0df0434bfbac2b68ebe1c343b77955becb4b).
|
||||
This change was released in litellm v1.67.1.
|
||||
Aider picked up this change April 28, 2025 when it upgraded its litellm dependency
|
||||
from v1.65.7 to v1.67.4.post1
|
||||
in commit [9351f37](https://github.com/Aider-AI/aider/commit/9351f37).
|
||||
That dependency change shipped on May 5, 2025 in aider v0.82.3.
|
||||
|
||||
Unfortunately the 03-25 version of Gemini 2.5 Pro Preview is no longer available,
|
||||
so it is not possible to re-run the benchmark to obtain an accurate cost.
|
||||
As a possibly relevant comparison, the newer 05-06 version of Gemini 2.5 Pro Preview
|
||||
completed the benchmark at a cost of about $37.
|
||||
|
||||
## Investigation detail
|
||||
|
||||
The version of litellm available at that time of the benchmark appears to have been
|
||||
excluding reasoning tokens from the token counts it reported.
|
||||
So even though aider had correct per-token pricing, it did not have the correct token counts
|
||||
used during the benchmark.
|
||||
This resulted in an underestimate of the benchmark costs.
|
||||
|
||||
The incorrect litellm database entry does not appear to have affected the aider benchmark costs.
|
||||
Aider maintains and uses its own database of costs for some models, and it contained
|
||||
the correct pricing at the time of the benchmark.
|
||||
Aider appears to have
|
||||
loaded the correct cost data from its database and made use of it during the benchmark.
|
||||
|
||||
Every aider benchmark report contains the git commit hash of the aider repository state used to
|
||||
run the benchmark.
|
||||
The
|
||||
[benchmark run in question](https://github.com/Aider-AI/aider/blob/edbfec0ce4e1fe86735c915cb425b0d8636edc32/aider/website/_data/polyglot_leaderboard.yml#L814)
|
||||
was built from
|
||||
commit [0282574](https://github.com/Aider-AI/aider/commit/0282574).
|
||||
|
||||
Additional runs of the benchmark from that build verified that the error in litellm's
|
||||
model cost database appears not to have been a factor:
|
||||
|
||||
- Aider's internal model database correctly overrides the litellm database, which contained an incorrect token cost at the time.
|
||||
- The correct pricing is loaded from aider's internal model database and produces similar (incorrect) costs as the original run.
|
||||
- Updating aider's internal model database with an absurdly high token cost resulted in an appropriately high benchmark cost report, demonstrating that the internal database costs were in effect.
|
||||
|
||||
This specific build of aider was then updated with various versions of litellm using `git biset`
|
||||
to identify the first litellm commit where reasoning tokens counts were correctly reported.
|
||||
|
||||
|
||||
|
||||
## Timeline
|
||||
|
||||
Below is the full timeline of git commits related to this issue in the aider and litellm repositories.
|
||||
Each entry has a UTC timestamp, followed by the original literal timestamp obtained from the
|
||||
relevant source.
|
||||
|
||||
- 2025-04-04 19:54:45 UTC (Sat Apr 5 08:54:45 2025 +1300)
|
||||
- Correct value `"output_cost_per_token": 0.000010` for `gemini/gemini-2.5-pro-preview-03-25` added to `aider/resources/model-metadata.json`
|
||||
- Commit [eda796d](https://github.com/Aider-AI/aider/commit/eda796d) in aider.
|
||||
|
||||
- 2025-04-05 16:20:01 UTC (Sun Apr 6 00:20:01 2025 +0800)
|
||||
- First litellm commit of `gemini/gemini-2.5-pro-preview-03-25` metadata, with incorrect price `"output_cost_per_token": 0.0000010`
|
||||
- Commit [cd0a1e6](https://github.com/BerriAI/litellm/commit/cd0a1e6) in litellm.
|
||||
|
||||
- 2025-04-10 01:48:43 UTC (Wed Apr 9 18:48:43 2025 -0700)
|
||||
- litellm commit updates `gemini/gemini-2.5-pro-preview-03-25` metadata, but not price
|
||||
- Commit [ac4f32f](https://github.com/BerriAI/litellm/commit/ac4f32f) in litellm.
|
||||
|
||||
- 2025-04-12 04:55:50 UTC (2025-04-12-04-55-50 UTC)
|
||||
- Benchmark performed.
|
||||
- Aider repo hash [0282574 recorded in benchmark results](https://github.com/Aider-AI/aider/blob/7fbeafa1cfd4ad83f7499417837cdfa6b16fe7a1/aider/website/_data/polyglot_leaderboard.yml#L814), without a "dirty" annotation, indicating that the benchmark was run on a clean checkout of the aider repo at commit [0282574](https://github.com/Aider-AI/aider/commit/0282574).
|
||||
- Correct value `"output_cost_per_token": 0.000010` is in `aider/resources/model-metadata.json` at this commit [0282574](https://github.com/Aider-AI/aider/blob/0282574/aider/resources/model-metadata.json#L357).
|
||||
|
||||
- 2025-04-12 15:06:39 UTC (Apr 12 08:06:39 2025 -0700)
|
||||
- Benchmark results added to aider repo.
|
||||
- Commit [7fbeafa](https://github.com/Aider-AI/aider/commit/7fbeafa) in aider.
|
||||
|
||||
- 2025-04-12 15:20:04 UTC (Sat Apr 12 19:20:04 2025 +0400)
|
||||
- litellm commit fixes `gemini/gemini-2.5-pro-preview-03-25` price metadata to `"output_cost_per_token": 0.00001`
|
||||
- Commit [93037ea](https://github.com/BerriAI/litellm/commit/93037ea) in litellm.
|
||||
|
||||
- 2025-04-22 05:48:00 UTC (Mon Apr 21 22:48:00 2025 -0700)
|
||||
- Litellm started including reasoning tokens in token count reporting.
|
||||
- Commit [a7db0df](https://github.com/BerriAI/litellm/commit/a7db0df0434bfbac2b68ebe1c343b77955becb4b) in litellm.
|
||||
- This fix was released in litellm v1.67.1.
|
||||
|
||||
- 2025-04-28 14:53:20 UTC (Mon Apr 28 07:53:20 2025 -0700)
|
||||
- Aider upgraded its litellm dependency from v1.65.7 to v1.67.4.post1, which included the reasoning token count fix.
|
||||
- Commit [9351f37](https://github.com/Aider-AI/aider/commit/9351f37) in aider.
|
||||
- This dependency change shipped on May 5, 2025 in aider v0.82.3.
|
||||
365
aider/website/_posts/2025-05-08-qwen3.md
Normal file
365
aider/website/_posts/2025-05-08-qwen3.md
Normal file
@@ -0,0 +1,365 @@
|
||||
---
|
||||
layout: post
|
||||
title: Qwen3 benchmark results
|
||||
excerpt: "Benchmark results for Qwen3 models using the Aider polyglot coding benchmark."
|
||||
highlight_image: /assets/2025-05-08-qwen3.jpg
|
||||
date: 2025-05-08
|
||||
---
|
||||
|
||||
# Qwen3 results on the aider polyglot benchmark
|
||||
|
||||
As [previously discussed when Qwen2.5 was released](/2024/11/21/quantization.html),
|
||||
details matter when working with open source models for AI coding.
|
||||
Proprietary models are served by their creators or trusted providers with stable inference settings.
|
||||
Open source models are wonderful because anyone can serve them,
|
||||
but API providers can use very different inference settings, quantizations, etc.
|
||||
|
||||
Below are collection of aider polyglot benchmark results for the new Qwen3 models.
|
||||
Results are presented using both "diff" and "whole"
|
||||
[edit formats](https://aider.chat/docs/more/edit-formats.html),
|
||||
with various models settings, against various API providers.
|
||||
|
||||
See details on the
|
||||
[model settings](https://aider.chat/docs/config/adv-model-settings.html#model-settings)
|
||||
used after the results table.
|
||||
|
||||
{: .note }
|
||||
This article is being updated as new results become available.
|
||||
Also, some results were submitted by aider users and have not been verified.
|
||||
|
||||
<h2 id="leaderboard-title">Qwen3 results on the aider polyglot benchmark</h2>
|
||||
|
||||
<div id="controls-container" style="display: flex; align-items: center; width: 100%; max-width: 800px; margin: 10px auto; gap: 10px; box-sizing: border-box; padding: 0 5px; position: relative;">
|
||||
<input type="text" id="editSearchInput" placeholder="Search..." style="flex-grow: 1; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
|
||||
<div id="view-mode-toggle" style="display: inline-flex; border: 1px solid #ccc; border-radius: 4px;">
|
||||
<button id="mode-view-btn" class="mode-button active" data-mode="view" style="padding: 8px 8px; border: none; border-radius: 3px 0 0 3px; cursor: pointer; font-size: 14px; line-height: 1.5; min-width: 50px;">View</button>
|
||||
<button id="mode-select-btn" class="mode-button" data-mode="select" style="padding: 8px 8px; border: none; background-color: #f8f9fa; border-radius: 0; cursor: pointer; border-left: 1px solid #ccc; font-size: 14px; line-height: 1.5; min-width: 50px;">Select</button>
|
||||
<button id="mode-detail-btn" class="mode-button" data-mode="detail" style="padding: 8px 8px; border: none; background-color: #f8f9fa; border-radius: 0 3px 3px 0; cursor: pointer; border-left: 1px solid #ccc; font-size: 14px; line-height: 1.5; min-width: 50px;">Detail</button>
|
||||
</div>
|
||||
<button id="close-controls-btn" style="width: 18px; height: 18px; padding: 0; border: 1px solid #ddd; border-radius: 50%; background-color: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; margin-left: 4px; color: #999;">×</button>
|
||||
</div>
|
||||
|
||||
<table style="width: 100%; max-width: 800px; margin: auto; border-collapse: collapse; box-shadow: 0 2px 4px rgba(0,0,0,0.1); font-size: 14px;">
|
||||
<thead style="background-color: #f2f2f2;">
|
||||
<tr>
|
||||
<th style="padding: 8px; width: 40px; text-align: center; vertical-align: middle;">
|
||||
<input type="checkbox" id="select-all-checkbox" style="display: none; cursor: pointer; vertical-align: middle;">
|
||||
</th> <!-- Header checkbox added here -->
|
||||
<th style="padding: 8px; text-align: left;">Model</th>
|
||||
<th style="padding: 8px; text-align: center; width: 25%">Percent correct</th>
|
||||
<th style="padding: 8px; text-align: center; width: 25%">Cost</th>
|
||||
<th style="padding: 8px; text-align: left;" class="col-command">Command</th>
|
||||
<th style="padding: 8px; text-align: center; width: 10%" class="col-conform">Correct edit format</th>
|
||||
<th style="padding: 8px; text-align: left; width: 10%" class="col-edit-format">Edit Format</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% assign max_cost = 0 %}
|
||||
{% for row in site.data.qwen3_leaderboard %}
|
||||
{% if row.total_cost > max_cost %}
|
||||
{% assign max_cost = row.total_cost %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if max_cost == 0 %}{% assign max_cost = 1 %}{% endif %}
|
||||
{% assign edit_sorted = site.data.qwen3_leaderboard | sort: 'pass_rate_2' | reverse %}
|
||||
{% for row in edit_sorted %} {% comment %} Add loop index for unique IDs {% endcomment %}
|
||||
{% assign row_index = forloop.index0 %}
|
||||
<tr id="main-row-{{ row_index }}">
|
||||
<td style="padding: 8px; text-align: center; vertical-align: middle;">
|
||||
<button class="toggle-details" data-target="details-{{ row_index }}" style="background: none; border: none; cursor: pointer; font-size: 16px; padding: 0; vertical-align: middle;">▶</button>
|
||||
<input type="checkbox" class="row-selector" data-row-index="{{ row_index }}" style="display: none; cursor: pointer; vertical-align: middle;">
|
||||
</td>
|
||||
<td style="padding: 8px;"><span>{{ row.model }}</span></td>
|
||||
<td class="bar-cell">
|
||||
<div class="bar-viz" style="width: {{ row.pass_rate_2 }}%; background-color: rgba(40, 167, 69, 0.3); border-right: 1px solid rgba(40, 167, 69, 0.5);"></div>
|
||||
<span>{{ row.pass_rate_2 }}%</span>
|
||||
</td>
|
||||
<td class="bar-cell cost-bar-cell">
|
||||
{% if row.total_cost > 0 %}
|
||||
<div class="bar-viz cost-bar" data-cost="{{ row.total_cost }}" data-max-cost="{{ max_cost }}" style="width: 0%; background-color: rgba(13, 110, 253, 0.3); border-right: 1px solid rgba(13, 110, 253, 0.5);"></div>
|
||||
{% endif %}
|
||||
{% assign rounded_cost = row.total_cost | times: 1.0 | round: 2 %}
|
||||
<span>{% if row.total_cost == 0 or rounded_cost == 0.00 %}{% else %}${{ rounded_cost }}{% endif %}</span>
|
||||
</td>
|
||||
<td style="padding: 8px;" class="col-command"><span><code>{{ row.command }}</code></span></td>
|
||||
<td style="padding: 8px; text-align: center;" class="col-conform"><span>{{ row.percent_cases_well_formed }}%</span></td>
|
||||
<td style="padding: 8px;" class="col-edit-format"><span>{{ row.edit_format }}</span></td>
|
||||
</tr>
|
||||
<tr class="details-row" id="details-{{ row_index }}" style="display: none; background-color: #f9f9f9;">
|
||||
<td colspan="7" style="padding: 15px; border-bottom: 1px solid #ddd;">
|
||||
<ul style="margin: 0; padding-left: 20px; list-style: none; border-bottom: 1px solid #ddd;">
|
||||
{% for pair in row %}
|
||||
{% if pair[1] != "" and pair[1] != nil %}
|
||||
<li><strong>
|
||||
{% if pair[0] == 'percent_cases_well_formed' %}
|
||||
Percent cases well formed
|
||||
{% else %}
|
||||
{{ pair[0] | replace: '_', ' ' | capitalize }}
|
||||
{% endif %}
|
||||
:</strong>
|
||||
{% if pair[0] == 'command' %}<code>{{ pair[1] }}</code>{% else %}{{ pair[1] }}{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<style>
|
||||
#leaderboard-title {
|
||||
margin-bottom: 20px; /* Add space below the title */
|
||||
}
|
||||
tr.selected {
|
||||
color: #0056b3;
|
||||
}
|
||||
table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
thead {
|
||||
border-top: 1px solid #ddd; /* Add top border to header */
|
||||
}
|
||||
td, th {
|
||||
border: none; /* Remove internal cell borders */
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
vertical-align: middle; /* Ensure consistent vertical alignment */
|
||||
}
|
||||
tbody tr {
|
||||
height: 50px; /* Set a minimum height for all data rows */
|
||||
}
|
||||
td.col-command { /* Command column */
|
||||
font-size: 12px; /* Keep font size adjustment for command column if desired, or remove */
|
||||
}
|
||||
|
||||
/* Hide new columns first on smaller screens */
|
||||
@media screen and (max-width: 991px) {
|
||||
th.col-conform, td.col-conform,
|
||||
th.col-edit-format, td.col-edit-format {
|
||||
display: none;
|
||||
}
|
||||
/* Increase width of Percent correct and Cost columns when others are hidden */
|
||||
th:nth-child(3), td:nth-child(3), /* Percent correct */
|
||||
th:nth-child(4), td:nth-child(4) { /* Cost */
|
||||
width: 33% !important; /* Override inline style */
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide command column on even smaller screens */
|
||||
@media screen and (max-width: 767px) {
|
||||
th.col-command, td.col-command { /* Command column */
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* --- Control Styles --- */
|
||||
#controls-container {
|
||||
margin-bottom: 20px; /* Add some space below controls */
|
||||
}
|
||||
|
||||
#editSearchInput, #view-mode-select {
|
||||
padding: 8px 12px; /* Consistent padding */
|
||||
border: 1px solid #ccc; /* Slightly softer border */
|
||||
border-radius: 4px;
|
||||
font-size: 14px; /* Match table font size */
|
||||
height: 38px; /* Match height */
|
||||
box-sizing: border-box; /* Include padding/border in height */
|
||||
}
|
||||
|
||||
|
||||
.bar-cell {
|
||||
position: relative; /* Positioning context for the bar */
|
||||
padding: 8px;
|
||||
/* text-align: center; Removed */
|
||||
overflow: hidden; /* Prevent bar from overflowing cell boundaries if needed */
|
||||
}
|
||||
.cost-bar-cell {
|
||||
background-image: none; /* Remove default gradient for cost cells */
|
||||
}
|
||||
.percent-tick, .cost-tick {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(10px);
|
||||
height: 8px; /* Short tick */
|
||||
width: 1px;
|
||||
background-color: rgba(170, 170, 170, 0.5);
|
||||
z-index: 2; /* Above the bar but below the text */
|
||||
}
|
||||
.bar-viz {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%; /* Position at the middle of the cell */
|
||||
transform: translateY(-50%); /* Center the bar vertically */
|
||||
z-index: 1; /* Above background, below ticks and text */
|
||||
height: 36px;
|
||||
border-radius: 0 2px 2px 0; /* Slightly rounded end corners */
|
||||
/* Width and colors are set inline via style attribute */
|
||||
}
|
||||
/* Add a tooltip class for showing cost information on hover */
|
||||
.cost-bar-cell:hover .bar-viz[style*="background-image"] {
|
||||
animation: stripe-animation 2s linear infinite;
|
||||
}
|
||||
@keyframes stripe-animation {
|
||||
0% { background-position: 0 0; }
|
||||
100% { background-position: 20px 0; }
|
||||
}
|
||||
.bar-cell span {
|
||||
position: absolute; /* Position relative to the cell */
|
||||
left: 5px; /* Position slightly inside the left edge */
|
||||
top: 50%; /* Center vertically */
|
||||
transform: translateY(-50%); /* Adjust vertical centering */
|
||||
z-index: 3; /* Ensure text is above everything else */
|
||||
background-color: rgba(255, 255, 255, 0.7); /* Semi-transparent white background */
|
||||
padding: 0 4px; /* Add padding around the text */
|
||||
border-radius: 3px; /* Rounded corners for the text background */
|
||||
font-size: 14px; /* Adjust font size for the numbers */
|
||||
}
|
||||
.toggle-details {
|
||||
color: #888; /* Make toggle symbol more subtle */
|
||||
transition: color 0.2s; /* Smooth transition on hover */
|
||||
}
|
||||
|
||||
|
||||
/* Style for selected rows */
|
||||
tr.row-selected > td {
|
||||
background-color: #e7f3ff; /* Example light blue highlight */
|
||||
}
|
||||
|
||||
/* Ensure checkbox is vertically aligned if needed */
|
||||
.row-selector {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Hide rows not matching the filter */
|
||||
tr.hidden-by-mode {
|
||||
display: none !important; /* Use important to override other display styles if necessary */
|
||||
}
|
||||
tr.hidden-by-search {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* --- Mode Toggle Button Styles --- */
|
||||
#view-mode-toggle {
|
||||
height: 38px; /* Match input height */
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0; /* Prevent toggle from shrinking on small screens */
|
||||
}
|
||||
.mode-button {
|
||||
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
|
||||
white-space: nowrap; /* Prevent text wrapping */
|
||||
}
|
||||
.mode-button:not(.active) {
|
||||
background-color: #f8f9fa; /* Light grey background */
|
||||
color: #495057; /* Dark grey text */
|
||||
}
|
||||
.mode-button:not(.active):hover {
|
||||
background-color: #e2e6ea; /* Slightly darker grey on hover */
|
||||
}
|
||||
|
||||
/* Style for highlighted rows in view mode */
|
||||
tr.view-highlighted > td {
|
||||
background-color: #fffef5; /* Very light yellow/cream */
|
||||
/* Border moved to specific cell below */
|
||||
}
|
||||
/* Apply border and adjust padding ONLY for the first *visible* cell (Model name) in view mode */
|
||||
tr.view-highlighted > td:nth-child(2) {
|
||||
border-left: 4px solid #ffc107; /* Warning yellow border */
|
||||
/* Original padding is 8px. Subtract border width. */
|
||||
padding-left: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
const LEADERBOARD_CUSTOM_TITLE = "Qwen3 results on the aider polyglot benchmark";
|
||||
{% include leaderboard_table.js %}
|
||||
</script>
|
||||
|
||||
|
||||
## No think, via official Alibaba API
|
||||
|
||||
These results were obtained running against `https://dashscope.aliyuncs.com/compatible-mode/v1`
|
||||
with no thinking.
|
||||
|
||||
```bash
|
||||
export OPENAI_API_BASE=https://dashscope.aliyuncs.com/compatible-mode/v1
|
||||
export OPENAI_API_KEY=<key>
|
||||
```
|
||||
|
||||
```yaml
|
||||
- name: openai/qwen3-235b-a22b
|
||||
use_temperature: 0.7
|
||||
streaming: false
|
||||
extra_params:
|
||||
stream: false
|
||||
max_tokens: 16384
|
||||
top_p: 0.8
|
||||
top_k: 20
|
||||
temperature: 0.7
|
||||
enable_thinking: false
|
||||
extra_body:
|
||||
enable_thinking: false
|
||||
```
|
||||
|
||||
## OpenRouter only TogetherAI, recommended /no_think settings
|
||||
|
||||
These results were obtained with the
|
||||
[recommended](https://huggingface.co/Qwen/Qwen3-235B-A22B#best-practices)
|
||||
non-thinking model settings in `.aider.model.settings.yml`:
|
||||
|
||||
```yaml
|
||||
- name: openrouter/qwen/qwen3-235b-a22b
|
||||
system_prompt_prefix: "/no_think"
|
||||
use_temperature: 0.7
|
||||
extra_params:
|
||||
max_tokens: 24000
|
||||
top_p: 0.8
|
||||
top_k: 20
|
||||
min_p: 0.0
|
||||
temperature: 0.7
|
||||
extra_body:
|
||||
provider:
|
||||
order: ["Together"]
|
||||
```
|
||||
|
||||
And then running aider:
|
||||
|
||||
```bash
|
||||
aider --model openrouter/qwen/qwen3-235b-a22b
|
||||
```
|
||||
|
||||
|
||||
## OpenRouter, all providers, default settings (thinking)
|
||||
|
||||
These results were obtained by simply running aider as shown below, without any model specific settings.
|
||||
This should have enabled thinking, assuming upstream API providers honor that convention for Qwen3.
|
||||
|
||||
```bash
|
||||
aider --model openrouter/qwen/qwen3-xxx
|
||||
```
|
||||
|
||||
## VLLM, bfloat16, recommended /no_think
|
||||
|
||||
These [benchmarks results were obtained by GitHub user AlongWY](https://github.com/Aider-AI/aider/pull/3908)
|
||||
with the
|
||||
[recommended](https://huggingface.co/Qwen/Qwen3-235B-A22B#best-practices)
|
||||
non-thinking model settings in `.aider.model.settings.yml`:
|
||||
|
||||
```yaml
|
||||
- name: openai/<model-name>
|
||||
system_prompt_prefix: "/no_think"
|
||||
use_temperature: 0.7
|
||||
extra_params:
|
||||
max_tokens: 24000
|
||||
top_p: 0.8
|
||||
top_k: 20
|
||||
min_p: 0.0
|
||||
temperature: 0.7
|
||||
```
|
||||
|
||||
And then running aider:
|
||||
|
||||
```bash
|
||||
aider --model openai/<model-name> --openai-api-base <url>
|
||||
```
|
||||
BIN
aider/website/assets/2025-05-08-qwen3.jpg
Normal file
BIN
aider/website/assets/2025-05-08-qwen3.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 221 KiB |
BIN
aider/website/assets/azure-deployment.png
Normal file
BIN
aider/website/assets/azure-deployment.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 260 KiB |
@@ -446,7 +446,7 @@ code, pre, .code-block {
|
||||
}
|
||||
|
||||
.testimonial-text::before {
|
||||
content: "\201C"; /* Opening fancy quote */
|
||||
content: "\201C\00A0"; /* Opening fancy quote */
|
||||
color: var(--primary);
|
||||
margin-right: 4px;
|
||||
vertical-align: -0.3em;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
# Place in your home dir, or at the root of your git repo.
|
||||
##########################################################
|
||||
|
||||
# Note: You can only put OpenAI and Anthropic API keys in the yaml
|
||||
# Note: You can only put OpenAI and Anthropic API keys in the YAML
|
||||
# config file. Keys for all APIs can be stored in a .env file
|
||||
# https://aider.chat/docs/config/dotenv.html
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
## Set the reasoning_effort API parameter (default: not set)
|
||||
#reasoning-effort: xxx
|
||||
|
||||
## Set the thinking token budget for models that support it (default: not set)
|
||||
## Set the thinking token budget for models that support it. Use 0 to disable. (default: not set)
|
||||
#thinking-tokens: xxx
|
||||
|
||||
## Verify the SSL cert when connecting to models (default: True)
|
||||
@@ -171,19 +171,19 @@
|
||||
#stream: true
|
||||
|
||||
## Set the color for user input (default: #00cc00)
|
||||
#user-input-color: #00cc00
|
||||
#user-input-color: "#00cc00"
|
||||
|
||||
## Set the color for tool output (default: None)
|
||||
#tool-output-color: "xxx"
|
||||
|
||||
## Set the color for tool error messages (default: #FF2222)
|
||||
#tool-error-color: #FF2222
|
||||
#tool-error-color: "#FF2222"
|
||||
|
||||
## Set the color for tool warning messages (default: #FFA500)
|
||||
#tool-warning-color: #FFA500
|
||||
#tool-warning-color: "#FFA500"
|
||||
|
||||
## Set the color for assistant output (default: #0088ff)
|
||||
#assistant-output-color: #0088ff
|
||||
#assistant-output-color: "#0088ff"
|
||||
|
||||
## Set the color for the completion menu (default: terminal's default text color)
|
||||
#completion-menu-color: "xxx"
|
||||
@@ -212,6 +212,9 @@
|
||||
## Enable/disable adding .aider* to .gitignore (default: True)
|
||||
#gitignore: true
|
||||
|
||||
## Enable/disable the addition of files listed in .gitignore to Aider's editing scope.
|
||||
#add-gitignore-files: false
|
||||
|
||||
## Specify the aider ignore file (default: .aiderignore in git root)
|
||||
#aiderignore: .aiderignore
|
||||
|
||||
@@ -224,11 +227,11 @@
|
||||
## Enable/disable commits when repo is found dirty (default: True)
|
||||
#dirty-commits: true
|
||||
|
||||
## Attribute aider code changes in the git author name (default: True)
|
||||
#attribute-author: true
|
||||
## Attribute aider code changes in the git author name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence.
|
||||
#attribute-author: xxx
|
||||
|
||||
## Attribute aider commits in the git committer name (default: True)
|
||||
#attribute-committer: true
|
||||
## Attribute aider commits in the git committer name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence for aider edits.
|
||||
#attribute-committer: xxx
|
||||
|
||||
## Prefix commit messages with 'aider: ' if aider authored the changes (default: False)
|
||||
#attribute-commit-message-author: false
|
||||
@@ -236,6 +239,9 @@
|
||||
## Prefix all commit messages with 'aider: ' (default: False)
|
||||
#attribute-commit-message-committer: false
|
||||
|
||||
## Attribute aider edits using the Co-authored-by trailer in the commit message (default: True). If True, this takes precedence over default --attribute-author and --attribute-committer behavior unless they are explicitly set to True.
|
||||
#attribute-co-authored-by: true
|
||||
|
||||
## Enable/disable git pre-commit hooks with --no-verify (default: False)
|
||||
#git-commit-verify: false
|
||||
|
||||
@@ -292,6 +298,12 @@
|
||||
## Permanently disable analytics
|
||||
#analytics-disable: false
|
||||
|
||||
## Send analytics to custom PostHog instance
|
||||
#analytics-posthog-host: xxx
|
||||
|
||||
## Send analytics to custom PostHog project
|
||||
#analytics-posthog-project-api-key: xxx
|
||||
|
||||
############
|
||||
# Upgrading:
|
||||
|
||||
@@ -358,6 +370,9 @@
|
||||
#################
|
||||
# Other settings:
|
||||
|
||||
## Never prompt for or attempt to install Playwright for web scraping (default: False).
|
||||
#disable-playwright: false
|
||||
|
||||
## specify a file to edit (can be used multiple times)
|
||||
#file: xxx
|
||||
## Specify multiple values like this:
|
||||
@@ -380,6 +395,9 @@
|
||||
## Specify the language to use in the chat (default: None, uses system settings)
|
||||
#chat-language: xxx
|
||||
|
||||
## Specify the language to use in the commit message (default: None, user language)
|
||||
#commit-language: xxx
|
||||
|
||||
## Always say yes to every confirmation
|
||||
#yes-always: false
|
||||
|
||||
@@ -422,6 +440,9 @@
|
||||
## Specify which editor to use for the /editor command
|
||||
#editor: xxx
|
||||
|
||||
## Print shell completion script for the specified SHELL and exit. Supported shells: bash, tcsh, zsh. Example: aider --shell-completions bash
|
||||
#shell-completions: xxx
|
||||
|
||||
############################
|
||||
# Deprecated model settings:
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
## Set the reasoning_effort API parameter (default: not set)
|
||||
#AIDER_REASONING_EFFORT=
|
||||
|
||||
## Set the thinking token budget for models that support it (default: not set)
|
||||
## Set the thinking token budget for models that support it. Use 0 to disable. (default: not set)
|
||||
#AIDER_THINKING_TOKENS=
|
||||
|
||||
## Verify the SSL cert when connecting to models (default: True)
|
||||
@@ -201,6 +201,9 @@
|
||||
## Enable/disable adding .aider* to .gitignore (default: True)
|
||||
#AIDER_GITIGNORE=true
|
||||
|
||||
## Enable/disable the addition of files listed in .gitignore to Aider's editing scope.
|
||||
#AIDER_ADD_GITIGNORE_FILES=false
|
||||
|
||||
## Specify the aider ignore file (default: .aiderignore in git root)
|
||||
#AIDER_AIDERIGNORE=.aiderignore
|
||||
|
||||
@@ -213,11 +216,11 @@
|
||||
## Enable/disable commits when repo is found dirty (default: True)
|
||||
#AIDER_DIRTY_COMMITS=true
|
||||
|
||||
## Attribute aider code changes in the git author name (default: True)
|
||||
#AIDER_ATTRIBUTE_AUTHOR=true
|
||||
## Attribute aider code changes in the git author name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence.
|
||||
#AIDER_ATTRIBUTE_AUTHOR=
|
||||
|
||||
## Attribute aider commits in the git committer name (default: True)
|
||||
#AIDER_ATTRIBUTE_COMMITTER=true
|
||||
## Attribute aider commits in the git committer name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence for aider edits.
|
||||
#AIDER_ATTRIBUTE_COMMITTER=
|
||||
|
||||
## Prefix commit messages with 'aider: ' if aider authored the changes (default: False)
|
||||
#AIDER_ATTRIBUTE_COMMIT_MESSAGE_AUTHOR=false
|
||||
@@ -225,6 +228,9 @@
|
||||
## Prefix all commit messages with 'aider: ' (default: False)
|
||||
#AIDER_ATTRIBUTE_COMMIT_MESSAGE_COMMITTER=false
|
||||
|
||||
## Attribute aider edits using the Co-authored-by trailer in the commit message (default: True). If True, this takes precedence over default --attribute-author and --attribute-committer behavior unless they are explicitly set to True.
|
||||
#AIDER_ATTRIBUTE_CO_AUTHORED_BY=true
|
||||
|
||||
## Enable/disable git pre-commit hooks with --no-verify (default: False)
|
||||
#AIDER_GIT_COMMIT_VERIFY=false
|
||||
|
||||
@@ -276,6 +282,12 @@
|
||||
## Permanently disable analytics
|
||||
#AIDER_ANALYTICS_DISABLE=false
|
||||
|
||||
## Send analytics to custom PostHog instance
|
||||
#AIDER_ANALYTICS_POSTHOG_HOST=
|
||||
|
||||
## Send analytics to custom PostHog project
|
||||
#AIDER_ANALYTICS_POSTHOG_PROJECT_API_KEY=
|
||||
|
||||
############
|
||||
# Upgrading:
|
||||
|
||||
@@ -339,6 +351,9 @@
|
||||
#################
|
||||
# Other settings:
|
||||
|
||||
## Never prompt for or attempt to install Playwright for web scraping (default: False).
|
||||
#AIDER_DISABLE_PLAYWRIGHT=false
|
||||
|
||||
## specify a file to edit (can be used multiple times)
|
||||
#AIDER_FILE=
|
||||
|
||||
@@ -351,6 +366,9 @@
|
||||
## Specify the language to use in the chat (default: None, uses system settings)
|
||||
#AIDER_CHAT_LANGUAGE=
|
||||
|
||||
## Specify the language to use in the commit message (default: None, user language)
|
||||
#AIDER_COMMIT_LANGUAGE=
|
||||
|
||||
## Always say yes to every confirmation
|
||||
#AIDER_YES_ALWAYS=
|
||||
|
||||
@@ -390,6 +408,9 @@
|
||||
## Specify which editor to use for the /editor command
|
||||
#AIDER_EDITOR=
|
||||
|
||||
## Print shell completion script for the specified SHELL and exit. Supported shells: bash, tcsh, zsh. Example: aider --shell-completions bash
|
||||
#AIDER_SHELL_COMPLETIONS=
|
||||
|
||||
############################
|
||||
# Deprecated model settings:
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
---
|
||||
parent: Configuration
|
||||
nav_order: 15
|
||||
description: How to configure aider with a yaml config file.
|
||||
description: How to configure aider with a YAML config file.
|
||||
---
|
||||
|
||||
# YAML config file
|
||||
@@ -58,7 +58,7 @@ cog.outl("```")
|
||||
# Place in your home dir, or at the root of your git repo.
|
||||
##########################################################
|
||||
|
||||
# Note: You can only put OpenAI and Anthropic API keys in the yaml
|
||||
# Note: You can only put OpenAI and Anthropic API keys in the YAML
|
||||
# config file. Keys for all APIs can be stored in a .env file
|
||||
# https://aider.chat/docs/config/dotenv.html
|
||||
|
||||
@@ -137,7 +137,7 @@ cog.outl("```")
|
||||
## Set the reasoning_effort API parameter (default: not set)
|
||||
#reasoning-effort: xxx
|
||||
|
||||
## Set the thinking token budget for models that support it (default: not set)
|
||||
## Set the thinking token budget for models that support it. Use 0 to disable. (default: not set)
|
||||
#thinking-tokens: xxx
|
||||
|
||||
## Verify the SSL cert when connecting to models (default: True)
|
||||
@@ -225,19 +225,19 @@ cog.outl("```")
|
||||
#stream: true
|
||||
|
||||
## Set the color for user input (default: #00cc00)
|
||||
#user-input-color: #00cc00
|
||||
#user-input-color: "#00cc00"
|
||||
|
||||
## Set the color for tool output (default: None)
|
||||
#tool-output-color: "xxx"
|
||||
|
||||
## Set the color for tool error messages (default: #FF2222)
|
||||
#tool-error-color: #FF2222
|
||||
#tool-error-color: "#FF2222"
|
||||
|
||||
## Set the color for tool warning messages (default: #FFA500)
|
||||
#tool-warning-color: #FFA500
|
||||
#tool-warning-color: "#FFA500"
|
||||
|
||||
## Set the color for assistant output (default: #0088ff)
|
||||
#assistant-output-color: #0088ff
|
||||
#assistant-output-color: "#0088ff"
|
||||
|
||||
## Set the color for the completion menu (default: terminal's default text color)
|
||||
#completion-menu-color: "xxx"
|
||||
@@ -266,6 +266,9 @@ cog.outl("```")
|
||||
## Enable/disable adding .aider* to .gitignore (default: True)
|
||||
#gitignore: true
|
||||
|
||||
## Enable/disable the addition of files listed in .gitignore to Aider's editing scope.
|
||||
#add-gitignore-files: false
|
||||
|
||||
## Specify the aider ignore file (default: .aiderignore in git root)
|
||||
#aiderignore: .aiderignore
|
||||
|
||||
@@ -278,11 +281,11 @@ cog.outl("```")
|
||||
## Enable/disable commits when repo is found dirty (default: True)
|
||||
#dirty-commits: true
|
||||
|
||||
## Attribute aider code changes in the git author name (default: True)
|
||||
#attribute-author: true
|
||||
## Attribute aider code changes in the git author name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence.
|
||||
#attribute-author: xxx
|
||||
|
||||
## Attribute aider commits in the git committer name (default: True)
|
||||
#attribute-committer: true
|
||||
## Attribute aider commits in the git committer name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence for aider edits.
|
||||
#attribute-committer: xxx
|
||||
|
||||
## Prefix commit messages with 'aider: ' if aider authored the changes (default: False)
|
||||
#attribute-commit-message-author: false
|
||||
@@ -290,6 +293,9 @@ cog.outl("```")
|
||||
## Prefix all commit messages with 'aider: ' (default: False)
|
||||
#attribute-commit-message-committer: false
|
||||
|
||||
## Attribute aider edits using the Co-authored-by trailer in the commit message (default: True). If True, this takes precedence over default --attribute-author and --attribute-committer behavior unless they are explicitly set to True.
|
||||
#attribute-co-authored-by: true
|
||||
|
||||
## Enable/disable git pre-commit hooks with --no-verify (default: False)
|
||||
#git-commit-verify: false
|
||||
|
||||
@@ -346,6 +352,12 @@ cog.outl("```")
|
||||
## Permanently disable analytics
|
||||
#analytics-disable: false
|
||||
|
||||
## Send analytics to custom PostHog instance
|
||||
#analytics-posthog-host: xxx
|
||||
|
||||
## Send analytics to custom PostHog project
|
||||
#analytics-posthog-project-api-key: xxx
|
||||
|
||||
############
|
||||
# Upgrading:
|
||||
|
||||
@@ -412,6 +424,9 @@ cog.outl("```")
|
||||
#################
|
||||
# Other settings:
|
||||
|
||||
## Never prompt for or attempt to install Playwright for web scraping (default: False).
|
||||
#disable-playwright: false
|
||||
|
||||
## specify a file to edit (can be used multiple times)
|
||||
#file: xxx
|
||||
## Specify multiple values like this:
|
||||
@@ -434,6 +449,9 @@ cog.outl("```")
|
||||
## Specify the language to use in the chat (default: None, uses system settings)
|
||||
#chat-language: xxx
|
||||
|
||||
## Specify the language to use in the commit message (default: None, user language)
|
||||
#commit-language: xxx
|
||||
|
||||
## Always say yes to every confirmation
|
||||
#yes-always: false
|
||||
|
||||
@@ -476,6 +494,9 @@ cog.outl("```")
|
||||
## Specify which editor to use for the /editor command
|
||||
#editor: xxx
|
||||
|
||||
## Print shell completion script for the specified SHELL and exit. Supported shells: bash, tcsh, zsh. Example: aider --shell-completions bash
|
||||
#shell-completions: xxx
|
||||
|
||||
############################
|
||||
# Deprecated model settings:
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@ OPENAI_API_KEY=<key>
|
||||
ANTHROPIC_API_KEY=<key>
|
||||
```
|
||||
|
||||
#### Yaml config file
|
||||
#### YAML config file
|
||||
You can also set those API keys via special entries in the
|
||||
[yaml config file](/docs/config/aider_conf.html), like this:
|
||||
[YAML config file](/docs/config/aider_conf.html), like this:
|
||||
|
||||
```yaml
|
||||
openai-api-key: <key>
|
||||
@@ -74,7 +74,7 @@ OPENROUTER_API_KEY=bar
|
||||
DEEPSEEK_API_KEY=baz
|
||||
```
|
||||
|
||||
#### Yaml config file
|
||||
#### YAML config file
|
||||
|
||||
|
||||
You can also set API keys in the
|
||||
|
||||
@@ -112,7 +112,7 @@ cog.outl("```")
|
||||
## Set the reasoning_effort API parameter (default: not set)
|
||||
#AIDER_REASONING_EFFORT=
|
||||
|
||||
## Set the thinking token budget for models that support it (default: not set)
|
||||
## Set the thinking token budget for models that support it. Use 0 to disable. (default: not set)
|
||||
#AIDER_THINKING_TOKENS=
|
||||
|
||||
## Verify the SSL cert when connecting to models (default: True)
|
||||
@@ -241,6 +241,9 @@ cog.outl("```")
|
||||
## Enable/disable adding .aider* to .gitignore (default: True)
|
||||
#AIDER_GITIGNORE=true
|
||||
|
||||
## Enable/disable the addition of files listed in .gitignore to Aider's editing scope.
|
||||
#AIDER_ADD_GITIGNORE_FILES=false
|
||||
|
||||
## Specify the aider ignore file (default: .aiderignore in git root)
|
||||
#AIDER_AIDERIGNORE=.aiderignore
|
||||
|
||||
@@ -253,11 +256,11 @@ cog.outl("```")
|
||||
## Enable/disable commits when repo is found dirty (default: True)
|
||||
#AIDER_DIRTY_COMMITS=true
|
||||
|
||||
## Attribute aider code changes in the git author name (default: True)
|
||||
#AIDER_ATTRIBUTE_AUTHOR=true
|
||||
## Attribute aider code changes in the git author name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence.
|
||||
#AIDER_ATTRIBUTE_AUTHOR=
|
||||
|
||||
## Attribute aider commits in the git committer name (default: True)
|
||||
#AIDER_ATTRIBUTE_COMMITTER=true
|
||||
## Attribute aider commits in the git committer name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence for aider edits.
|
||||
#AIDER_ATTRIBUTE_COMMITTER=
|
||||
|
||||
## Prefix commit messages with 'aider: ' if aider authored the changes (default: False)
|
||||
#AIDER_ATTRIBUTE_COMMIT_MESSAGE_AUTHOR=false
|
||||
@@ -265,6 +268,9 @@ cog.outl("```")
|
||||
## Prefix all commit messages with 'aider: ' (default: False)
|
||||
#AIDER_ATTRIBUTE_COMMIT_MESSAGE_COMMITTER=false
|
||||
|
||||
## Attribute aider edits using the Co-authored-by trailer in the commit message (default: True). If True, this takes precedence over default --attribute-author and --attribute-committer behavior unless they are explicitly set to True.
|
||||
#AIDER_ATTRIBUTE_CO_AUTHORED_BY=true
|
||||
|
||||
## Enable/disable git pre-commit hooks with --no-verify (default: False)
|
||||
#AIDER_GIT_COMMIT_VERIFY=false
|
||||
|
||||
@@ -316,6 +322,12 @@ cog.outl("```")
|
||||
## Permanently disable analytics
|
||||
#AIDER_ANALYTICS_DISABLE=false
|
||||
|
||||
## Send analytics to custom PostHog instance
|
||||
#AIDER_ANALYTICS_POSTHOG_HOST=
|
||||
|
||||
## Send analytics to custom PostHog project
|
||||
#AIDER_ANALYTICS_POSTHOG_PROJECT_API_KEY=
|
||||
|
||||
############
|
||||
# Upgrading:
|
||||
|
||||
@@ -379,6 +391,9 @@ cog.outl("```")
|
||||
#################
|
||||
# Other settings:
|
||||
|
||||
## Never prompt for or attempt to install Playwright for web scraping (default: False).
|
||||
#AIDER_DISABLE_PLAYWRIGHT=false
|
||||
|
||||
## specify a file to edit (can be used multiple times)
|
||||
#AIDER_FILE=
|
||||
|
||||
@@ -391,6 +406,9 @@ cog.outl("```")
|
||||
## Specify the language to use in the chat (default: None, uses system settings)
|
||||
#AIDER_CHAT_LANGUAGE=
|
||||
|
||||
## Specify the language to use in the commit message (default: None, user language)
|
||||
#AIDER_COMMIT_LANGUAGE=
|
||||
|
||||
## Always say yes to every confirmation
|
||||
#AIDER_YES_ALWAYS=
|
||||
|
||||
@@ -430,6 +448,9 @@ cog.outl("```")
|
||||
## Specify which editor to use for the /editor command
|
||||
#AIDER_EDITOR=
|
||||
|
||||
## Print shell completion script for the specified SHELL and exit. Supported shells: bash, tcsh, zsh. Example: aider --shell-completions bash
|
||||
#AIDER_SHELL_COMPLETIONS=
|
||||
|
||||
############################
|
||||
# Deprecated model settings:
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Aider allows you to configure your preferred text editor for use with the `/edit
|
||||
|
||||
You can specify the text editor with the `--editor` switch or using
|
||||
`editor:` in aider's
|
||||
[yaml config file](https://aider.chat/docs/config/aider_conf.html).
|
||||
[YAML config file](https://aider.chat/docs/config/aider_conf.html).
|
||||
|
||||
## Environment variables
|
||||
|
||||
|
||||
@@ -79,15 +79,18 @@ for alias, model in sorted(MODEL_ALIASES.items()):
|
||||
- `4-turbo`: gpt-4-1106-preview
|
||||
- `4o`: gpt-4o
|
||||
- `deepseek`: deepseek/deepseek-chat
|
||||
- `flash`: gemini/gemini-2.0-flash-exp
|
||||
- `gemini`: gemini/gemini-2.5-pro-preview-03-25
|
||||
- `gemini-2.5-pro`: gemini/gemini-2.5-pro-exp-03-25
|
||||
- `flash`: gemini/gemini-2.5-flash
|
||||
- `flash-lite`: gemini/gemini-2.5-flash-lite
|
||||
- `gemini`: gemini/gemini-2.5-pro
|
||||
- `gemini-2.5-pro`: gemini/gemini-2.5-pro
|
||||
- `gemini-exp`: gemini/gemini-2.5-pro-exp-03-25
|
||||
- `grok3`: xai/grok-3-beta
|
||||
- `haiku`: claude-3-5-haiku-20241022
|
||||
- `opus`: claude-3-opus-20240229
|
||||
- `optimus`: openrouter/openrouter/optimus-alpha
|
||||
- `opus`: claude-opus-4-20250514
|
||||
- `quasar`: openrouter/openrouter/quasar-alpha
|
||||
- `r1`: deepseek/deepseek-reasoner
|
||||
- `sonnet`: anthropic/claude-3-7-sonnet-20250219
|
||||
- `sonnet`: anthropic/claude-sonnet-4-20250514
|
||||
<!--[[[end]]]-->
|
||||
|
||||
## Priority
|
||||
|
||||
@@ -49,13 +49,16 @@ usage: aider [-h] [--model] [--openai-api-key] [--anthropic-api-key]
|
||||
[--completion-menu-current-color]
|
||||
[--completion-menu-current-bg-color] [--code-theme]
|
||||
[--show-diffs] [--git | --no-git]
|
||||
[--gitignore | --no-gitignore] [--aiderignore]
|
||||
[--subtree-only] [--auto-commits | --no-auto-commits]
|
||||
[--gitignore | --no-gitignore]
|
||||
[--add-gitignore-files | --no-add-gitignore-files]
|
||||
[--aiderignore] [--subtree-only]
|
||||
[--auto-commits | --no-auto-commits]
|
||||
[--dirty-commits | --no-dirty-commits]
|
||||
[--attribute-author | --no-attribute-author]
|
||||
[--attribute-committer | --no-attribute-committer]
|
||||
[--attribute-commit-message-author | --no-attribute-commit-message-author]
|
||||
[--attribute-commit-message-committer | --no-attribute-commit-message-committer]
|
||||
[--attribute-co-authored-by | --no-attribute-co-authored-by]
|
||||
[--git-commit-verify | --no-git-commit-verify]
|
||||
[--commit] [--commit-prompt] [--dry-run | --no-dry-run]
|
||||
[--skip-sanity-check-repo]
|
||||
@@ -63,7 +66,9 @@ usage: aider [-h] [--model] [--openai-api-key] [--anthropic-api-key]
|
||||
[--lint-cmd] [--auto-lint | --no-auto-lint]
|
||||
[--test-cmd] [--auto-test | --no-auto-test] [--test]
|
||||
[--analytics | --no-analytics] [--analytics-log]
|
||||
[--analytics-disable] [--just-check-update]
|
||||
[--analytics-disable] [--analytics-posthog-host]
|
||||
[--analytics-posthog-project-api-key]
|
||||
[--just-check-update]
|
||||
[--check-update | --no-check-update]
|
||||
[--show-release-notes | --no-show-release-notes]
|
||||
[--install-main-branch] [--upgrade] [--version]
|
||||
@@ -72,17 +77,19 @@ usage: aider [-h] [--model] [--openai-api-key] [--anthropic-api-key]
|
||||
[--copy-paste | --no-copy-paste] [--apply]
|
||||
[--apply-clipboard-edits] [--exit] [--show-repo-map]
|
||||
[--show-prompts] [--voice-format] [--voice-language]
|
||||
[--voice-input-device] [--file] [--read] [--vim]
|
||||
[--chat-language] [--yes-always] [-v] [--load]
|
||||
[--encoding] [--line-endings] [-c] [--env-file]
|
||||
[--voice-input-device] [--disable-playwright] [--file]
|
||||
[--read] [--vim] [--chat-language] [--commit-language]
|
||||
[--yes-always] [-v] [--load] [--encoding]
|
||||
[--line-endings] [-c] [--env-file]
|
||||
[--suggest-shell-commands | --no-suggest-shell-commands]
|
||||
[--fancy-input | --no-fancy-input]
|
||||
[--multiline | --no-multiline]
|
||||
[--notifications | --no-notifications]
|
||||
[--notifications-command]
|
||||
[--detect-urls | --no-detect-urls] [--editor] [--opus]
|
||||
[--sonnet] [--haiku] [--4] [--4o] [--mini] [--4-turbo]
|
||||
[--35turbo] [--deepseek] [--o1-mini] [--o1-preview]
|
||||
[--detect-urls | --no-detect-urls] [--editor]
|
||||
[--shell-completions] [--opus] [--sonnet] [--haiku]
|
||||
[--4] [--4o] [--mini] [--4-turbo] [--35turbo]
|
||||
[--deepseek] [--o1-mini] [--o1-preview]
|
||||
|
||||
```
|
||||
|
||||
@@ -168,7 +175,7 @@ Set the reasoning_effort API parameter (default: not set)
|
||||
Environment variable: `AIDER_REASONING_EFFORT`
|
||||
|
||||
### `--thinking-tokens VALUE`
|
||||
Set the thinking token budget for models that support it (default: not set)
|
||||
Set the thinking token budget for models that support it. Use 0 to disable. (default: not set)
|
||||
Environment variable: `AIDER_THINKING_TOKENS`
|
||||
|
||||
### `--verify-ssl`
|
||||
@@ -385,6 +392,14 @@ Aliases:
|
||||
- `--gitignore`
|
||||
- `--no-gitignore`
|
||||
|
||||
### `--add-gitignore-files`
|
||||
Enable/disable the addition of files listed in .gitignore to Aider's editing scope.
|
||||
Default: False
|
||||
Environment variable: `AIDER_ADD_GITIGNORE_FILES`
|
||||
Aliases:
|
||||
- `--add-gitignore-files`
|
||||
- `--no-add-gitignore-files`
|
||||
|
||||
### `--aiderignore AIDERIGNORE`
|
||||
Specify the aider ignore file (default: .aiderignore in git root)
|
||||
Default: .aiderignore
|
||||
@@ -412,16 +427,14 @@ Aliases:
|
||||
- `--no-dirty-commits`
|
||||
|
||||
### `--attribute-author`
|
||||
Attribute aider code changes in the git author name (default: True)
|
||||
Default: True
|
||||
Attribute aider code changes in the git author name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence.
|
||||
Environment variable: `AIDER_ATTRIBUTE_AUTHOR`
|
||||
Aliases:
|
||||
- `--attribute-author`
|
||||
- `--no-attribute-author`
|
||||
|
||||
### `--attribute-committer`
|
||||
Attribute aider commits in the git committer name (default: True)
|
||||
Default: True
|
||||
Attribute aider commits in the git committer name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence for aider edits.
|
||||
Environment variable: `AIDER_ATTRIBUTE_COMMITTER`
|
||||
Aliases:
|
||||
- `--attribute-committer`
|
||||
@@ -443,6 +456,14 @@ Aliases:
|
||||
- `--attribute-commit-message-committer`
|
||||
- `--no-attribute-commit-message-committer`
|
||||
|
||||
### `--attribute-co-authored-by`
|
||||
Attribute aider edits using the Co-authored-by trailer in the commit message (default: True). If True, this takes precedence over default --attribute-author and --attribute-committer behavior unless they are explicitly set to True.
|
||||
Default: True
|
||||
Environment variable: `AIDER_ATTRIBUTE_CO_AUTHORED_BY`
|
||||
Aliases:
|
||||
- `--attribute-co-authored-by`
|
||||
- `--no-attribute-co-authored-by`
|
||||
|
||||
### `--git-commit-verify`
|
||||
Enable/disable git pre-commit hooks with --no-verify (default: False)
|
||||
Default: False
|
||||
@@ -537,6 +558,14 @@ Permanently disable analytics
|
||||
Default: False
|
||||
Environment variable: `AIDER_ANALYTICS_DISABLE`
|
||||
|
||||
### `--analytics-posthog-host ANALYTICS_POSTHOG_HOST`
|
||||
Send analytics to custom PostHog instance
|
||||
Environment variable: `AIDER_ANALYTICS_POSTHOG_HOST`
|
||||
|
||||
### `--analytics-posthog-project-api-key ANALYTICS_POSTHOG_PROJECT_API_KEY`
|
||||
Send analytics to custom PostHog project
|
||||
Environment variable: `AIDER_ANALYTICS_POSTHOG_PROJECT_API_KEY`
|
||||
|
||||
## Upgrading:
|
||||
|
||||
### `--just-check-update`
|
||||
@@ -652,6 +681,11 @@ Environment variable: `AIDER_VOICE_INPUT_DEVICE`
|
||||
|
||||
## Other settings:
|
||||
|
||||
### `--disable-playwright`
|
||||
Never prompt for or attempt to install Playwright for web scraping (default: False).
|
||||
Default: False
|
||||
Environment variable: `AIDER_DISABLE_PLAYWRIGHT`
|
||||
|
||||
### `--file FILE`
|
||||
specify a file to edit (can be used multiple times)
|
||||
Environment variable: `AIDER_FILE`
|
||||
@@ -669,6 +703,10 @@ Environment variable: `AIDER_VIM`
|
||||
Specify the language to use in the chat (default: None, uses system settings)
|
||||
Environment variable: `AIDER_CHAT_LANGUAGE`
|
||||
|
||||
### `--commit-language COMMIT_LANGUAGE`
|
||||
Specify the language to use in the commit message (default: None, user language)
|
||||
Environment variable: `AIDER_COMMIT_LANGUAGE`
|
||||
|
||||
### `--yes-always`
|
||||
Always say yes to every confirmation
|
||||
Environment variable: `AIDER_YES_ALWAYS`
|
||||
@@ -754,6 +792,10 @@ Aliases:
|
||||
Specify which editor to use for the /editor command
|
||||
Environment variable: `AIDER_EDITOR`
|
||||
|
||||
### `--shell-completions SHELL`
|
||||
Print shell completion script for the specified SHELL and exit. Supported shells: bash, tcsh, zsh. Example: aider --shell-completions bash
|
||||
Environment variable: `AIDER_SHELL_COMPLETIONS`
|
||||
|
||||
## Deprecated model settings:
|
||||
|
||||
### `--opus`
|
||||
|
||||
@@ -25,7 +25,7 @@ aider --model r1
|
||||
```
|
||||
|
||||
Inside the aider chat, you can use `/thinking-tokens 4k` or `/reasoning-effort low` to change
|
||||
the amount of reasoning.
|
||||
the amount of reasoning. Use `/thinking-tokens 0` to disable thinking tokens.
|
||||
|
||||
The rest of this document describes more advanced details which are mainly needed
|
||||
if you're configuring aider to work with a lesser known reasoning model or one served
|
||||
@@ -47,6 +47,7 @@ You can use the `--thinking-tokens` switch to request
|
||||
the model use a certain number of thinking tokens.
|
||||
This switch is useful for Sonnet 3.7.
|
||||
You can specify the token budget like "1024", "1k", "8k" or "0.01M".
|
||||
Use "0" to disable thinking tokens.
|
||||
|
||||
### Model compatibility and settings
|
||||
|
||||
|
||||
@@ -264,12 +264,14 @@ tr:hover { background-color: #f5f5f5; }
|
||||
</style>
|
||||
<table>
|
||||
<tr><th>Model Name</th><th class='right'>Total Tokens</th><th class='right'>Percent</th></tr>
|
||||
<tr><td>gemini/gemini-2.5-pro-exp-03-25</td><td class='right'>788,594</td><td class='right'>92.0%</td></tr>
|
||||
<tr><td>openrouter/openrouter/quasar-alpha</td><td class='right'>36,847</td><td class='right'>4.3%</td></tr>
|
||||
<tr><td>gemini/gemini-2.5-pro-preview-03-25</td><td class='right'>16,646</td><td class='right'>1.9%</td></tr>
|
||||
<tr><td>openrouter/deepseek/deepseek-chat-v3-0324:free</td><td class='right'>11,324</td><td class='right'>1.3%</td></tr>
|
||||
<tr><td>openrouter/REDACTED</td><td class='right'>1,755</td><td class='right'>0.2%</td></tr>
|
||||
<tr><td>vertex_ai/REDACTED</td><td class='right'>1,739</td><td class='right'>0.2%</td></tr>
|
||||
<tr><td>gemini/gemini-2.5-pro</td><td class='right'>222,908</td><td class='right'>33.2%</td></tr>
|
||||
<tr><td>gpt-5</td><td class='right'>211,072</td><td class='right'>31.4%</td></tr>
|
||||
<tr><td>None</td><td class='right'>168,988</td><td class='right'>25.1%</td></tr>
|
||||
<tr><td>o3-pro</td><td class='right'>36,620</td><td class='right'>5.4%</td></tr>
|
||||
<tr><td>gemini/gemini-2.5-flash-lite</td><td class='right'>15,470</td><td class='right'>2.3%</td></tr>
|
||||
<tr><td>gemini/gemini-2.5-flash-lite-preview-06-17</td><td class='right'>11,371</td><td class='right'>1.7%</td></tr>
|
||||
<tr><td>o3</td><td class='right'>3,915</td><td class='right'>0.6%</td></tr>
|
||||
<tr><td>openai/REDACTED</td><td class='right'>1,970</td><td class='right'>0.3%</td></tr>
|
||||
</table>
|
||||
|
||||
{: .note :}
|
||||
@@ -287,6 +289,16 @@ by doing something like `git blame` on the repo,
|
||||
and counting up who wrote all the new lines of code in each release.
|
||||
Only lines in source code files are counted, not documentation or prompt files.
|
||||
|
||||
## Why did aider ignore/discard its proposed edits after it asked to add a new file to the chat?
|
||||
|
||||
If aider prompts you to add a new file to the chat and you say yes,
|
||||
it will re-submit the original request.
|
||||
The fact that the LLM's reply indicated that it needed to see another file (and you said yes)
|
||||
is often a sign that the LLM should have been able to see/edit that file in the first place.
|
||||
Without access to it, there is increased chance that it's done a bad implementation of the requested change.
|
||||
Often LLMs will hallucinate content for the files they needed but didn't have.
|
||||
So aider re-submits the original request in this situation.
|
||||
|
||||
## Why does aider sometimes stop highlighting code in its replies?
|
||||
|
||||
Aider displays the markdown responses that are coming back from the LLM.
|
||||
@@ -363,6 +375,10 @@ Aider is
|
||||
under an
|
||||
[Apache 2.0 license](https://github.com/Aider-AI/aider/blob/main/LICENSE.txt).
|
||||
|
||||
## Can I Script Aider?
|
||||
|
||||
Yes. You can script aider via the command line or python. See more from here: [Scripting aider](https://aider.chat/docs/scripting.html)
|
||||
|
||||
|
||||
<div style="height:80vh"></div>
|
||||
|
||||
|
||||
@@ -71,4 +71,6 @@ Additionally, you can use the following options to prefix commit messages:
|
||||
- `--attribute-commit-message-author`: Prefix commit messages with 'aider: ' if aider authored the changes.
|
||||
- `--attribute-commit-message-committer`: Prefix all commit messages with 'aider: ', regardless of whether aider authored the changes or not.
|
||||
|
||||
Both of these options are disabled by default, but can be useful for easily identifying changes made by aider.
|
||||
Finally, you can use `--attribute-co-authored-by` to have aider append a Co-authored-by trailer to the end of the commit string.
|
||||
This will disable appending `(aider)` to the git author and git committer unless you have explicitly enabled those settings.
|
||||
|
||||
|
||||
@@ -28,12 +28,6 @@ These one-liners will install aider, along with python 3.12 if needed.
|
||||
They are based on the
|
||||
[uv installers](https://docs.astral.sh/uv/getting-started/installation/).
|
||||
|
||||
#### Windows
|
||||
|
||||
```powershell
|
||||
powershell -ExecutionPolicy ByPass -c "irm https://aider.chat/install.ps1 | iex"
|
||||
```
|
||||
|
||||
#### Mac & Linux
|
||||
|
||||
Use curl to download the script and execute it with sh:
|
||||
@@ -48,6 +42,12 @@ If your system doesn't have curl, you can use wget:
|
||||
wget -qO- https://aider.chat/install.sh | sh
|
||||
```
|
||||
|
||||
#### Windows
|
||||
|
||||
```powershell
|
||||
powershell -ExecutionPolicy ByPass -c "irm https://aider.chat/install.ps1 | iex"
|
||||
```
|
||||
|
||||
|
||||
## Install with uv
|
||||
|
||||
@@ -55,7 +55,7 @@ You can install aider with uv:
|
||||
|
||||
```bash
|
||||
python -m pip install uv # If you need to install uv
|
||||
uv tool install --force --python python3.12 aider-chat@latest
|
||||
uv tool install --force --python python3.12 --with pip aider-chat@latest
|
||||
```
|
||||
|
||||
This will install uv using your existing python version 3.8-3.13,
|
||||
|
||||
@@ -77,10 +77,10 @@ cog.out(get_supported_languages_md())
|
||||
| capnp | .capnp | | ✓ |
|
||||
| chatito | .chatito | ✓ | ✓ |
|
||||
| clarity | .clar | | ✓ |
|
||||
| clojure | .clj | | ✓ |
|
||||
| clojure | .cljc | | ✓ |
|
||||
| clojure | .cljs | | ✓ |
|
||||
| clojure | .edn | | ✓ |
|
||||
| clojure | .clj | ✓ | ✓ |
|
||||
| clojure | .cljc | ✓ | ✓ |
|
||||
| clojure | .cljs | ✓ | ✓ |
|
||||
| clojure | .edn | ✓ | ✓ |
|
||||
| cmake | .cmake | | ✓ |
|
||||
| cmake | CMakeLists.txt | | ✓ |
|
||||
| commonlisp | .cl | ✓ | ✓ |
|
||||
@@ -172,14 +172,16 @@ cog.out(get_supported_languages_md())
|
||||
| make | Makefile | | ✓ |
|
||||
| markdown | .markdown | | ✓ |
|
||||
| markdown | .md | | ✓ |
|
||||
| matlab | .m | | ✓ |
|
||||
| matlab | .mat | | ✓ |
|
||||
| matlab | .m | ✓ | ✓ |
|
||||
| matlab | .mat | ✓ | ✓ |
|
||||
| mermaid | .mermaid | | ✓ |
|
||||
| meson | meson.build | | ✓ |
|
||||
| ninja | .ninja | | ✓ |
|
||||
| nix | .nix | | ✓ |
|
||||
| nqc | .nqc | | ✓ |
|
||||
| objc | .mm | | ✓ |
|
||||
| ocaml | .ml | ✓ | ✓ |
|
||||
| ocaml_interface | .mli | ✓ | ✓ |
|
||||
| odin | .odin | | ✓ |
|
||||
| org | .org | | ✓ |
|
||||
| pascal | .pas | | ✓ |
|
||||
|
||||
@@ -128,6 +128,6 @@ mod_dates = [get_last_modified_date(file) for file in files]
|
||||
latest_mod_date = max(mod_dates)
|
||||
cog.out(f"{latest_mod_date.strftime('%B %d, %Y.')}")
|
||||
]]]-->
|
||||
March 31, 2025.
|
||||
April 12, 2025.
|
||||
<!--[[[end]]]-->
|
||||
</p>
|
||||
|
||||
@@ -8,100 +8,261 @@ has_children: true
|
||||
|
||||
# Aider LLM Leaderboards
|
||||
|
||||
Aider works best with LLMs which are good at *editing* code, not just good at writing
|
||||
code.
|
||||
To evaluate an LLM's editing skill, aider uses benchmarks that
|
||||
assess a model's ability to consistently follow the system prompt
|
||||
to successfully edit code.
|
||||
Aider excels with LLMs skilled at writing and *editing* code,
|
||||
and uses benchmarks to
|
||||
evaluate an LLM's ability to follow instructions and edit code successfully without
|
||||
human intervention.
|
||||
[Aider's polyglot benchmark](https://aider.chat/2024/12/21/polyglot.html#the-polyglot-benchmark) tests LLMs on 225 challenging Exercism coding exercises across C++, Go, Java, JavaScript, Python, and Rust.
|
||||
|
||||
The leaderboards report the results from a number of popular LLMs.
|
||||
While [aider can connect to almost any LLM](/docs/llms.html),
|
||||
it works best with models that score well on the benchmarks.
|
||||
<h2 id="leaderboard-title">Aider polyglot coding leaderboard</h2>
|
||||
|
||||
|
||||
## Polyglot leaderboard
|
||||
|
||||
[Aider's polyglot benchmark](https://aider.chat/2024/12/21/polyglot.html#the-polyglot-benchmark)
|
||||
asks the LLM to edit source files to complete 225 coding exercises
|
||||
from Exercism.
|
||||
It contains exercises in many popular programming languages:
|
||||
C++, Go, Java, JavaScript, Python and Rust.
|
||||
The 225 exercises were purposely selected to be the *hardest*
|
||||
that Exercism offered in those languages, to provide
|
||||
a strong coding challenge to LLMs.
|
||||
|
||||
This benchmark measures the LLM's coding ability in popular languages,
|
||||
and whether it can
|
||||
write new code that integrates into existing code.
|
||||
The model also has to successfully apply all its changes to the source file without human intervention.
|
||||
|
||||
<input type="text" id="editSearchInput" placeholder="Search..." style="width: 100%; max-width: 800px; margin: 10px auto; padding: 8px; display: block; border: 1px solid #ddd; border-radius: 4px;">
|
||||
<div id="controls-container" style="display: flex; align-items: center; width: 100%; max-width: 800px; margin: 10px auto; gap: 10px; box-sizing: border-box; padding: 0 5px; position: relative;">
|
||||
<input type="text" id="editSearchInput" placeholder="Search..." style="flex-grow: 1; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
|
||||
<div id="view-mode-toggle" style="display: inline-flex; border: 1px solid #ccc; border-radius: 4px;">
|
||||
<button id="mode-view-btn" class="mode-button active" data-mode="view" style="padding: 8px 8px; border: none; border-radius: 3px 0 0 3px; cursor: pointer; font-size: 14px; line-height: 1.5; min-width: 50px;">View</button>
|
||||
<button id="mode-select-btn" class="mode-button" data-mode="select" style="padding: 8px 8px; border: none; background-color: #f8f9fa; border-radius: 0; cursor: pointer; border-left: 1px solid #ccc; font-size: 14px; line-height: 1.5; min-width: 50px;">Select</button>
|
||||
<button id="mode-detail-btn" class="mode-button" data-mode="detail" style="padding: 8px 8px; border: none; background-color: #f8f9fa; border-radius: 0 3px 3px 0; cursor: pointer; border-left: 1px solid #ccc; font-size: 14px; line-height: 1.5; min-width: 50px;">Detail</button>
|
||||
</div>
|
||||
<button id="close-controls-btn" style="width: 18px; height: 18px; padding: 0; border: 1px solid #ddd; border-radius: 50%; background-color: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; margin-left: 4px; color: #999;">×</button>
|
||||
</div>
|
||||
|
||||
<table style="width: 100%; max-width: 800px; margin: auto; border-collapse: collapse; box-shadow: 0 2px 4px rgba(0,0,0,0.1); font-size: 14px;">
|
||||
<thead style="background-color: #f2f2f2;">
|
||||
<tr>
|
||||
<th style="padding: 8px; width: 40px; text-align: center; vertical-align: middle;">
|
||||
<input type="checkbox" id="select-all-checkbox" style="display: none; cursor: pointer; vertical-align: middle;">
|
||||
</th> <!-- Header checkbox added here -->
|
||||
<th style="padding: 8px; text-align: left;">Model</th>
|
||||
<th style="padding: 8px; text-align: center;">Percent correct</th>
|
||||
<th style="padding: 8px; text-align: center;">Percent using correct edit format</th>
|
||||
<th style="padding: 8px; text-align: left;">Command</th>
|
||||
<th style="padding: 8px; text-align: center;">Edit format</th>
|
||||
<th style="padding: 8px; text-align: center;">Cost</th>
|
||||
<th style="padding: 8px; text-align: center; width: 25%">Percent correct</th>
|
||||
<th style="padding: 8px; text-align: center; width: 25%">Cost</th>
|
||||
<th style="padding: 8px; text-align: left;" class="col-command">Command</th>
|
||||
<th style="padding: 8px; text-align: center; width: 10%" class="col-conform">Correct edit format</th>
|
||||
<th style="padding: 8px; text-align: left; width: 10%" class="col-edit-format">Edit Format</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% assign max_cost = 0 %}
|
||||
{% for row in site.data.polyglot_leaderboard %}
|
||||
{% if row.total_cost > max_cost %}
|
||||
{% assign max_cost = row.total_cost %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if max_cost == 0 %}{% assign max_cost = 1 %}{% endif %}
|
||||
{% assign edit_sorted = site.data.polyglot_leaderboard | sort: 'pass_rate_2' | reverse %}
|
||||
{% for row in edit_sorted %}
|
||||
<tr style="border-bottom: 1px solid #ddd;">
|
||||
<td style="padding: 8px;">{{ row.model }}</td>
|
||||
<td style="padding: 8px; text-align: center;">{{ row.pass_rate_2 }}%</td>
|
||||
<td style="padding: 8px; text-align: center;">{{ row.percent_cases_well_formed }}%</td>
|
||||
<td style="padding: 8px;"><code>{{ row.command }}</code></td>
|
||||
<td style="padding: 8px; text-align: center;">{{ row.edit_format }}</td>
|
||||
<td style="padding: 8px; text-align: center;">{% if row.total_cost == 0 %}?{% else %}${{ row.total_cost | times: 1.0 | round: 2 }}{% endif %}</td>
|
||||
{% for row in edit_sorted %} {% comment %} Add loop index for unique IDs {% endcomment %}
|
||||
{% assign row_index = forloop.index0 %}
|
||||
<tr id="main-row-{{ row_index }}">
|
||||
<td style="padding: 8px; text-align: center; vertical-align: middle;">
|
||||
<button class="toggle-details" data-target="details-{{ row_index }}" style="background: none; border: none; cursor: pointer; font-size: 16px; padding: 0; vertical-align: middle;">▶</button>
|
||||
<input type="checkbox" class="row-selector" data-row-index="{{ row_index }}" style="display: none; cursor: pointer; vertical-align: middle;">
|
||||
</td>
|
||||
<td style="padding: 8px;"><span>{{ row.model }}</span></td>
|
||||
<td class="bar-cell">
|
||||
<div class="bar-viz" style="width: {{ row.pass_rate_2 }}%; background-color: rgba(40, 167, 69, 0.3); border-right: 1px solid rgba(40, 167, 69, 0.5);"></div>
|
||||
<span>{{ row.pass_rate_2 }}%</span>
|
||||
</td>
|
||||
<td class="bar-cell cost-bar-cell">
|
||||
{% if row.total_cost > 0 %}
|
||||
<div class="bar-viz cost-bar" data-cost="{{ row.total_cost }}" data-max-cost="{{ max_cost }}" style="width: 0%; background-color: rgba(13, 110, 253, 0.3); border-right: 1px solid rgba(13, 110, 253, 0.5);"></div>
|
||||
{% endif %}
|
||||
{% assign rounded_cost = row.total_cost | times: 1.0 | round: 2 %}
|
||||
<span>{% if row.total_cost == 0 or rounded_cost == 0.00 %}{% else %}${{ rounded_cost }}{% endif %}</span>
|
||||
</td>
|
||||
<td style="padding: 8px;" class="col-command"><span><code>{{ row.command }}</code></span></td>
|
||||
<td style="padding: 8px; text-align: center;" class="col-conform"><span>{{ row.percent_cases_well_formed }}%</span></td>
|
||||
<td style="padding: 8px;" class="col-edit-format"><span>{{ row.edit_format }}</span></td>
|
||||
</tr>
|
||||
<tr class="details-row" id="details-{{ row_index }}" style="display: none; background-color: #f9f9f9;">
|
||||
<td colspan="7" style="padding: 15px; border-bottom: 1px solid #ddd;">
|
||||
<ul style="margin: 0; padding-left: 20px; list-style: none; border-bottom: 1px solid #ddd;">
|
||||
{% for pair in row %}
|
||||
{% if pair[1] != "" and pair[1] != nil %}
|
||||
<li><strong>
|
||||
{% if pair[0] == 'percent_cases_well_formed' %}
|
||||
Percent cases well formed
|
||||
{% else %}
|
||||
{{ pair[0] | replace: '_', ' ' | capitalize }}
|
||||
{% endif %}
|
||||
:</strong>
|
||||
{% if pair[0] == 'command' %}<code>{{ pair[1] }}</code>{% else %}{{ pair[1] }}{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### Aider polyglot benchmark results
|
||||
|
||||
<canvas id="editChart" width="800" height="450" style="margin-top: 20px"></canvas>
|
||||
<script src="https://unpkg.com/patternomaly/dist/patternomaly.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script>
|
||||
{% assign data_source = edit_sorted %}
|
||||
{% assign pass_rate_field = "pass_rate_2" %}
|
||||
{% assign highlight_model = "xxxxxx" %}
|
||||
{% include leaderboard.js %}
|
||||
</script>
|
||||
<style>
|
||||
#leaderboard-title {
|
||||
margin-bottom: 20px; /* Add space below the title */
|
||||
}
|
||||
tr.selected {
|
||||
color: #0056b3;
|
||||
}
|
||||
table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
thead {
|
||||
border-top: 1px solid #ddd; /* Add top border to header */
|
||||
}
|
||||
td, th {
|
||||
border: none; /* Remove internal cell borders */
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
vertical-align: middle; /* Ensure consistent vertical alignment */
|
||||
}
|
||||
td:nth-child(3), td:nth-child(4) {
|
||||
font-size: 12px;
|
||||
tbody tr {
|
||||
height: 50px; /* Set a minimum height for all data rows */
|
||||
}
|
||||
|
||||
/* Hide command and edit format columns on mobile */
|
||||
td.col-command { /* Command column */
|
||||
font-size: 12px; /* Keep font size adjustment for command column if desired, or remove */
|
||||
}
|
||||
|
||||
/* Hide new columns first on smaller screens */
|
||||
@media screen and (max-width: 991px) {
|
||||
th.col-conform, td.col-conform,
|
||||
th.col-edit-format, td.col-edit-format {
|
||||
display: none;
|
||||
}
|
||||
/* Increase width of Percent correct and Cost columns when others are hidden */
|
||||
th:nth-child(3), td:nth-child(3), /* Percent correct */
|
||||
th:nth-child(4), td:nth-child(4) { /* Cost */
|
||||
width: 33% !important; /* Override inline style */
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide command column on even smaller screens */
|
||||
@media screen and (max-width: 767px) {
|
||||
th:nth-child(4), td:nth-child(4), /* Command column */
|
||||
th:nth-child(5), td:nth-child(5) { /* Edit format column */
|
||||
th.col-command, td.col-command { /* Command column */
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* --- Control Styles --- */
|
||||
#controls-container {
|
||||
margin-bottom: 20px; /* Add some space below controls */
|
||||
}
|
||||
|
||||
#editSearchInput, #view-mode-select {
|
||||
padding: 8px 12px; /* Consistent padding */
|
||||
border: 1px solid #ccc; /* Slightly softer border */
|
||||
border-radius: 4px;
|
||||
font-size: 14px; /* Match table font size */
|
||||
height: 38px; /* Match height */
|
||||
box-sizing: border-box; /* Include padding/border in height */
|
||||
}
|
||||
|
||||
|
||||
.bar-cell {
|
||||
position: relative; /* Positioning context for the bar */
|
||||
padding: 8px;
|
||||
/* text-align: center; Removed */
|
||||
overflow: hidden; /* Prevent bar from overflowing cell boundaries if needed */
|
||||
}
|
||||
.cost-bar-cell {
|
||||
background-image: none; /* Remove default gradient for cost cells */
|
||||
}
|
||||
.percent-tick, .cost-tick {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(10px);
|
||||
height: 8px; /* Short tick */
|
||||
width: 1px;
|
||||
background-color: rgba(170, 170, 170, 0.5);
|
||||
z-index: 2; /* Above the bar but below the text */
|
||||
}
|
||||
.bar-viz {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%; /* Position at the middle of the cell */
|
||||
transform: translateY(-50%); /* Center the bar vertically */
|
||||
z-index: 1; /* Above background, below ticks and text */
|
||||
height: 36px;
|
||||
border-radius: 0 2px 2px 0; /* Slightly rounded end corners */
|
||||
/* Width and colors are set inline via style attribute */
|
||||
}
|
||||
/* Add a tooltip class for showing cost information on hover */
|
||||
.cost-bar-cell:hover .bar-viz[style*="background-image"] {
|
||||
animation: stripe-animation 2s linear infinite;
|
||||
}
|
||||
@keyframes stripe-animation {
|
||||
0% { background-position: 0 0; }
|
||||
100% { background-position: 20px 0; }
|
||||
}
|
||||
.bar-cell span {
|
||||
position: absolute; /* Position relative to the cell */
|
||||
left: 5px; /* Position slightly inside the left edge */
|
||||
top: 50%; /* Center vertically */
|
||||
transform: translateY(-50%); /* Adjust vertical centering */
|
||||
z-index: 3; /* Ensure text is above everything else */
|
||||
background-color: rgba(255, 255, 255, 0.7); /* Semi-transparent white background */
|
||||
padding: 0 4px; /* Add padding around the text */
|
||||
border-radius: 3px; /* Rounded corners for the text background */
|
||||
font-size: 14px; /* Adjust font size for the numbers */
|
||||
}
|
||||
.toggle-details {
|
||||
color: #888; /* Make toggle symbol more subtle */
|
||||
transition: color 0.2s; /* Smooth transition on hover */
|
||||
}
|
||||
|
||||
|
||||
/* Style for selected rows */
|
||||
tr.row-selected > td {
|
||||
background-color: #e7f3ff; /* Example light blue highlight */
|
||||
}
|
||||
|
||||
/* Ensure checkbox is vertically aligned if needed */
|
||||
.row-selector {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Hide rows not matching the filter */
|
||||
tr.hidden-by-mode {
|
||||
display: none !important; /* Use important to override other display styles if necessary */
|
||||
}
|
||||
tr.hidden-by-search {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* --- Mode Toggle Button Styles --- */
|
||||
#view-mode-toggle {
|
||||
height: 38px; /* Match input height */
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0; /* Prevent toggle from shrinking on small screens */
|
||||
}
|
||||
.mode-button {
|
||||
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
|
||||
white-space: nowrap; /* Prevent text wrapping */
|
||||
}
|
||||
.mode-button:not(.active) {
|
||||
background-color: #f8f9fa; /* Light grey background */
|
||||
color: #495057; /* Dark grey text */
|
||||
}
|
||||
.mode-button:not(.active):hover {
|
||||
background-color: #e2e6ea; /* Slightly darker grey on hover */
|
||||
}
|
||||
|
||||
/* Style for highlighted rows in view mode */
|
||||
tr.view-highlighted > td {
|
||||
background-color: #fffef5; /* Very light yellow/cream */
|
||||
/* Border moved to specific cell below */
|
||||
}
|
||||
/* Apply border and adjust padding ONLY for the first *visible* cell (Model name) in view mode */
|
||||
tr.view-highlighted > td:nth-child(2) {
|
||||
border-left: 4px solid #ffc107; /* Warning yellow border */
|
||||
/* Original padding is 8px. Subtract border width. */
|
||||
padding-left: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
{% include leaderboard_table.js %}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<p class="post-date">
|
||||
<p class="post-date" style="margin-top: 20px;">
|
||||
By Paul Gauthier,
|
||||
last updated
|
||||
<!--[[[cog
|
||||
@@ -124,6 +285,6 @@ mod_dates = [get_last_modified_date(file) for file in files]
|
||||
latest_mod_date = max(mod_dates)
|
||||
cog.out(f"{latest_mod_date.strftime('%B %d, %Y.')}")
|
||||
]]]-->
|
||||
April 04, 2025.
|
||||
August 13, 2025.
|
||||
<!--[[[end]]]-->
|
||||
</p>
|
||||
|
||||
@@ -9,8 +9,7 @@ nav_order: 800
|
||||
|
||||
All pricing information is the cost to run the benchmark at the time it was
|
||||
run.
|
||||
Providers change their pricing, and every benchmark run ends up with a slightly
|
||||
different cost.
|
||||
Providers change their pricing and sometimes introduce entirely novel pricing structures.
|
||||
Pricing is provided on a *best efforts* basis, and may not always be current
|
||||
or fully accurate.
|
||||
|
||||
|
||||
@@ -73,6 +73,6 @@ mod_dates = [get_last_modified_date(file) for file in files]
|
||||
latest_mod_date = max(mod_dates)
|
||||
cog.out(f"{latest_mod_date.strftime('%B %d, %Y.')}")
|
||||
]]]-->
|
||||
March 31, 2025.
|
||||
April 12, 2025.
|
||||
<!--[[[end]]]-->
|
||||
</p>
|
||||
|
||||
@@ -98,7 +98,7 @@ if result.returncode == 0:
|
||||
date = datetime.datetime.fromtimestamp(timestamp)
|
||||
cog.out(f"{date.strftime('%B %d, %Y.')}")
|
||||
]]]-->
|
||||
March 31, 2025.
|
||||
April 12, 2025.
|
||||
<!--[[[end]]]-->
|
||||
|
||||
</p>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user