FDE ACADEMY · MODULE 02 · LESSON 01
What a language model does, and what it costs to run
Tokens, context windows and quantisation at working depth, then the memory arithmetic that decides which GPU you need — weights, KV cache and overhead, each with its inputs on the page.
- Effort
- About an hour, with a calculator open.
- Skills
- llm-inference
Free and self-paced. No certification is offered.
01A budget, not a brain
A language model takes a sequence of tokens and predicts the next one, repeatedly. Everything a deployment does with it — answering from documents, extracting fields, drafting a reply — is that operation with a carefully built input. The useful mental model is not intelligence, it is a fixed-size budget you are filling: the context window is the number of tokens the model can attend to at once, and everything you want it to consider must fit inside it alongside the answer.
This is why retrieval exists. You cannot put 100,000 documents in the window, so you put the six passages most likely to contain the answer, and the quality of the deployment becomes the quality of that selection. It is also why long prompts get slower and more expensive in a predictable way rather than a mysterious one.
02Size, quantisation and the trade you are making
Parameter count is not quality; it is capacity, and capacity costs memory. Quantisation reduces the bytes used per parameter — four-bit weights are a quarter of the sixteen-bit ones — which is what lets a fourteen-billion-parameter model run on a single workstation card at all. The trade is quality, and how much you lose depends on the task, which means you measure it rather than read it.
The rule worth carrying: choose the smallest model that passes your evaluation for your task, then spend the memory you saved on context and concurrency.
03The memory arithmetic, and why it has two answers
Memory for serving is three terms: the weights, the key-value cache that grows with context length and with the number of requests in flight, and an overhead allowance. This site computes it and prints every input, because a hardware recommendation with no arithmetic behind it is a sales figure.
It reports two totals, and the difference matters. The typical figure assumes a fraction of your users are generating at any moment; the peak assumes all of them are. Quote the peak alone and you specify a machine nobody needs. Quote the typical alone and you have hidden the nine-o’clock problem, when everyone opens the tool at once.
- Weights = parameters × bytes per parameter. Fixed once you pick the model and quantisation.
- KV cache grows with context length and with concurrent requests. It is the term people forget.
- Overhead is an allowance on top of both, stated as an assumption rather than hidden in a margin.
04Do this
PRACTICAL TASK
Size a model by hand, then check it against the page
Work out the serving memory for a fourteen-billion-parameter model at four-bit quantisation for a forty-person firm, then compare your figure with the one the model page prints and reconcile any difference.
What you need
- A calculator
- No hardware — this lesson is arithmetic
Steps
- 01
Compute the weights term first: fourteen billion parameters at half a byte each. Write the number down before you look at anything.
- 02
Open the model page and read the VRAM section. Compare its weights figure with yours, then read the assumptions printed underneath it.
- 03
Find the typical and peak totals for a forty-user deployment at an eight-thousand-token context, and write down the ratio between them.
- 04
Open the flagship recipe’s hardware section and check which card the site recommends for that total, and what it says about unified-memory machines.
- 05
Repeat the whole exercise for a seventy-billion-parameter model at sixteen-bit and note which of your customer’s constraints that result eliminates.
You are done when
- Your hand-computed weights figure matches the page, and you can explain the remaining difference in the total.
- You can say in one sentence why the typical and peak figures differ and which one belongs in a quote.
- You can name the card the site recommends for the forty-user case, and the reason it does not recommend a unified-memory machine first.
05Where these facts live
This lesson does not restate anything that is already recorded with its evidence elsewhere on the site. These are the pages it leans on.
- Qwen2.5 14B Instruct
Registry facts, VRAM by quantisation with the arithmetic printed, and the hardware profiles that fit it.
- Local LLM serving
The recipe whose first step is sizing the model against the GPU before installing anything.
- How to deploy a private company ChatGPT
The same model choices in the context of one deployment, with the hardware the sizes actually need.
Ticks are stored in your browser only. They are not sent anywhere, they are not attached to an account, and clearing your browser data removes them.