Skip to content
Back to skills

1633 Ollama 22770bc8

ASecurity

Aider can connect to local Ollama models. First, install aider: {% include install.md %} Then configure your Ollama API endpoint (usually the default): ```bash export OLLAMA_API_BASE=http://127.0.0.1:11434 # Mac/Linux setx OLLAMA_API_BASE http://127.0.0.1:11434 # Windows, restart shell after setx ``` Start working with aider and Ollama on your codebase: ``` ollama pull <model> OLLAMA_CONTEXT_LENGTH=8192 ollama serve cd /to/your/project aider --model ollama_chat/<model> ``` {: .note } Using ...

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
devopsshellbashgitapi

Works with

  • terminal
  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 1633-ollama_22770bc8 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 1633 Ollama 22770bc8?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 1633 Ollama 22770bc8
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-1633-ollama-22770bc8/badge)](https://www.skillsdirectory.com/skills/tools-only-1633-ollama-22770bc8)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
parent: Connecting to LLMs
nav_order: 500
---

# Ollama

Aider can connect to local Ollama models.

First, install aider:

{% include install.md %}

Then configure your Ollama API endpoint (usually the default):

```bash
export OLLAMA_API_BASE=http://127.0.0.1:11434 # Mac/Linux
setx   OLLAMA_API_BASE http://127.0.0.1:11434 # Windows, restart shell after setx
```

Start working with aider and Ollama on your codebase:

```
# 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>
```

{: .note }
Using `ollama_chat/` is recommended over `ollama/`.


See the [model warnings](warnings.html)
section for information on warnings which will occur
when working with models that aider is not familiar with.

## API Key

If you are using an ollama that requires an API key you can set `OLLAMA_API_KEY`:

```
export OLLAMA_API_KEY=<api-key> # Mac/Linux
setx   OLLAMA_API_KEY <api-key> # Windows, restart shell after setx
```

## Setting the context window size

[Ollama uses a 2k context window by default](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-specify-the-context-window-size),
which is very small for working with aider.
It also **silently** discards context that exceeds the window. 
This is especially dangerous because many users don't even realize that most of their data
is being discarded by Ollama.
 
By default, aider sets Ollama's context window 
to be large enough for each request you send plus 8k tokens for the reply.
This ensures data isn't silently discarded by Ollama.

If you'd like you can configure a fixed sized context window instead
with an
[`.aider.model.settings.yml` file](https://aider.chat/docs/config/adv-model-settings.html#model-settings)
like this:

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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…