How to — run a local LLM

Share
How to — run a local LLM

You want a model answering questions on the machine in front of you — no API key, no per-token bill, no prompt leaving the room. It is an afternoon's work, provided you size the machine before you download anything and know which two numbers decide whether it is usable.

Here is the order that keeps the afternoon from turning into three weekends.

1. Start from the memory number, not the model name.

Every open-weight model now ships as one file whose size is roughly parameters × bits per weight ÷ 8. A 7-billion-parameter model at 16 bits is about 14 GB; the same model at four bits is about 4 GB. That single piece of arithmetic is what created this whole category. OpenAI's open-weight gpt-oss-120b holds 117 billion parameters with 5.1 billion active at a time, is post-trained at four-ish bits, and the model card states plainly that it fits a single 80 GB GPU while the 21-billion-parameter sibling runs inside 16 GB of memory. Sixty-two gigabytes of weights in an 80 GB card leaves the rest for the conversation — and that gap is the whole design.

So the first thing you read on any model page is the file size, not the benchmark table. If the file does not fit in your memory with room to spare, nothing else about it matters.

2. Reserve a quarter of your memory for everything that isn't the model.

The file is a floor, not the requirement. Past it you need the KV cache — the per-conversation state that grows with every token of context — plus the operating system, the desktop, and whatever else is running. On a Mac with unified memory that pool is shared with everything, so the model does not get the whole number. On a discrete GPU it is the card's VRAM, and it does not share.

Budget 75 to 80 percent of the figure you actually have and treat the rest as untouchable. Someone running a 30 GB file on a 32 GB machine is not running a 30 GB model; they are running a 30 GB model until the conversation gets long, then swapping to disk and wondering why it went quiet.

3. Choose the compression level before you choose the model.

Most local files come named for their precision — Q4, Q5, Q6, Q8, with a suffix describing how cleverly the bits were spent. Q4_K_M is where most people should stop: four bits per weight, with the layers that matter most keeping a few extra. The llama.cpp quantisation guide names the ladder and the small / medium / large variants of each step.

Going up to Q5 or Q6 buys back a little quality for noticeably more memory; dropping to Q3 or Q2 buys memory and starts costing you instruction-following. The rule that saves the most time: if Q4 does not fit, you want a smaller model, not a lower quant. A badly compressed model is not a cheaper model, it is one you cannot trust on the task you built the machine for — AI 101 — What is quantization? covers what actually gets lost.

4. Pick the runner by how you will use it, not by its benchmark.

There are two shapes. A desktop chat app — LM Studio if you want to see what you are doing, Ollama if you want something else on your machine to call it — gets you talking to a model in ten minutes. A local server that speaks the familiar cloud API shape is what you want if this is going into code, because then you swap one address and the rest of your app does not change.

Underneath, both are front ends over the same inference engines, so the model file is the same file and the speed difference between them is mostly settings, not software. Do not spend the afternoon comparing runners. Spend it finding the model that fits.

5. Measure how fast it reads, not just how fast it writes.

Two numbers matter and only one gets quoted. Generation speed — tokens out per second — is what you feel in a chat window, and it is usually fine: 20 to 30 tokens per second is faster than you read. Prompt processing speed is how fast the model ingests what you gave it, and that is what decides whether local is usable for actual work.

Our read of the M5 Ultra reviews landed on exactly this: local AI's ceiling is memory, not compute, and the number that separated the machines was how quickly they read the prompt. A model that feels instant on a two-line question can take minutes on a forty-page document. Test with your longest real input, first, before you conclude anything.

6. Cap the context window on purpose.

Runners default to something generous — often far more than your memory can hold at speed. Every token of context costs cache, and on a mixture-of-experts model, which keeps far fewer weights active than it stores, the cache can be the largest thing in the room once a conversation fills. Set the window to what the task needs: modest for chat and summarising, large only when you are feeding it code or long documents.

Watch memory as a long conversation grows. If it slows down the longer you talk, that is the cache filling, not the model getting tired, and the fix is a smaller window — not a smaller model.

Don't do this: don't treat the download size as the requirement. The failure mode is identical every time — the file fits, the first answer is great, and then the fourth long question pushes the machine into swap and everything grinds. Size for the model plus its cache at the context length you actually intend to use, and if that means dropping a tier of model, drop a tier of model. The machine you can leave running all day beats the one you have to restart.

How you'll know it worked. Pull the network cable out and ask it the thing you actually wanted it for. If it answers at the length you actually work at, at a speed you would tolerate, with nothing plugged in — it worked. Write down the two numbers (tokens per second out, seconds to first token on a long prompt) and the file name you settled on. That is your baseline, and the next model you try has something honest to beat. And if it is merely as good as the cloud version on your job, that is not a failure — that is the point.

What did you end up running locally, and what made you give up on it? Write to us via our contact page.

Get SiliconNoon in your inbox

One email a day with the AI stories that matter — what happened, the numbers, and why it matters. No spam, unsubscribe in one click.

Read more

How to — stop an agent before it burns your budget

How to — stop an agent before it burns your budget

An agent that runs unattended fails in a way a chat window never does: it fails expensively. The job here is to make the worst case of any run a number you know before you press go — and to have the run stop itself the moment it stops making progress. Most teams discover this the hard way. A task that should take twelve steps takes four hundred, half of them re-asking the same question in slightly different words, and the invoice arrives two days after the incident.

How to — tell if an AI model has quietly changed

How to — tell if an AI model has quietly changed

The model you call today is not necessarily the model you tested. Providers update the served system in place — a fine-tune, a new safety classifier, a rewritten system prompt, a different route — and your request still returns 200 with a perfectly normal-looking answer. You can catch that on your own inputs, in about an afternoon of setup and a few minutes a week, so a provider update shows up as a dated event in your logs instead of a support ticket three weeks later. The change is not…

How to — review AI-written code before you merge it

How to — review AI-written code before you merge it

You want to merge AI-written code without reading every line of it — and still be able to say, out loud, what it does and what happens when it breaks. That is a review job, and it is mostly about reading the right parts in the right order. Cockroach Labs ran its codebase like a teaching hospital for five months and reports merging well over a million lines of code with seven total reverts — a run where no agent's plan moved without a human-signed review first (we covered Coding agents as a…

How to — estimate what an AI feature will cost before you ship it

How to — estimate what an AI feature will cost before you ship it

You want one number you can defend in a planning meeting: what each completed job on your feature costs, and what a month of it costs at launch volume. This is a measurement job, not a guess — a morning with your real prompts beats any pricing page. 1. Run 20 real requests and keep the usage numbers. Not demo prompts — your actual system prompt, tool definitions, the documents you stuff into context, and a typical user message.