Skip to content
,

Ollama Slow? How to Speed It Up (2026): Measure, Fix GPU Offload and Context

8–11 minutes
Woman in a living room holding a tablet with a SPEED UP card, hook Ollama slow fix it fast

Ollama feels slow: replies trickle out a word at a time, the first answer takes ages, or long prompts hang before anything appears. The good news is that almost every slow Ollama setup comes down to a handful of causes, and you can measure which one in under a minute.

This guide shows how to measure Ollama’s real speed, read the numbers, and fix each cause. It covers a model spilling onto the CPU, too much context, slow first loads, long prompts, thinking models, and network or laptop issues.

TL;DR

  • Measure: ollama run <model> --verbose, then read eval rate (tokens per second).
  • Check the GPU: ollama ps. Anything other than 100% GPU is the most common reason for slowness.
  • Fix a CPU spill: use a smaller model or quantization, lower num_ctx, set OLLAMA_KV_CACHE_TYPE=q8_0, and close other GPU apps.
  • Slow first reply: that’s model loading. Keep the model loaded with OLLAMA_KEEP_ALIVE.
  • Slow thinking models: turn thinking off when you don’t need it.

New to Ollama? My Ollama guide covers install, models, commands and fixes in one place.

Step 1: Measure the Speed

Don’t guess. Run the model with --verbose and ask something:

ollama run llama3.1 --verbose
>>> Explain what a GPU does in three sentences.

After the answer, Ollama prints timing stats:

Line What it means
load duration Time to load the model into memory. Large on the first run, near zero once it is loaded.
prompt eval rate How fast your prompt (and chat history) was read, in tokens per second.
eval rate How fast the answer was written, in tokens per second. This is the “speed” you feel.
total duration Everything together.

As a rough feel, comfortable reading speed is somewhere around 5-10 tokens per second. A small or mid model fully on a modern GPU is usually well above that.

If your eval rate is in low single digits on a model that should fit your GPU, something is wrong, and the next step usually shows what.

Through the API, the same numbers come back in every final response as eval_count and eval_duration (in nanoseconds). Tokens per second = eval_count / eval_duration * 1e9. See my Ollama API guide.

Step 2: Is the Model Fully on the GPU?

While the model is still loaded, run:

ollama ps

Look at the PROCESSOR column. Ollama’s FAQ explains it:

  • 100% GPU: the whole model is in VRAM. Good.
  • 100% CPU: the model is in system RAM and runs on the CPU. Slow.
  • 48%/52% CPU/GPU (or similar): split between both. The CPU part drags the whole thing down, often to a fraction of full GPU speed.

A split is the number one cause of “Ollama is slow”. Even 10-20% on the CPU can cut the speed a lot, because every token has to pass through the slow part.

Fix: Model Spills Onto the CPU

The model plus its context doesn’t fit in your VRAM. In order of impact:

  1. Use a smaller quantization. A Q4_K_M file is roughly half the size of Q8_0, with a small quality drop. Pull a different tag, for example qwen3:14b-q4_K_M instead of a q8 tag. Tag names vary by model; check the model’s page on ollama.com.
  2. Use a smaller model. A 14B model fully on the GPU is usually much faster, and often more useful, than a 32B model half on the CPU. See best Ollama models by VRAM.
  3. Lower the context (next section). The KV cache can take gigabytes.
  4. Quantize the KV cache: set OLLAMA_KV_CACHE_TYPE=q8_0. Ollama’s docs say this uses about half the memory of the default f16, usually with no noticeable quality loss. It needs Flash Attention, which Ollama enables automatically on supported hardware; OLLAMA_FLASH_ATTENTION=1 forces it on.
  5. Free VRAM. Close games, ComfyUI, browsers with hardware acceleration and other AI apps. Check usage with nvidia-smi.
  6. Add a second GPU if you have one: Ollama spreads models that don’t fit on one card. See Ollama multi-GPU.

After each change, run the model again and check ollama ps until it says 100% GPU.

Fix: Context Is Too Big

The context window (num_ctx) reserves memory for the KV cache. Newer Ollama versions choose a default context based on your VRAM, and some apps ask for very large contexts. A 64K or 128K context can need more memory than the model itself.

Check the context in use: newer versions show a CONTEXT column in ollama ps. To lower it:

# in an ollama run session
/set parameter num_ctx 8192

# for the whole server
OLLAMA_CONTEXT_LENGTH=8192

# per request in the API
"options": { "num_ctx": 8192 }

8K-16K is plenty for most chats. Use a bigger context only when you really paste long documents. Full details: Ollama context length.

Fix: Slow First Reply (Loading)

If the first message takes 10-60 seconds and later ones are quick, that is the model loading from disk into memory. Look at load duration in the verbose stats.

  • Keep it loaded: by default Ollama unloads a model after 5 minutes idle. Set OLLAMA_KEEP_ALIVE=30m, or -1 to keep it loaded until you stop Ollama. See Ollama keep alive.
  • Preload it before you need it: curl http://localhost:11434/api/generate -d '{"model":"llama3.1"}'
  • Use a fast SSD. Models on a hard drive or a slow USB disk load far slower. To move them, see move Ollama models to another drive.
  • Avoid model swapping: if two apps use two different models that can’t fit together, Ollama keeps unloading one to load the other. Use one model, or make sure both fit (see Ollama parallel requests).

Fix: Long Prompts Take Forever

If the answer streams fast but there is a long pause first, the time is going into reading the prompt: look at prompt eval rate and the prompt token count.

  • Long chat histories, big pasted documents, RAG results and huge system prompts all add tokens that must be processed before the first word.
  • Prompt reading is much faster on the GPU than on the CPU, so a CPU spill hurts this part badly too.
  • Trim what you send. Start a new chat for a new topic, send fewer RAG chunks, and shorten system prompts that agents and coding tools add.
  • Ollama reuses the cached start of a conversation when the next request begins the same way, so chats that only add new messages stay fast. Tools that change the early part of the prompt on every request lose that benefit.

Fix: Thinking Models Feel Slow

Reasoning models such as Qwen3, DeepSeek-R1 or gpt-oss write a long hidden “thinking” section before the answer. The eval rate can be fine while you still wait a long time, because hundreds of thinking tokens come first.

# ollama run: turn thinking off for this session
/set nothink

# or when starting
ollama run qwen3 --think=false

# API
"think": false

Some models (like gpt-oss) take a level instead of on/off: "think": "low". Details: Ollama thinking mode.

Fix: Ollama Isn’t Using the GPU at All

If ollama ps shows 100% CPU even for a small model, Ollama didn’t find your GPU:

  • Update the GPU driver and restart Ollama.
  • Check the server log for inference compute: it lists the GPUs Ollama found. If only CPU appears, the GPU wasn’t detected. See Ollama logs.
  • Make sure CUDA_VISIBLE_DEVICES isn’t set to -1 or a wrong ID.
  • On Linux after sleep, reload the NVIDIA driver: sudo rmmod nvidia_uvm && sudo modprobe nvidia_uvm.
  • In Docker, start the container with --gpus=all.

The full checklist is in Ollama not using GPU.

Other Causes (Laptops, Network, Parallel Requests)

Laptops on battery or with two GPUs

Laptops slow the GPU down on battery and in quiet or eco power modes. Plug in, and choose a performance power mode. On laptops with integrated and dedicated graphics, make sure the dedicated GPU is the one Ollama found (check the log).

Slow over the network

Text is tiny, so the network is rarely the bottleneck. If a remote client feels slow, check speed on the server itself with --verbose first. On WSL2 with Windows 10, Ollama’s FAQ suggests disabling “Large Send Offload” on the vEthernet (WSL) adapter. See access Ollama from another computer.

Several requests at once

If several apps or users share the server, requests wait in a queue or share the GPU. Each one then looks slow. See Ollama parallel requests.

Old Ollama version

New releases regularly bring faster kernels and better memory estimates. Update Ollama; your models are kept.

Is it Ollama or the model?

Very large models are slow on any home PC. If you need more speed than your hardware gives, compare runtimes in vLLM vs llama.cpp vs Ollama, or check GPU options in best GPU for local LLMs.

Quick Checklist

  1. ollama run model --verbose: note load duration, prompt eval rate and eval rate.
  2. ollama ps: is it 100% GPU?
  3. Not 100%? Smaller quant or model, lower num_ctx, OLLAMA_KV_CACHE_TYPE=q8_0, close GPU apps.
  4. Slow first reply? Raise OLLAMA_KEEP_ALIVE and keep models on an SSD.
  5. Long pause before text? Trim the prompt, history and RAG chunks.
  6. Reasoning model? Turn thinking off or down.
  7. 100% CPU? Fix GPU detection (driver, log, Docker flags).
  8. Update Ollama and your GPU driver.

FAQ

Why is Ollama slower than LM Studio for the same model?

Usually different settings: a bigger context, a different quantization file, or GPU offload. Match the quant and context first, then compare eval rates. See LM Studio vs Ollama.

Does more RAM make Ollama faster?

Only if the model currently doesn’t fit at all. RAM lets bigger models run on the CPU, but VRAM is what makes them fast.

Can I make Ollama use more CPU threads?

Ollama picks a thread count automatically, normally based on your physical cores. Adding threads rarely helps, because CPU speed is mostly limited by memory bandwidth. Getting the model onto the GPU makes a far bigger difference.

Why did it get slower after a long chat?

The chat history grows with every message, so there is more to read each time, and it may hit the context limit. Start a new chat, or use a model and context size that fit your VRAM.

Does Flash Attention make Ollama faster?

Mainly it saves memory as the context grows, which can keep a model fully on the GPU, and that is where the speed gain comes from. Current versions enable it automatically where supported.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Woman in a living room holding a tablet with a SPEED UP card, hook Ollama slow fix it fast