Whoever changed a line last gets credit. Only the new or newly changed lines in each release are considered.
So no, "lines/diffs otherwise untouched" are NOT considered written by aider. That wouldn't make sense?
1,951 karma · joined March 27, 2009
Whoever changed a line last gets credit. Only the new or newly changed lines in each release are considered.
So no, "lines/diffs otherwise untouched" are NOT considered written by aider. That wouldn't make sense?
Yes, absolutely you can work with local models. Here are the docs for working with lmstudio and ollama:
There’s a faq entry about how these stats are computed [0]. Basically using git blame, since aider is tightly integrated with git.
The faq links to the script that computes the stats. It’s not designed to be used on any repo, but you (or aider) could adapt it.
You’re not the first to ask for these stats about your own repo, so I may generalize it at some point.
[0] https://aider.chat/docs/faq.html#how-are-the-aider-wrote-xx-...
It's definitely possible for AI to do a large fraction of your coding, and for it to contribute significantly to "improving itself". As an example, aider currently writes about 70% of the new code in each of its releases.
I automatically track and share this stat as graph [0] with aider's release notes.
Before Sonnet, most releases were less than 20% AI generated code. With Sonnet, that jumped to >50%. For the last few months, about 70% of the new code in each release is written by aider. The record is 82%.
Folks often ask which models I use to code aider, so I automatically publish those stats too [1]. I've been shifting more and more of my coding from Sonnet to DeepSeek V3 in recent weeks. I've been experimenting with R1, but the recent API outages have made that difficult.
[0] https://aider.chat/HISTORY.html
[1] https://aider.chat/docs/faq.html#what-llms-do-you-use-to-bui...
Too much context can still confuse the LLMs in this situation, but they may be somewhat more resilient.
That 2k default is extremely low, and ollama *silently* discards the leading context. So users have no idea that most of their data hasn’t been provided to the model.
I’ve had to add docs [0] to aider about this, and aider overrides the default to at least 8k tokens. I’d like to do more, but unilaterally raising the context window size has performance implications for users.
Edit: Ok, aider now gives ollama users a clear warning when their chat context exceeds their ollama context window [1].
[0] https://aider.chat/docs/llms/ollama.html#setting-the-context...
[1] https://github.com/Aider-AI/aider/blob/main/aider/coders/bas...
Developing aider, I've seen this problem with gpt-4o, Sonnet, DeepSeek, etc. Many aider users report this too. It's perhaps the #1 problem users have, so I created a dedicated help page [0].
Very large context may be useful for certain tasks with lots of "low value" context. But for coding, it seems to lure users into a problematic regime.
[0] https://aider.chat/docs/troubleshooting/edit-errors.html#don...
Some pragmatic tips:
- Work with AI like a junior developer, except with unlimited energy and no problem being corrected repeatedly.
- Provide the AI with guidance about conventions you expect in your code base, overall architecture, etc [1]. You can often use AI tools to help write the first draft of such "conventions" documents.
- Break the work down into self-contained bite sized steps. Don't ask AI to boil the ocean in one iteration. Ask it to make a sequence of changes that each move the code towards the goal.
- Be willing to explore for a few steps with the AI. If it's going sideways, undo/revert. Hopefully your AI tool has good checkpoint/undo/git support [2].
- Lint and test the code after each AI change. Hopefully your AI tool can automatically do that, and fix problems [3].
- If the AI is stuck, just code yourself until you get past the tricky part. Then resume AI coding when the going is easier.
- Build intuition for what AI tools are good at, use them when they're helpful. Code yourself when not.
Some things AI coding is very helpful for:
- Rough first draft of a change or feature. AI can often speed through a bunch of boilerplate. Then you can polish the final touches.
- Writing tests.
- Fixing fairly simple bugs.
- Efficiently solving problems with packages/libraries you may not have known about.
[0] https://aider.chat/HISTORY.html
[1] https://aider.chat/docs/usage/conventions.html
Aider exploits all this structure, using a "repository map" [0]. It use tree-sitter to build a call graph of the code base. Then runs a graph optimization on it with respect to the current state of the AI coding chat. This finds the most relevant parts of the code base, which aider shares with the LLM as context.
Your first link to RepoGraph is an adaptation of the actual aider repo map implementation. In their source code [1], they have some acknowledgements to aider and grep-ast (which is part of aider).
[0] https://aider.chat/docs/repomap.html
[1] https://github.com/ozyyshr/RepoGraph/blob/79861642515f0d6b17...
Here are the results:
| Number of
| "write better code"
Score | followup prompts
---------------------------
27.6% | 0 (baseline)
19.6% | 1
11.1% | 2
It appears that blindly asking DeepSeek to "write better code" significantly harms its ability to solve the benchmark tasks. It turns working solutions into code that no longer passes the hidden test suite.This is similar to the "debug f-strings" introduced in python 3.8: print(f"{foo=}"). But it's much easier to type dump(foo) and you get prettier output for complex types.
x = 3
foo = dict(bar=1, baz=dict(hello="world"))
dump(x)
dump(foo)
# prints...
x: 3
foo:
{
"bar": 1,
"baz": {
"hello": "world"
}
}
https://github.com/Aider-AI/aider/blob/main/aider/dump.pyAider has been doing PageRank on the call graph of code repos since forever. All non trivial code has lots of graph structure to support PageRank. So it works really well to find the most relevant context in the project related to the currently active task.
Same surprising conclusion: gpt-3.5-turbo-instruct is much better at chess.
84% Claude 3.5 Sonnet 10/22
80% o1-preview
77% Claude 3.5 Sonnet 06/20
72% DeepSeek V2.5
72% GPT-4o 08/06
71% o1-mini
68% Claude 3 Opus
It also sets SOTA on aider's more demanding refactoring benchmark with a score of 92.1%! 92% Sonnet 10/22
75% o1-preview
72% Opus
64% Sonnet 06/20
49% GPT-4o 08/06
45% o1-mini
https://aider.chat/docs/leaderboards/ aider --no-git oneoffscript.py - An Architect model solves the coding task.
- An Editor model edits the source code.
This approach set a new SOTA on the aider code editing benchmark, using o1-preview as the Architect and either DeepSeek V2.5 or o1-mini as the Editor. 80% o1-preview whole
77% Sonnet diff
75% o1-preview diff
75% Sonnet whole
71% GPT-4o diffYi-Coder results, with Sonnet and GPT-3.5 for scale:
77% Sonnet
58% GPT-3.5
54% Yi-Coder-9b-Chat
45% Yi-Coder-9b-Chat-q4_0
Full leaderboard:But ya, aider can: code something for you, run it, capture the terminal output with pexpect and iterate further based on that.
I used it to let aider suggest and run shell commands [1]. This is handy, so aider can offer to run the code it just wrote for you, run migrations, install dependencies, etc.
Using pexepect makes it easy for aider to run interactive shell commands and capture their output. This allows aider to fix bugs or suggest next steps based on the command’s output, error messages, etc.
Aider wrote 61% of the new code in its last release. It’s been averaging about 50% since the new Sonnet came out.
Data and graphs about aider’s contribution to its own code base: