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

Setup guide - Documented by Aider

Use Ollama in Aider

Aider connects to Ollama natively: set OLLAMA_API_BASE to the local server and run aider --model ollama_chat/<model>.

Last verified 6 steps3 official sources

Steps

  1. Step 1.

    Configure your Ollama API endpoint (Mac/Linux).

    Terminal
    export OLLAMA_API_BASE=http://127.0.0.1:11434 # Mac/Linux
  2. Step 2.

    Windows (restart shell after setx).

    Terminal
    setx   OLLAMA_API_BASE http://127.0.0.1:11434 # Windows, restart shell after setx
  3. Step 3.

    Pull the model, start the Ollama server with a larger context window, and run aider from your project.

    Terminal
    # Pull the model
    ollama pull <model>
    
    # Start your ollama server, increasing the context window to 8k tokens
    OLLAMA_CONTEXT_LENGTH=8192 ollama serve
    
    # In another terminal window, change directory into your codebase
    cd /to/your/project
    
    aider --model ollama_chat/<model>
  4. Step 4.

    Example with a current Ollama model id.

    Terminal
    aider --model ollama_chat/qwen3.5
  5. Step 5.

    If your Ollama requires an API key.

    Terminal
    export OLLAMA_API_KEY=<api-key> # Mac/Linux
  6. Step 6.

    Optional fixed context window via .aider.model.settings.yml.

    YAML
    - name: ollama/qwen2.5-coder:32b-instruct-fp16
      extra_params:
        num_ctx: 65536

Caveats

  • Ollama's docs have no Aider page; steps come from Aider's docs, which use a <model> placeholder. The qwen3.5 example id comes from Ollama's integration docs and is combined here.
  • Aider recommends the ollama_chat/ prefix over ollama/.
  • Aider's page says Ollama uses a 2k context window by default, but Ollama's current docs say the default depends on VRAM (4k under 24 GiB, 32k at 24-48 GiB, 256k at 48 GiB or more). Aider sizes num_ctx per request by default anyway.
  • Aider prints model warnings for models it does not know.

FAQ

How do I use Ollama in Aider?

Aider connects to Ollama natively: set OLLAMA_API_BASE to the local server and run aider --model ollama_chat/<model>.

Which Ollama model ids work in Aider?

The official docs read for this guide list qwen3.5 and qwen2.5-coder:32b-instruct-fp16. Requests go to http://127.0.0.1:11434.

Is this an official Ollama and Aider setup?

Aider documents this setup in its own docs. It was last checked against 3 official pages on October 17, 2026.

Sources

Last verified against 3 official pages.

Newsletter

New models, set up the day they ship

One email per week. New model releases, the coding tools that support them and how to wire them up.