Skip to content

Unable to use diff editing with local instsance of qwen2.5-coder-32b-instruct #2371

Description

@kbsphere

Issue

I am receiving the following error when attempting to use my local Llama instance of qwen2.5-coder-32b-instruct. (Ubuntu 24.04) When starting aider and pointing to my ollama instance with the following command

aider --model ollama/qwen2.5-coder-32b-instruct

I get the following errors:

OllamaError: Error getting model info for ollama/qwen2.5-coder-32b-instruct. Set Ollama API Base via OLLAMA_API_BASE environment variable. Error: Client error '404 Not Found' for url 'http://127.0.0.1:11434/api/show'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404
Warning for ollama/qwen2.5-coder-32b-instruct: Unknown context window size and costs, using sane defaults.
Did you mean one of these?

  • ollama/qwen2.5-coder-32b-instruct
    You can skip this check with --no-show-model-warnings

and the export for OLLAMA_API_BASE is also correctly configured despite the aforementioned aider error message

My ollama instance is correctly configured as far as I can tell, as I am able to go to my ollama api with the following curl command to obtain info about the hosted model,

curl http://localhost:11434/api/show -d '{
"name": "qwen2.5-coder-32b-instruct"
}'

This produces:

{"modelfile":"# Modelfile generated by "ollama show"\n# To build a new Modelfile based on this, replace FROM with:\n# FROM qwen2.5-coder-32b-instruct:latest\n\nFROM /usr/share/ollama/.ollama/models/blobs/sha256-5ebb70cfdbc4780a34142393418f9f570a82b0650ee4f9031c2f588a4379067c\nTEMPLATE {{ .Prompt }}\nPARAMETER repeat_penalty 1.2\nPARAMETER temperature 0.7\nPARAMETER top_k 50\nPARAMETER top_p 0.9\n","parameters":"repeat_penalty 1.2\ntemperature 0.7\ntop_k 50\ntop_p 0.9","template":"{{ .Prompt }}" etc etc.

It seems that Aider is unable to properly detect this model when loaded with ollama even though it seems aware of the correct pathing to ollama. (Warning for ollama/qwen2.5-coder-32b-instruct), however it is both detected properly and works with diff edits when loading with openrouter's implementation

aider --model openrouter/qwen/qwen-2.5-coder-32b-instruct --browser

I attempted to create a custom json to point to my local ollama instance with test settings but this produces the exact same warnings and does not seem to recognize the json file at all:
cat .aider.model.metadata.json
{
"ollama/qwen2.5-coder-32b-instruct": {
"max_tokens": 128000,
"max_input_tokens": 128000,
"max_output_tokens": 8000,
"input_cost_per_token": 0.000000,
"output_cost_per_token": 0.000000,
"litellm_provider": "ollama",
"mode": "chat",
"edit_format": "diff"
}
}

Am I doing something wrong here? At best the errors I am receiving are confusing and contradictory :
"Warning for ollama/qwen2.5-coder-32b-instruct: Unknown context window size and costs, using sane defaults.
Did you mean one of these?

  • ollama/qwen2.5-coder-32b-instruct"

This is the output of "ollama list" on my system:
$ ollama list
NAME ID SIZE MODIFIED
qwen2.5-coder-32b-instruct:latest 3849b64e2cbf 22 GB About an hour ago

I assume diff edits are not working due to aider using "sane defaults", as I can't think of anything else on my end that would be causing this difference in behavior with edits (local ollama instance refuses diff edits, while openrouters works correctly and changes files with aiders' diff edit feature.)

Version and model info

$ aider --version
aider 0.63.0
ollama/qwen2.5-coder-32b-instruct:latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions