Aider + Local Models: Which GPU or Unified Memory for Pair Programming

By LLM Hardware team · Methodology ·

Key facts

Tool
Terminal pair programmer. Ollama and LM Studio are backends.
7B vs 32B
6.2 GB for small edits. 21.2 GB for repo-scale Q4.
Q8 32B
40.4 GB. Not a toggle on a 24 GB card.
Checked
2026-10-13

Checked 2026-10-13. Author: LLM Hardware team. Amazon prices are not stored or shown on this site.

Citeable facts

Key fact: Aider is a terminal pair programmer with git. Its docs describe Ollama and other local backends.

How we got it: aider.chat and aider.chat/docs/llms/ollama.html. Confirm the provider page still matches your Aider version before you copy a flag.

Checked:

Key fact: Small edits can sit on a 7B Q4 (about 6.2 GB). Repo-scale edits want a 27–32B Q4 (about 18–21 GB).

How we got it: VRAM formula. This is a fit guide, not a SWE-bench score.

Checked:

Key fact: Aider does not include a GPU. The model server does.

How we got it: Aider is the client. Ollama or LM Studio holds the weights.

Checked:

Key fact: On a 24 GB GPU about 10,700 tokens of f16 KV cache fit beside Qwen3-32B at Q4, and about 37,600 beside Qwen3-30B-A3B at Q4.

How we got it: (24 - 21.2) GB / 262,144 bytes per token and (24 - 20.3) GB / 98,304 bytes per token. Layer and KV-head counts from the site KV cache guide; cache added on top of the formula result.

Checked:

Key fact: On a 16 GB RTX 5070 Ti, qwen3:14b at Q4 leaves room for about 31,200 tokens of f16 KV cache.

How we got it: 14.8B (model card) x 0.5 x 1.2 + 2 = 10.9 GB. (16 - 10.88) GB / 163,840 bytes per token (40 layers, 8 KV heads, head_dim 128, config.json). Rounded down.

Checked:

Key fact: Generation on qwen3:14b cannot exceed about 96 tokens per second on an RTX 5070 Ti, 100 on an RTX 3090 or 49 on a Mac Studio M5 Max 36 GB. These are bandwidth ceilings, not speeds.

How we got it: Vendor memory bandwidth (NVIDIA 896 GB/s; NVIDIA GA102 whitepaper 936 GB/s; Apple 460GB/s) divided by the 9.3GB qwen3:14b file listed by Ollama, because each generated token reads every weight once. Real speed is lower.

Checked:

Key fact: Aider's repo map defaults to 1k tokens and is doubled when no files are in the chat.

How we got it: aider.chat/docs/repomap.html (--map-tokens default) and aider.chat/docs/config/options.html (--map-multiplier-no-files, default 2). Read 2026-10-30.

Checked:

Methodology explains the VRAM formula, the bytes per weight at each quantization, and the full source list.

Aider is an open-source pair programmer that lives in the terminal and talks to git. You point it at a model. The model can be a hosted API or a local server. The Ollama notes are at aider.chat/docs/llms/ollama.html. LM Studio’s local server is the other common endpoint, because it speaks an OpenAI-compatible API. Aider is not an IDE fork and it is not a cloud VM. If you wanted Cursor’s remote computer, that is a different product. This page is what has to fit in memory when the model is yours.

Pick the model before the GPU

Aider’s quality is the model’s quality. The git workflow will not rescue a 7B that mis-edits three files. Use K2-Horizon-7B when the change is “rename this function and fix the call sites in one file.” Use Qwen3.8-27B or K2-Horizon-32B when the change crosses a module. Muse Glimmer is an option if you also want an agent model Meta trained for tool use; it is 30B, not a free upgrade in memory. The coding model guide is the qualitative companion.

Keep the map of files you add to the chat small. Aider’s repo map is a context decision. Context is KV cache. KV cache is why a model that “fits” at a short prompt falls off the card halfway through a refactor. The calculator slider is the right tool for that, not a guess.

First run: install, pull, start

These steps are from Aider's Ollama page, read on 30 October 2026, with concrete Ollama tags in place of its placeholder. Pick the tag for your memory from the tables below: qwen3:14b on a 16 GB card, qwen3:30b (Qwen3-30B-A3B) on a 24 GB card, qwen3:32b on a 36 GB Mac. Install Aider, pull the model and start Ollama with a larger window:

python -m pip install aider-install
aider-install

ollama pull qwen3:14b
OLLAMA_CONTEXT_LENGTH=8192 ollama serve

In a second terminal, point Aider at the Ollama server and start it in your repository. These are the Mac and Linux lines from Aider's page; on Windows it uses setx and a new shell.

export OLLAMA_API_BASE=http://127.0.0.1:11434
cd /to/your/project
aider --model ollama_chat/qwen3:14b

By default Aider sizes the context window to fit each request. To cap it at what your card holds, add this to .aider.model.settings.yml in your home directory or at the root of the repository. aider/extra_params is Aider's documented name for settings that apply to every model, and num_ctx is the setting its Ollama page uses for a fixed window.

- name: aider/extra_params
  extra_params:
    num_ctx: 24576

24,576 tokens of qwen3:14b cache are 4.0 GB at f16, 14.9 GB in all with the weights, which leaves 1.1 GB on a 16 GB card. For other cards, take the figure from the context table below and stay under it.

Fit table

You have Run this in Aider Q4 formula
8 GB K2-Horizon-7B, short chats 6.2 GB. Leave the rest for the cache.
12 to 16 GB qwen3:14b. On a 16 GB card it leaves 5.1 GB, room for about 31,200 tokens of f16 cache; on 12 GB, 1.1 GB and about 6,800 tokens. 16 GB is still not a 27B card. Qwen3-14B (14.8B on its card) is 10.9 GB. 27B Q4 is 18.2 GB and does not fit.
24 GB Qwen3.8-27B. K2-32B if you keep context modest. 18.2 GB and 21.2 GB.
36 GB unified 32B with a longer map, or Glimmer plus a bit of cache The headroom is the point of the extra 12 GB.

Q8 roughly doubles the weight term: a 32B at Q8 is 32 × 1.2 + 2 = 40.4 GB. That is a 48 GB-and-up decision, not a “quality mode” toggle on a 24 GB card. Quantization explains why Q4 is the default.

Worked example: how much repo context fits

Aider decides how much text the model sees. Its Ollama page says Aider sizes the context window to fit each request plus 8k tokens for the reply, and warns that Ollama silently discards context that exceeds the window. So the hardware question is not only whether the weights fit. It is how many tokens of cache fit beside them, because every file and repo map you add is tokens.

The arithmetic: take the memory you have, subtract the model's formula result, and divide what is left by the model's KV cache per token. At f16, Qwen3-32B needs 262,144 bytes per token (64 layers, 8 KV heads, head size 128) and Qwen3-30B-A3B needs 98,304 bytes (48 layers, 4 KV heads), from the counts on our KV cache guide. A q8_0 cache holds about twice as many tokens.

Machine Model at Q4 (formula) Memory left Fits at f16 cache Fits at q8_0 cache
24 GB GPU (RTX 3090, RTX 4090, RX 7900 XTX) Qwen3-32B (21.2 GB) 2.8 GB about 10,700 tokens about 21,400 tokens
24 GB GPU Qwen3-30B-A3B (20.3 GB) 3.7 GB about 37,600 tokens about 75,300 tokens
RTX 5090 32 GB Qwen3-32B (21.2 GB) 10.8 GB about 41,200 tokens about 82,400 tokens
Mac Studio M5 Max 36 GB (about 32 GB usable after a 4 GB macOS reserve) Qwen3-32B (21.2 GB) 10.8 GB about 41,200 tokens about 82,400 tokens
Mac mini M5 Pro 24 GB (about 20 GB usable) Qwen3-30B-A3B (20.3 GB) none does not fit does not fit
16 GB GPU (RTX 5070 Ti, RTX 5060 Ti, RTX 4080) Qwen3-30B-A3B or Qwen3-32B none does not fit does not fit
16 GB GPU (RTX 5070 Ti) Qwen3-14B (10.9 GB) 5.1 GB about 31,200 tokens about 62,500 tokens

The cache is counted on top of the formula result, as our KV cache guide does, so these token counts are on the cautious side. A figure above the model's own context limit does not help; check the limit on the model card. Qwen3-14B's card gives a 32,768-token native window, so on 16 GB the q8_0 column buys headroom, not a longer window.

What the table says: on a 24 GB card the dense 32B leaves room for about 10,700 tokens of f16 cache, which a few large files and a repo map can use up. Qwen3-30B-A3B is a mixture-of-experts model with 30.5B total parameters, so its weights cost almost the same memory, but its cache per token is under 40 percent of the 32B's. The same card holds about 3.5 times the context. If repo-scale edits are the job and the card is 24 GB, that difference matters more than the 0.9 GB gap in weights.

Setup from Aider's Ollama page: set OLLAMA_API_BASE to the local Ollama server (127.0.0.1, default port 11434), start the server with a context length (the page shows OLLAMA_CONTEXT_LENGTH=8192 ollama serve), then run aider --model ollama_chat/<model>. To cap the window instead of letting it grow, Aider reads a fixed num_ctx from extra_params in .aider.model.settings.yml. Set it at or below the figure for your machine in the table, and keep the files you add to the chat small, because anything past the cap is dropped. Ollama's own FAQ gives 4,096 tokens as its default window. To use the q8_0 column, turn on KV cache quantization as described in our KV cache guide.

Speed ceiling and repo-map size

Speed: an upper bound from memory bandwidth

This site does not run models and publishes no speed of its own. What it can give is a ceiling. Generating one token reads every weight once, so tokens per second cannot exceed memory bandwidth divided by the size of the model file. Real generation is slower, and the ceiling says nothing about how long Aider waits while a long prompt and repo map are read in.

Machine Memory bandwidth (vendor) Ceiling for qwen3:14b (9.3GB file in Ollama's library)
RTX 5070 Ti 16 GB 896 GB/s (NVIDIA) at most about 96 tokens per second
RTX 3090 24 GB 936 GB/s (NVIDIA GA102 whitepaper) at most about 100 tokens per second
Mac Studio M5 Max 36 GB 460 GB/s (Apple) at most about 49 tokens per second

Method: 896 / 9.3 = 96, 936 / 9.3 = 100, 460 / 9.3 = 49, rounded down. A larger model lowers the ceiling in proportion to its file size: qwen3:32b is listed at 20GB, about half the ceiling of qwen3:14b on the same machine.

Repo map: start at the default

Aider's repo map defaults to 1k tokens (--map-tokens), and Aider doubles it when no files are in the chat (--map-multiplier-no-files, default 2). Its repo-map page adds that the map can expand well past that at times, especially when no files have been added. On a 16 GB card with num_ctx at 24,576, start at the default, add only the files you are changing, and lower the map with --map-tokens 512 if the window fills. On 24 GB with qwen3:30b, or on the 36 GB Mac Studio with qwen3:32b, the default leaves most of the window for files.

What to put under it

For the 14B step, the RTX 5070 Ti 16 GB runs qwen3:14b with room for about 31,200 tokens of cache. For the 27B to 32B step only 24 GB and up works: the RTX 3090 holds qwen3:30b with about 37,600 tokens of f16 cache, per the table above. That listing is the Founders Edition of an Ampere-generation card, so check the seller and condition on the listing. The RTX 4090 this page linked before was listed as unavailable at our last catalog check, so it has no link here. On a Mac, the Mac Studio M5 Max 36 GB is the daily-driver fit, with qwen3:32b and about 10 GB left for context, and the Mac mini M5 Pro 24 GB is the tight 27B machine. Aider itself is a pip install; memory is what to pay for.

RTX 3090 Founders Edition 24 GB on Amazon

ASIN B08HR6ZBYJ. Amazon Associates link. The live price is on that page, not locked in here.

Mac Studio M5 Max 36 GB on Amazon

ASIN B0HGKSQMX6. Amazon Associates link. The live price is on that page, not locked in here.

Mac mini M5 Pro 24 GB on Amazon

ASIN B0HGGHNQY6. Amazon Associates link. The live price is on that page, not locked in here.

Sources

Questions

Which Ollama tag should I use with Aider on a 16 GB card?

qwen3:14b. Qwen3-14B has 14.8B parameters, so at Q4 it is about 10.9 GB by our formula, which leaves room for about 31,200 tokens of f16 cache on 16 GB. The 27B and 32B models do not fit 16 GB.

How fast will Aider be with a local model?

This site gives a ceiling, not a speed: memory bandwidth divided by the size of the model file. For qwen3:14b, listed at 9.3GB by Ollama, that is at most about 96 tokens per second on an RTX 5070 Ti, 100 on an RTX 3090 and 49 on a Mac Studio M5 Max 36 GB. Real generation is slower.

How big should the repo map be?

Start at Aider's default of 1k tokens. Aider doubles it when no files are in the chat and can expand it further, so on a 16 GB card add only the files you are changing and cap num_ctx in .aider.model.settings.yml.

A correction or a hardware question goes to the contact page.