iPipSubmit

← All tools

Mac AI model memory calculator

Type the model size and pick its format. The answer updates as you type, and nothing leaves this page.

Mac AI model memory calculator

More exact: download size and context

Try an example:

What it does

Before you download a 20 GB model, it helps to know if your Mac can hold it. A local AI model has to sit in memory while it runs, and on a Mac with Apple silicon that is the same unified memory macOS and your apps use. This page works out how many GB a model needs from two things on its model card, the number of parameters and the format, and compares that with your Mac's memory after a little is kept free for macOS and your apps. It shows the answer for your Mac and for every memory size from 8 GB to 512 GB.

How the number is worked out

Each parameter is stored in a set number of bits, so the weights need parameters x bits / 8 bytes. An 8 billion parameter model at 4.5 bits is about 4.5 GB. The bits for each format are the real block sizes the file formats use, not rough guesses:

FormatBits per weight
FP16 or BF1616
Q8_0, MLX 8-bit8.5
Q6_K6.5625
Q5_K5.5
Q4_K, MLX 4-bit4.5
Q3_K3.4375
Q2_K2.625
Ternary, Bonsai 2.5 PTQ1_01.76

Files named _M or _S, like Q4_K_M, keep a few layers at a higher format, so the real download is a little bigger than the estimate. If you know the download size, type it in the second part of the form and the page uses that instead. MLX 4-bit and 8-bit are counted with MLX's default group of 64 weights.

Context memory

The weights are not the whole story. Every token in the chat also keeps a small cache, and a long context can add gigabytes. To count it, open the model's config.json on Hugging Face and copy num_hidden_layers, num_key_value_heads and head_dim. The page then adds 2 x layers x KV heads x head size x tokens x 2 bytes, for a cache kept at 16 bits. Models that mix attention types only keep this cache in their full attention layers, so count those layers only.

Why some memory is kept free

macOS, the app running the model and anything else you have open need memory too. The page keeps 4 GB free by default, which is MacPip's rule of thumb, not Apple's. Raise it if you keep a browser full of tabs open. A model marked Tight fits in the memory but not with that room left, so the Mac will swap to disk or the app may refuse to load it. Memory Pressure in Activity Monitor shows how it is really going. Mac memory is sold in binary gigabytes, so a 16 GB Mac holds about 17.2 GB as model pages count them, and the page counts it that way.

What it does not tell you

Fitting is not the same as fast. Speed depends on your chip's memory bandwidth and the app you use, and a model that only just fits will feel slower than one with room to spare. This page also cannot say how good a model is at a job. Try it before you build a workflow or an app on it.

Questions

How much RAM do I need to run an LLM on a Mac?

About the model's size in GB plus room for macOS and your apps. An 8 billion parameter model at Q4_K is about 4.5 GB, so it runs on a 16 GB Mac with room to spare and is tight on 8 GB. A 70 billion parameter model at the same format is about 39 GB, so it needs a Mac with 48 GB or more.

How do I work out the size of a model?

Multiply the parameters by the bits per weight and divide by 8. 8 billion parameters at 4.5 bits is 4.5 billion bytes, or 4.5 GB. Add the context cache on top for long chats.

What does Q4_K_M mean?

It is a llama.cpp GGUF format that stores most weights in about 4.5 bits each, with a few layers kept at a higher format. That makes the file a little over a quarter of the full FP16 size.

Can an 8 GB Mac run a local AI model?

Small ones. A 3 or 4 billion parameter model at Q4_K is about 2 GB and fits. An 8 billion one at Q4_K is about 4.5 GB, which only fits if you close most other apps.

Is this calculator free?

Yes. There is no account, and everything is worked out in your browser. Nothing you type is sent anywhere.

Does it say how fast the model will run?

No. Speed depends on the chip's memory bandwidth, the app and the format. The calculator only says whether the model fits in memory.

Related