ᛉzerwiz

Running local models on your own GPU: what actually matters

I run AI models on a 16 GB laptop GPU every day. What mattered most was not model size but the context window — and settings that fail silently.

Running an AI model on your own machine is no longer a hobby project. With a decent GPU and llama.cpp you can serve models that write code, summarise meetings and answer questions — privately, offline, and with no bill at the end of the month.

I run local models every day on a laptop with a 16 GB GPU, behind the agents I work with. Here is what I wish I had known at the start. Most of it is not about which model to pick.

Start with llama.cpp, built for your card

There are friendly front-ends like Ollama, and they are a fine first step. But when you want control, go to the engine underneath: llama.cpp. Build it from source with your GPU’s backend switched on (CUDA for NVIDIA), and you get its server, llama-server, which speaks the same API as the big cloud providers. Almost every coding agent can point at it.

Models come as GGUF files, in many quantisations — the same model squeezed to different sizes. Lower bits mean a smaller file and less memory, at some cost in quality. For most work, a 4-bit quantisation of a good model beats an 8-bit quantisation of a smaller one.

The context window owns your memory

This is the lesson that surprised me most.

People size models by their parameter count: a 9-billion-parameter model is “small”, a 35-billion one is “big”. So you would expect the small one to always fit where the big one does.

It does not. On my machine, one 9B model used about 5 GB of GPU memory with an 8,000-token context window. Raised to a 131,000-token window, the same model used about 14 GB — more than a 35B mixture-of-experts model I run at a 262,000-token window with a compressed cache. The weights did not change at all. The context window — and the cache the model keeps for it — took the memory.

So the real question is not “how big is the model?” but “how big a window do I give it, and how is its cache stored?” Two settings carry most of the weight:

  • ctx-size — how many tokens of context the model can hold. Give each job the window it needs, not the biggest one the model supports.
  • KV cache type — the cache can be stored compressed (for example as q8_0), which roughly halves its size for a small cost.

A summariser that reads one meeting at a time does not need a quarter-million tokens. Mine had been handed a large model with a 262,000-token window. Moving it to a 9B model with a 32,000-token window cut its memory by 58 % and made it 2.4 times faster — and the summaries came out longer, not worse.

Some settings fail silently

The second lesson: some mistakes do not crash. They just quietly return nothing.

Many new models “reason” before they answer — they write out their thinking first. That is useful in a chat. But in an automated job with a limit on output length, a reasoning model can spend the whole limit thinking and return an empty answer. The request still succeeds. The server says everything is fine. You get a blank summary.

The fix is one setting — turn reasoning off for jobs that do not need it — but you only find it if you check the answers, not just the status codes. My rule now: every new model, every new setting, is tested on a real task and the output is read.

One router, one model at a time

A 16 GB card holds one serious model at a time. Rather than juggling servers by hand, I run llama.cpp in router mode: one server holds a list of model presets, loads the one a request asks for, and unloads the previous one. A model that sits idle is put to sleep, so the GPU is free for other work.

Each preset carries its own settings — window, cache type, how many layers live on the GPU — so the right settings travel with the model instead of living in my head. And because the whole house talks to one address with one key, every agent on every machine I own can use the same models.

Measure, and write it down

Finally: benchmark honestly, and keep the numbers. Speed of reading the prompt and speed of writing the answer are different things, and both change with the window. When a first measurement turns out wrong, I add a correction next to it rather than erasing it — the history of what I believed is part of what I learned.

Is it worth it?

For me, yes. Local models do not replace the best cloud models for the hardest problems. But for the steady stream of everyday jobs — summaries, first drafts, classification, many coding tasks — they are private, fast, and free to run once the hardware is paid for.

If you want to start from nothing, I am planning a course for exactly that: local AI from zero, on the computer you already have.

All postsTalk about it on Discord