Write-up
Running a language model on your own computer
Most of what gets written about local AI skips the part you need first, which is working out what your machine can actually run before you download twenty gigabytes to find out. The arithmetic is simple and almost nobody explains it, so here it is, along with what each piece of jargon means and why it matters.
01
A model is a pile of numbers
If you have a gaming graphics card bought in the last few years, you can probably do this today. Start with what the thing actually is.
When people say a model was trained, what came out the other end is a very large file of numbers. Each number is called a parameter, or a weight. Running the model means taking your text, turning it into numbers, and multiplying it through all of them.
That's genuinely most of it. There's no database inside, no lookup table of facts, no code being executed. A 7-billion-parameter model is a file with seven billion numbers in it, and everything it appears to know is stored in what those numbers are.
So size is the first thing anyone asks about, and it is the right question.
02
What the number in the name means
A model called something-7B has roughly seven billion parameters. Something-70B has about seventy billion. Within one family, more parameters generally means a model that handles harder questions, follows longer instructions, and makes fewer things up.
Across families it is looser. A well-trained 14B from this year will beat a badly trained 30B from two years ago. Training data and method matter as much as size, so the number is a rough guide and not much more.
One small thing worth knowing: the name is usually rounded down. A model tagged 7B often holds 7.6 billion parameters, and a 35B can be 36. That matters when you are doing the arithmetic below and wondering why your answer is out by a gigabyte.
03
The only arithmetic you need
A parameter is a number, and a number takes up space depending on how precisely you store it. So file size = parameters × bytes per parameter.
Stored at full precision, each parameter takes 2 bytes. Seven billion parameters at 2 bytes each is 14 GB. That's your model, and it has to fit in your graphics card's memory, which is where the trouble starts.
VRAM is the memory on the card itself, separate from your system RAM. A 3060 has 12 GB. A 4070 has 12. A 4090 or 3090 has 24. If the model doesn't fit in VRAM it spills into system RAM and the speed drops off a cliff, from a comfortable reading pace to something you won't tolerate twice.
At 14 GB, that 7B model doesn't fit on most cards. This is where quantization comes in.
04
Quantization
Quantization stores each parameter in fewer bits. A number that took 16 bits can be stored in 8, or 5, or 4. The model gets smaller and slightly less precise, in the same way that a JPEG is smaller and slightly less precise than the original photograph.
You will see labels like Q8, Q5_K_M, Q4_K_M, Q3. The number is roughly the bits per weight. The letters describe how the compression is arranged internally, and K_M is a common balanced variant you can safely just accept.
Here is what happens to that same 7B model:
| Precision | Bits per weight | Roughly | Fits in |
|---|---|---|---|
| Full (FP16) | 16 | 14 GB | A 16 GB card or better |
| Q8 | 8 | 7.5 GB | 8 GB, tightly |
| Q5_K_M | 5.5 | 5.3 GB | 8 GB |
| Q4_K_M | 4.9 | 4.7 GB | 6 GB |
| Q3 | 3.9 | 3.8 GB | Most things |
The quality cost isn't linear. Going from 16 bits to 8 is nearly free, and you'll struggle to tell the outputs apart. Q4 costs a little and is where most people settle. Below Q4 the losses become obvious quickly, and they arrive faster on small models than large ones, because a small model has less redundancy to spare.
05
Which one to pick when two of them fit
This is the decision that actually matters, and there is a rule of thumb that holds up well. A larger model, quantized harder, usually beats a smaller model at higher precision.
If you have 8 GB, you can run a 7B at Q8 or a 13B at Q4. Both fit, and the 13B at Q4 will almost always give you better answers. Put your memory into parameters and stop at Q4.
Rough starting points by card. At 6 to 8 GB, a 7B or 8B at Q4, which is genuinely useful for summarising, drafting and chatting. At 12 GB, a 13B or 14B at Q4, a noticeable step up in reasoning. At 16 GB, the same with room for longer conversations. At 24 GB, a 32B at Q4, or a smaller model with a very long context.
06
What the file size does not tell you
Two things beyond the weights will eat your VRAM, and both catch people out.
The first is the context window, which is how much text the model can consider at once, measured in tokens. Roughly three quarters of a word each. As a conversation grows, the model keeps a working store of everything so far, called the KV cache, and that store lives in VRAM alongside the weights. Double the context and you roughly double it.
So a model that loads happily can run out of memory forty messages into a conversation. If you plan to feed it long documents, budget for the cache as well as the file.
The second is everything else using the card. Your desktop takes a few hundred megabytes. A browser with hardware acceleration takes more. If you run image generation on the same machine, that wants several gigabytes of its own and will fail in confusing ways if a language model got there first.
07
Mixture of experts
You will see models labelled something like 30B-A3B. The first number is the total parameter count, the second is how many are active for any given token.
These are mixture-of-experts models. Only a fraction of the network fires on each token, so they generate text at roughly the speed of the smaller number while drawing on the knowledge of the larger one.
The catch is that you still need VRAM for all of it. A 30B-A3B occupies a 30B model's worth of memory and runs at a 3B model's speed. The memory buys you speed, and knowing whether speed is what you were short of tells you whether that is a good trade.
08
Actually running one
The easiest starting point is Ollama. Install it from ollama.com, open a terminal, and type one line:
ollama run qwen2.5:7b
That downloads about 4.7 GB the first time and then drops you into a prompt where you
can type at it. There's no account, no key, and no further setup. Type
/bye to leave.
Four more commands cover almost everything else:
ollama list # models you have downloaded
ollama ps # models currently loaded into VRAM
ollama rm <model> # delete one
ollama run <model> "..." # one-shot question, no chat session
If you want to watch your card's memory while a model loads,
nvidia-smi on an NVIDIA machine prints what is in use. Run it before and
after and the arithmetic from earlier stops being abstract.
LM Studio does the same job with a graphical interface, and shows you every available quantization of a model before you download it, which makes it a better place to learn what the labels mean. Both sit on top of llama.cpp, the project that made all of this practical on ordinary hardware.
One behaviour to know about early: once a model is loaded it stays in VRAM for a while waiting for your next message, because loading takes time. That's handy when you're chatting and a nuisance when you want the card back for something else. Both tools let you set that timeout.
09
Keeping it safe
Three different questions hide under that word.
Your data. This is the reason most people start. The text never leaves your machine. No API key, no per-token bill, no terms of service explaining what may be done with your input. For anything covered by a client agreement, that property is the whole argument.
The model file itself. You are downloading a large binary from a registry and running it. Stick to well-known models from the official repositories, and treat a random upload with the same suspicion as a random package from npm.
What it says. This one surprises people, and it runs the opposite way to what you'd expect. A small local model is considerably worse at following instructions than the large hosted ones. Tell it never to discuss something and it mostly complies, which is a different thing from complying.
If the model is only talking to you, that's fine. The moment it is answering other people, its instructions stop being a boundary. Anything that actually matters has to be enforced outside the model, in code that runs after it has spoken and does not depend on its cooperation.
10
What this looks like in practice
My own setup is a 24 GB card, which puts the whole range in reach and forces every one of these trade-offs into the open.
The models I keep are all Q4_K_M, and the ratio holds across every one of them: a 7.6B at 4.7 GB, a 14.8B at 9.0, a 36B at 23. That last one is a mixture-of-experts model, and it takes almost the entire card on its own.
The assistant that answers questions on this website runs the smallest of them. A 7B is enough for that job, because it is reading pages I wrote and summarising them, which is an easier job than reasoning from nothing, and choosing a bigger one would have cost me the ability to do anything else on the machine at the same time.
Running several things at once is where the theory turns into daily friction. Image generation on the same card fails outright if a language model is already holding memory, so I wrote a pair of batch files that pause the services holding VRAM, unload what is resident, and put it all back afterwards. Unglamorous, and I use it constantly.
The safety point isn't theoretical either. Somebody spent forty minutes attacking that website assistant in September and got it to invent a discount code I have never offered. Every rule it broke was already written in its instructions. What finally stopped it was a check that runs after the model answers and compares what it said against what my site actually publishes, which works precisely because it does not ask the model for anything.
If you have a card sitting idle, pull a 7B and ask it something. The whole thing takes about ten minutes, and the arithmetic above will tell you in advance whether the next one up will run.