Running Ollama Locally: VRAM, Quantization, and Why Your 7B Model Is Slow
I put Ollama on a 32 GB laptop with an RTX 4060 expecting a local ChatGPT. The first question took about 30 seconds to produce a token and I nearly gave up. It turned out nothing was broken; I had simply picked the wrong model size and never looked at what the quant name meant.
Install it, then forget the service
Download Ollama from ollama.com for Windows, macOS, or Linux. On Linux:
curl -fsSL https://ollama.com/install.sh | sh
On Windows the installer puts a tray app in. You do not need to start a server yourself; ollama run handles it. Check with:
ollama --version
ollama list
The first time I ran it from WSL while the Windows app was also running, I got a port conflict. Pick one side and use it. I ended up using the Windows app and calling it from WSL through the forwarded port, which is more trouble than it is worth for most people.
Read the model name properly
ollama pull llama3.1:8b gives you a model with about 8 billion parameters. The default quantization is usually q4_k_m, which means the weights are stored at roughly 4 bits with a mixed layout. That is a compression choice, not a quality label.
Rough rule from my own machine, not a benchmark:
- 7B or 8B at q4: needs about 5 GB VRAM, runs fine on an 8 GB card.
- 13B at q4: needs about 8 to 9 GB, borderline on 8 GB cards.
- 30B at q4: needs 18 GB or more, do not try it on a laptop GPU.
If the model does not fit, Ollama quietly uses CPU and RAM. That is when you get the 30-second first token. It is not a bug in Ollama; you are asking a 7B model to run through system memory while your GPU sits partly idle.
Run ollama ps while a model is loaded. It shows whether the model is on GPU or CPU. That single command answered most of my questions.
Pick a model for the job
For general chat on a laptop I use qwen2.5:7b or llama3.1:8b. For code, codellama:7b is okay but qwen2.5-coder:7b was noticeably better for the kind of Python and JavaScript I write. For anything requiring long context, I stop using a local model and call a hosted API. Local is good for privacy and cost, not for everything.
Pull a specific quantization like this:
ollama pull qwen2.5:7b-instruct-q4_k_m
The instruct part matters. A base model will happily continue your text instead of answering it. That confused me for a full afternoon.
Fix the speed problem before tweaking settings
Things that made a real difference on my machine:
1. Use a smaller model. This was worth more than any flag.
2. Close Chrome. It was holding 3 GB of VRAM with a dozen tabs.
3. Set OLLAMA_NUM_PARALLEL=1 so one request gets the whole context.
4. Keep the model loaded with ollama run in a terminal instead of starting cold each time.
Things that did not help: changing the number of GPU layers on a model that already fit, and every "performance tweak" blog post that recommends editing config files I do not understand. Start with model size.
When to stop using Ollama
If you need a model that follows complex instructions reliably, or you need 128k context, local 7B models are not going to do it. I use Ollama for drafting, summarising notes, and anything I would rather not send to a cloud service. For final answers on important work I still use a hosted model.
That split has been more useful than any single model choice. Local AI is a tool with a clear lane, not a replacement for everything.