Why is my local AI model so slow?

A slow local model is almost always a memory problem in disguise. Here's how to find the cause and fix it.

If your local model takes ages to answer, the cause is usually one of a handful of things, and most of them come back to memory. Work through these in order.

1. The model doesn't fit in fast memory

The most common cause. If a model is too big for your graphics memory (or, on a Mac, for the memory available to the GPU), part of it runs from slower memory or on the processor. In Ollama, run ollama ps: the PROCESSOR column should say 100% GPU. A split such as 48%/52% CPU/GPU means part of the model is in system memory, and responses will be slower. Fix: use a smaller model or a more compressed version of it.

2. The context is too long

Longer context (more of your project and conversation) uses more memory. Ollama sets its default context length based on your graphics memory. Coding tools benefit from at least 64,000 tokens, but if that pushes the model out of fast memory, everything slows down. Fix: lower the context length, or compress the context cache: Ollama's OLLAMA_KV_CACHE_TYPE=q8_0 setting uses roughly half the memory (it needs Flash Attention, which Ollama turns on automatically where supported).

3. Too many models loaded at once

Ollama can keep several models loaded at the same time. On a machine with limited memory, two models compete and both slow down. Fix: unload what you're not using with ollama stop <model>, and close other memory-hungry apps.

4. The first answer includes loading time

The first request loads the model into memory, which takes a while. Ollama keeps models loaded for five minutes by default, so later answers are faster. Fix: keep the model loaded longer with the OLLAMA_KEEP_ALIVE setting, if you have the memory to spare.

5. The quantisation is heavier than you need

Less-compressed versions are slower. In llama.cpp's own measurements on an 8B model, the common 4-bit version ran at about 72 tokens a second, 8-bit at about 51 and full 16-bit at about 29. Fix: use a 4-bit version unless you need the extra precision.

6. On a Mac with MLX: the memory limit

mlx-lm warns when a model is large relative to your Mac's memory, and says such models can be slow. If the model does fit in your total memory, the MLX documentation describes raising the GPU's memory limit with sudo sysctl iogpu.wired_limit_mb=N (macOS 15 or later). Fix: use a smaller model, or raise the limit carefully, below your total memory.

7. Your hardware's memory bandwidth

Even when everything fits, how fast the model writes its answer is limited by memory bandwidth. Apple's base M5 chip has 153 GB/s; the M5 Max up to 614 GB/s. A big model will always be slower on a machine with less bandwidth. Fix: choose a model sized for your machine; mixture-of-experts models such as gpt-oss-20b, which activate only part of the model per token, are often faster for their size. See what computer you need.

Still slow?

Local models trade speed and capability for privacy and zero usage cost. For a hard task that a large model handles slowly, a cloud agent may simply be the better tool. In Nexus, a native Mac app for building with AI, you can switch between a local model and Claude Code by Anthropic or the Codex app by OpenAI in the same chat, so you can keep routine work on your Mac and send heavy jobs to the cloud, where Anthropic or OpenAI handle them. Nexus will be a one-time purchase of $199 USD, with no Nexus subscription. Connecting third-party AI services such as Claude Code or Codex is optional and at your own expense (see Nexus pricing). It's for Apple silicon Macs and is coming soon.

Frequently asked questions

Why is the first answer from my local model slow?

Loading the model into memory takes time on the first request. Ollama keeps a model loaded for five minutes by default, so follow-up answers are faster.

How do I check if Ollama is using my GPU?

Run ollama ps. The PROCESSOR column shows 100% GPU when the model is fully on your graphics hardware, or a CPU/GPU split when part of it has spilled into slower system memory.