Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Aider error

Aider: The LLM did not conform to the edit format

Error message
The LLM did not conform to the edit format.

Status: WorkaroundLast verified 5 documented fixes3 sources

What it means

The model replied with code changes in a format aider could not parse or apply, so the edits were not written to your files. The docs also describe this as aider saying something like "Failed to apply edit to *filename*". Aider prints a link to the edit-errors doc and sends the parse error back to the model so it can retry.

Causes

  • The LLM is disobeying the system prompts and trying to make edits in a format aider doesn't expect (official docs).
  • Too much context: above about 25k tokens of context, most models start to become distracted and become less likely to conform to their system prompt (official docs).
  • Weaker models, most local models and quantized local models are more prone to disobeying the system prompt instructions (official docs).
  • The Ollama context window defaults to be very small and silently discards data if you exceed it (official docs).

How to fix it

  1. Fix 1.

    Only add the files that need to be edited. Use /drop to remove files the task does not need, /clear to remove conversation history, and /tokens to see token usage.

    Snippet
    /drop
    /clear
    /tokens
  2. Fix 2.

    Use a more capable model. The docs list GPT-4o, o3-mini, Claude 3.7 Sonnet, DeepSeek V3 or DeepSeek R1 as strong and capable models.

  3. Fix 3.

    Switch to the whole edit format.

    Terminal
    aider --edit-format whole
  4. Fix 4.

    Try architect mode, which proposes changes and then uses a separate model to handle the file edits.

    Terminal
    aider --architect
    # or, inside a session:
    /chat-mode architect
  5. Fix 5.

    For local models, set the Ollama context window size as described in the Ollama docs.

More Aider errors

All 17 Aider errors

FAQ

What does "The LLM did not conform to the edit format" mean in Aider?

The model replied with code changes in a format aider could not parse or apply, so the edits were not written to your files. The docs also describe this as aider saying something like "Failed to apply edit to *filename*". Aider prints a link to the edit-errors doc and sends the parse error back to the model so it can retry.

How do I fix "The LLM did not conform to the edit format"?

There are 5 documented fixes. Start with the first: Only add the files that need to be edited. Use /drop to remove files the task does not need, /clear to remove conversation history, and /tokens to see token usage.

Is this Aider error fixed?

Status: Workaround. No release removes the cause. The documented fixes work around it. Affected versions: All versions; model-dependent behavior.

Sources

Last verified against 3 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.