This commit is contained in:
Paul Gauthier 2024-06-08 10:00:16 -07:00
parent be0520f62f
commit 0882ae9982
5 changed files with 72 additions and 31 deletions

View file

@ -63,34 +63,6 @@ has provided this
[Colab notebook](https://colab.research.google.com/drive/1J9XynhrCqekPL5PR6olHP6eE--rnnjS9?usp=sharing). [Colab notebook](https://colab.research.google.com/drive/1J9XynhrCqekPL5PR6olHP6eE--rnnjS9?usp=sharing).
## Aider isn't editing my files?
Sometimes the LLM will reply with some code changes that don't get applied to your local files.
In these cases, aider might say something like "Failed to apply edit to *filename*".
This usually happens because the LLM is not specifying the edits
to make in the format that aider expects.
GPT-3.5 is especially prone to disobeying the system prompt instructions in this manner, but it also happens with stronger models.
Aider makes every effort to get the LLM
to conform, and works hard to deal with
replies that are "almost" correctly formatted.
If Aider detects an improperly formatted reply, it gives
the LLM feedback to try again.
Also, before each release new versions of aider are
[benchmarked](https://aider.chat/docs/benchmarks.html).
This helps prevent regressions in the code editing
performance of an LLM that could have been inadvertantly
introduced.
But sometimes the LLM just won't cooperate.
In these cases, here are some things you might try:
- Use `/drop` to remove files from the chat session which aren't needed for the task at hand. This will reduce distractions and may help GPT produce properly formatted edits.
- Use `/clear` to remove the conversation history, again to help GPT focus.
- Try the a different LLM.
## Can I change the system prompts that aider uses? ## Can I change the system prompts that aider uses?
Aider is set up to support different system prompts and edit formats Aider is set up to support different system prompts and edit formats

View file

@ -62,7 +62,7 @@ from aider.models import Model
# This is a list of files to add to the chat # This is a list of files to add to the chat
fnames = ["greeting.py"] fnames = ["greeting.py"]
model = Model("gpt-4-turbo", weak_model="gpt-3.5-turbo") model = Model("gpt-4-turbo")
# Create a coder object # Create a coder object
coder = Coder.create(main_model=model, fnames=fnames) coder = Coder.create(main_model=model, fnames=fnames)
@ -84,6 +84,6 @@ It can also be helpful to set the equivalend of `--yes` by doing this:
from aider.io import InputOutput from aider.io import InputOutput
io = InputOutput(yes=True) io = InputOutput(yes=True)
# ... # ...
coder = Coder.create(client=client, fnames=fnames, io=io) coder = Coder.create(model=model, fnames=fnames, io=io)
``` ```

View file

@ -0,0 +1,27 @@
---
nav_order: 60
has_children: true
---
# Troubleshooting
Below are some approaches for troubleshooting problems with aider.
If you need more help, please file a
[GitHub issue]()
or drop into our
[Discord]().
When reporting problems, it is very helpful if you can provide:
- Aider version
- LLM model you are using
The easiest way to do that is to copy the "announcement" lines that
aider prints when you run it:
```
Aider v0.37.1-dev
Models: gpt-4o with diff edit format, weak model gpt-3.5-turbo
Git repo: .git with 243 files
Repo-map: using 1024 tokens
```

View file

@ -0,0 +1,42 @@
---
parent: Troubleshooting
nav_order: 10
---
# File editing problems
Sometimes the LLM will reply with some code changes
that don't get applied to your local files.
In these cases, aider might say something like "Failed to apply edit to *filename*"
or other error messages.
This usually happens because the LLM is disobeying the system prompts
and trying to make edits in a format that aider doesn't expect.
Aider makes every effort to get the LLM
to conform, and works hard to deal with
LLMM edits that are "almost" correctly formatted.
But sometimes the LLM just won't cooperate.
In these cases, here are some things you might try.
## Use a capable model
If possible try using GPT-4o or Opus, as they are the strongest and most
capable models.
Weaker models
are more pront to
disobeying the system prompt instructions.
Most local models are just barely capable of working with aider,
so editing errors should be expected.
## Reduce distractions
Many models now have very large context windows,
but filling them with irrelevant code often
cofuses the model.
- Don't add too many files to the chat, *just* add the files you think need to be edited.
Aider also sends the LLM a [map of your entire git repo](https://aider.chat/docs/repomap.html), so other relevant code will be included automatically.
- Use `/drop` to remove files from the chat session which aren't needed for the task at hand. This will reduce distractions and may help GPT produce properly formatted edits.
- Use `/clear` to remove the conversation history, again to help GPT focus.

View file

@ -1,5 +1,5 @@
--- ---
parent: Connecting to LLMs parent: Troubleshooting
nav_order: 900 nav_order: 900
--- ---