Running AI locally · Part 1 of 5

What You Need: Memory, Bandwidth and the Machine on Your Desk

  • About 30 minutes
  • Written 19 September 2026 by Chris Neale

After this part you can

Look at a machine and a model and say whether it will run, and roughly how fast.

About this part

This is the first of five parts in the running AI locally module. The aims of the course, the layout every part follows and suggested reading routes are in Course introduction. The format is the same as elsewhere: In plain terms opens each numbered section, deep dives are optional, and a glossary closes the part. Reading time is about 30 minutes.

This module is more practical than the others. It is about running models on hardware you own: what that takes, how to find and choose a model, which software to run it with, what happens when you ask it to act as an agent, and how to build on it. It names products throughout, because there is no other way to be useful, and it moves faster than anything else in the course. Every table says when it was written. The module explains what the tools do and what to look for, and leaves the commands to each tool’s own documentation, which will be right after this page is not.

It leans on part 3 of the language models module, which explains quantisation, the KV cache and the economics of self-hosting. You can read this module without it, and it will make more sense with it.

What part 1 gives you

Part 1 builds one idea: running a model locally is a question about memory. How much memory you have decides which models you can run at all. How fast that memory can be read decides how fast they answer. Processor speed, which is what people look at first, comes a distant third. By the end you should be able to look at a machine’s specification and a model’s name and say whether it will run, and roughly how fast.

1. Should you

In plain terms

Running a model yourself gives you privacy, control, a fixed cost and independence from anyone’s service. It costs you quality, since the best models do not fit on a desk, and it costs you time. For most work an API is still the right answer. Local is right when the data cannot leave, when you need the same model next year, when the volume is high and steady, or when you want to learn how this really works.

Who should read it: everyone. This is the decision the rest of the module assumes you have made.

The language models module reached a blunt conclusion about self-hosting: for nearly every organisation, a rented server for a large open model sits idle most of the day and costs more than the API it replaces. That conclusion stands. This module is about something smaller and more personal: a model on your own laptop, workstation or a box under the desk, serving one person or a small team.

What you gain

  • Privacy that does not depend on a contract. Nothing leaves the machine. For source code under a confidentiality agreement, client documents, medical or legal material and anything a contract forbids sending to a third party, this is the whole argument.
  • A model that does not change. A file on your disk behaves the same next year. Hosted models are revised and retired on the vendor’s schedule, and a prompt tuned for one version may not survive the next.
  • No meter. Once the hardware is bought, a million tokens cost the electricity. Experiments you would never run against a paid API become free to try, and that changes how you work.
  • It works offline, on a train, on a plane and during an outage.
  • Understanding. Nothing teaches what a context window, a quantisation level or a token per second really is like watching one run out.

What you give up

  • Quality. The best open models have hundreds of billions to trillions of parameters and need a rack of data-centre GPUs. What fits on a desk is the 4 to 35 billion parameter range, with a few larger exceptions on expensive machines. Those models are very good and they are not the best. The gap is widest on exactly the hard, long, multi-step tasks where a model is most valuable, as part 4 shows.
  • Speed at the top end. A hosted service answers from hardware costing hundreds of thousands of dollars. A laptop does not.
  • Your time. Choosing, downloading, configuring and updating is work, and the defaults are often wrong in ways part 3 describes.
  • Someone else carrying the risk. No vendor filters the output, indemnifies you or fixes the security hole.

When local wins

SituationWhy local
The data may not leave the buildingThe only option that needs no trust in a third party
High, steady volume of a narrow taskClassification, extraction, summarising, tagging. A small model does these well, and the meter never runs
A workflow that must be reproducibleRegulated or audited work, research, anything re-run next year
Working offline or on a poor connectionField work, travel, secure sites
Experiments and learningFree to try anything, as often as you like
A feature built into a product that ships to users’ machinesNo server bill, and no user data collected

For everything else, which is most things, the language models module’s advice holds: use the most capable hosted model that your tests justify. Many people end up using both, a local model for private and routine work and an API for the hard problems.

2. Memory decides what runs

In plain terms

A model is a big file of numbers, and all of it has to sit in fast memory while it runs. So the first question is simply whether the file fits. A model’s size in gigabytes is roughly its parameter count in billions multiplied by how many bytes each number takes, which is set by how heavily it has been compressed.

Who should read it: everyone. The sum in this section is the most useful thing in the module.

The sum

Part 1 of the language models module describes a model as billions of numbers called weights, and its part 3 describes quantisation: storing each weight in fewer bits, trading a little quality for a lot of memory. Put together, they give the size of the file.

memory for the weights  =  parameters  x  bits per weight  /  8
ParametersAt 16 bits, as publishedAt 8 bitsAt about 4.5 bits, the usual choice
4 billion8 GB4 GB2.3 GB
9 billion18 GB9 GB5 GB
14 billion28 GB14 GB8 GB
27 billion54 GB27 GB15 GB
35 billion70 GB35 GB20 GB
70 billion140 GB70 GB40 GB
120 billion240 GB120 GB68 GB

Four to five bits per weight is where most people settle. Part 2 explains the names these compressed versions go by and what each costs in quality.

The weights are not everything

On top of the weights you need room for three more things.

  • The context. The KV cache, which the language models module explains, holds the conversation so far and grows with every token. For a mid-sized model it is somewhere between 50 and 300 kilobytes per token, so a 32,000-token context can need several gigabytes and a 128,000-token one can need more than the weights. Part 3 shows that this is the setting most often got wrong.
  • Working memory for the computation itself: allow a gigabyte or two.
  • Everything else on the machine. On a computer where the model shares memory with the operating system, the browser and the editor, those come out of the same budget.

A workable rule: the weights should take no more than about two thirds to three quarters of the memory available to the model. A 15 GB file is comfortable in 24 GB and will not run usefully in 16 GB.

Two kinds of memory

Where that memory is matters as much as how much there is.

  • A graphics card has its own memory, called VRAM, which is very fast and strictly limited: 8 to 32 GB on consumer cards. The model must fit in it to run at full speed. If it does not, the overflow goes to the computer’s ordinary memory and runs on the processor, and speed falls by a factor of five to twenty for that part.
  • Unified memory is one pool shared by processor and graphics, as on Apple silicon Macs and some recent AMD and NVIDIA machines. There is much more of it, up to 128 GB or beyond, and all of it is available to the model. It is slower than a graphics card’s memory, for a reason the next section gives.

This is the central trade in choosing local hardware. A graphics card is fast and small. Unified memory is large and slower. Which suits you depends on whether you would rather run a 14 billion parameter model very quickly or a 70 billion parameter one at reading speed.

3. Bandwidth decides how fast

In plain terms

To produce each word, the machine has to read through the whole model once. So the speed of a local model is set almost entirely by how fast the memory can be read, a figure called memory bandwidth. It is on every specification sheet and almost nobody looks at it. A rough rule: divide the bandwidth by the size of the model file and you have the most tokens per second you can hope for.

Who should read it: everyone who will buy or choose hardware.

Why reading speed is the limit

The language models module explains that generating each token takes one full pass through the network, and that during generation the processor spends most of its time waiting for weights to arrive from memory. The arithmetic is simple. If the file is 15 GB and the memory can deliver 300 GB a second, the weights can be read at most twenty times a second, so twenty tokens a second is the ceiling whatever the processor.

tokens per second, at most  =  memory bandwidth  /  size of the weights read for each token

For a dense model the weights read for each token are the whole file. For a mixture-of-experts model they are only the active part, which is why such models feel so much faster than their size suggests. Real speeds come in at perhaps half to three quarters of the ceiling, and fall as the context fills.

Reading speed is comfortable from about ten tokens a second. Thirty feels quick. Agents, which part 4 covers, want much more, since they generate a great deal of text nobody reads.

Two phases, two limits

There are two phases, and different hardware is good at each.

  • Reading the prompt processes all the input tokens at once. This is limited by raw computing power, where graphics cards are far ahead. It decides how long you wait before the first word appears.
  • Writing the answer produces one token at a time. This is limited by memory bandwidth, as above.

For chat the first phase hardly matters, since prompts are short. For agents and for work over long documents it dominates: a 50,000-token context takes a few seconds to read on a high-end graphics card and can take minutes on a machine with slow prompt processing. This is the unadvertised weakness of large unified-memory machines, and it is improving: Apple’s newest chips add hardware specifically to speed it up.

What this explains

  • A five-year-old graphics card can beat a new laptop processor, because its memory is several times faster.
  • Processor cores, clock speed and “AI TOPS” figures tell you almost nothing about language model speed. Advertised neural processing units in laptops are, at the time of writing, little used by the software in part 3.
  • Ordinary desktop memory is the slow lane. A desktop computer’s main memory delivers 50 to 100 GB a second, a tenth or less of a good graphics card. A model running from it manages a few tokens a second.
  • Two graphics cards pool their memory and not their speed. Software can split a model across two cards, which lets a bigger model fit. Each token still passes through them in turn, so it runs at about the speed of one.

4. The machines

In plain terms

There are three sensible kinds of machine. A PC with an NVIDIA graphics card is the fastest and has the best software support, and is limited by how much memory the card has. A Mac with a lot of unified memory runs much bigger models, more slowly, with no fuss. Newer small computers from AMD and NVIDIA with large unified memory sit below the Mac on speed and price.

Who should read it: anyone choosing or judging hardware. The table will date.

Figures are manufacturers’ published specifications as of September 2026.

MachineMemory for the modelBandwidthWhat it suits
NVIDIA RTX 509032 GBAbout 1,800 GB a secondThe fastest consumer option. Models up to about 30 billion parameters at 4 bits, very quickly
NVIDIA RTX 4090 or 309024 GBAbout 1,000 GB a secondThe long-standing enthusiast choice, widely available second-hand. The same models, a little slower
NVIDIA cards with 16 GB16 GB450 to 960 GB a secondModels up to about 14 billion parameters. Check the bandwidth: it varies twofold between cards of the same memory
NVIDIA cards with 8 to 12 GB8 to 12 GB270 to 500 GB a secondModels of 4 to 9 billion parameters
NVIDIA workstation cards48 to 96 GBUp to about 1,800 GB a secondLarge models at full speed, at several times the price
AMD Radeon cards with 24 to 32 GB24 to 32 GB640 to 960 GB a secondComparable hardware for less money, with software support that is good and less polished
Apple MacBook Pro or Mac Studio, Max chipUp to 128 GB410 to about 600 GB a secondModels up to 70 billion parameters and the larger mixture-of-experts models, at reading speed or better
Apple Mac Studio, Ultra chipUp to 512 GBAbout 800 GB a secondThe largest models that can run on a desk at all
Apple Mac mini or MacBook, Pro chipUp to 64 GBAbout 270 GB a secondMid-sized models at a modest pace
AMD Ryzen AI Max machinesUp to 128 GBAbout 256 GB a secondA small, quiet, inexpensive box with a lot of memory. Best with mixture-of-experts models
NVIDIA DGX Spark128 GBAbout 273 GB a secondThe same idea from NVIDIA, with its software stack. For development more than speed
Any computer with no suitable graphicsIts main memory50 to 100 GB a secondModels up to about 4 billion parameters usably. Larger ones at a crawl

The three platforms

  • NVIDIA. Everything in part 3 works, first and best. Its programming platform, CUDA, is what nearly all AI software is written for, and new models and techniques arrive here first. The limit is memory per dollar: consumer cards stop at 32 GB.
  • Apple. A Mac is the simplest way to get a lot of fast-enough memory, which makes it the common local machine among engineers. Apple’s own framework, MLX, is now the fastest way to run models on it, and the main tools use it. It is slower than a graphics card at reading long prompts, and it does not run the server software that part 5 describes for serving a team.
  • AMD. Its graphics cards and unified-memory machines offer the most memory for the money. Its programming platform, ROCm, works with the main engines on Linux and increasingly on Windows, and a cross-vendor alternative, Vulkan, works nearly everywhere and is slower. Expect to spend more time on setup, and check that the specific tool you want supports the specific card you have.

Choosing

Decide what you want to run before you look at machines.

  1. Pick the model size your work needs. Part 2 helps with this. For private chat, summarising and simple coding help, 8 to 14 billion parameters is enough. For serious coding assistance and agents, the 27 to 35 billion range is where models become dependable.
  2. Work out the memory from section 2, with room for the context you need.
  3. Decide what speed you can live with from section 3. Chat is forgiving. Agents are not.
  4. Then choose the platform that delivers both within your budget.

And before buying anything, try it. Whatever machine you already have will run a 4 billion parameter model well enough to learn everything in parts 2 and 3, and an hour’s rental of a cloud GPU will tell you what a larger one would feel like.

The whiteboard version

A model is a file of numbers that must sit in fast memory while it runs. Its size is its parameter count times the bits per weight, so 27 billion parameters at the usual 4 to 5 bits is about 15 GB, plus room for the context. Memory capacity decides what runs at all. Memory bandwidth decides how fast, because every token means reading the active weights once: bandwidth divided by file size is the ceiling on tokens per second. Mixture-of-experts models need memory for all their parameters and run at the speed of the few they use. Graphics cards are fast and small, unified-memory machines are large and slower, and ordinary memory is the slow lane. Local is for private data, reproducible work, steady volume and learning. For the hardest problems, the best models are still somewhere else.

Say it two ways

IdeaTechnical versionNon-technical version
Why memory decidesAll weights must be resident in GPU-addressable memory, and size is parameters times bits per weightThe model is a big file that has to fit in the fast part of the computer’s memory. If it does not fit, it barely runs
Why bandwidth decides speedDecoding is memory-bound: each token requires reading every active weight onceTo write each word, the machine reads the whole model. So it goes as fast as the memory can be read, not as fast as the chip can think
VRAM against unified memoryA discrete pool on a very fast bus against one larger pool shared with the processor on a slower oneA graphics card has a small, very fast desk to work on. A Mac has a big, slower one
Prompt processingPrefill is compute-bound and parallel, and sets time to first tokenReading what you gave it is a separate job from writing the answer, and some machines that write well read slowly
Mixture of experts, locallyCapacity follows total parameters, latency follows active parametersIt needs memory for the whole team and runs at the speed of the few who turn up for each word

Misconceptions to correct

Three claims come up constantly. Agree with the true part first, then add what it leaves out.

“We can run it ourselves and stop paying for the API”

True
After the hardware is bought, each token costs only electricity, and for private or high-volume work that is a real saving.
Misleading
What runs on a desk is not the model you were paying for. The best models are far too large. A local model will do routine work well and fall short on the hard problems, and someone has to choose it, run it and keep it current.
What to say
“We can run something ourselves, and it is worth doing for private data and routine jobs. It will not replace the best hosted model for the hard work, so let us decide which jobs go where and test the local model on ours before we cancel anything.”

“We need the fastest processor we can get”

True
A faster chip helps with reading long prompts, and with everything else the computer does.
Misleading
Generating text is limited by how fast memory can be read, not by how fast the chip computes. A machine with twice the processor and half the memory bandwidth is half as fast. The specification that matters is one that most buyers never look at.
What to say
“Look at two numbers: how much memory the model can use, and the memory bandwidth in gigabytes a second. Those decide what runs and how fast. Core counts and AI ratings do not.”

“It has 32 GB of memory, so a 30 GB model will fit”

True
The weights themselves would fit.
Misleading
The context needs memory too, and grows with every token, along with working space and everything else running. On a machine where the model shares memory with the rest of the system, the browser is in that budget as well. A model that only just fits runs with a context too short to be useful, or spills into slow memory.
What to say
“Leave a quarter to a third of the memory free. A model that fills it has no room to think.”

Glossary

Every technical term used in this part, in plain language and in alphabetical order. Terms explained in the language models module are not repeated.

Active parameters
The part of a mixture-of-experts model used for each token. It sets the speed
Bits per weight
How much storage each of a model’s numbers takes after quantisation. Commonly 4 to 5
CUDA
NVIDIA’s programming platform, which most AI software is written for first
Dense model
A model that uses all its parameters for every token
Memory bandwidth
How fast memory can be read, in gigabytes a second. The main limit on generation speed
Metal and MLX
Apple’s graphics programming platform, and its framework for running models on Apple silicon
Offloading
Keeping part of a model in ordinary memory when it does not fit in the graphics card’s. Much slower
Prompt processing
Reading the input, all at once, before the first token is written. Limited by computing power
ROCm
AMD’s programming platform for its graphics cards
Time to first token
How long you wait before the answer starts. Set by prompt processing
Tokens per second
How fast the answer is written. Around ten is reading speed
Total parameters
All the parameters in a model, used or not. It sets the memory needed
Unified memory
One pool of memory shared by processor and graphics, as on Apple silicon
VRAM
A graphics card’s own memory. Very fast, and limited in size
Vulkan
A graphics programming platform that works across vendors. A fallback where the others are not supported

Sources

Figures in this part come from these documents, read in September 2026. Hardware specifications are the manufacturers’ published figures, from the drafter’s knowledge, and should be checked against current listings before a purchase.