If Ollama runs a model partly on the CPU, it gets slow. Check the instructions for your exact model before choosing this setting or amount. It suits anyone running local models on a single GPU.
YouTube video: Ollama Running Slow? One Setting Made It 5x Faster (RTX 5090)
YouTube’s video details do not confirm captions. Check CC in the player for available tracks.
Choose a chapter (11)
- Video length
- 3 min 43 s
- Time to do it
- 10 minutes
- Difficulty
- Easy
- Steps
- 8
What you need
Steps
Check the instructions for your exact model before choosing this setting or amount.
In a second terminal, run ollama ps and look at the PROCESSOR column. It should say 100% GPU.
If it shows a CPU share, the context window is too large for your VRAM. Lower it.
For a quick test, type /set parameter num_ctx 32768 inside the running ollama session.
Run ollama ps again and confirm PROCESSOR now says 100% GPU.
To keep the setting, run setx OLLAMA_CONTEXT_LENGTH 32768 on Windows.
On Linux or macOS, run export OLLAMA_CONTEXT_LENGTH=32768 instead.
Quit Ollama from the tray and start it again so the new value applies.
Tips and common mistakes
A smaller context window means the model forgets older chat text sooner, so raise it only if you have spare VRAM.
Your tokens per second will differ by GPU and model, so compare your own before and after numbers.
The 140 tok/s result came from the context fix alone, not from a different engine.
Questions
What does 100% GPU in ollama ps mean?
It means the whole model is loaded in VRAM and the CPU is not handling part of it. That is the fast state you want.
Does lowering num_ctx reduce model quality?
No, the weights stay the same. You only shorten how much conversation history the model can hold at once.
Do I need to set this every time?
No. The /set command lasts for the session, while the OLLAMA_CONTEXT_LENGTH variable keeps the value after a restart.
The notes are drafted automatically from video details and general task knowledge. How the guide was prepared
Report a correction


