# Can you run an LLM on a CPU, and when do you need a GPU?

> Source: <https://dev.to/viswaretas_kotra/can-you-run-an-llm-on-a-cpu-and-when-do-you-need-a-gpu-3e7i>
> Published: 2026-12-01 16:40:11+00:00

**Recommendation:** Estimate decode throughput as memory bandwidth divided by quantized weight size before choosing hardware, and move to a GPU once models reach 70B or prompts run to thousands of tokens.
More in the playbook "Inference and self-hosting": <https://wpnews.pro/playbooks/inference-serving>

Yes, a CPU can run an LLM: an 8B model quantized to 4 bits runs on an ordinary desktop at a theoretical ceiling of about 21 tokens per second, because generation speed is set mostly by memory bandwidth. You need a GPU once the model is 70B-class, prompts run to thousands of tokens, or several people share it; on Nodus an NVIDIA L4 that holds an 8B model is listed at $0.430/hr on the [pricing page](https://www.nodus-compute.ai/pricing/), and an H100 SXM at $2.600/hr covers the heavy end. The rest of this post shows the arithmetic, so you can run it for your own machine and model.

Generating one token means reading every weight of the model from memory once. For a single user, that read is the slow part, not the math. So the upper bound on decode speed is simple:

```
max tokens/s ≈ memory bandwidth (GB/s) / weight bytes read per token (GB)
```

This is the same rule our post on [LLM tokens per second](https://www.nodus-compute.ai/blog/llm-tokens-per-second/) applies to GPUs. It works for CPUs too, and it explains most of the gap between them. A CPU is not slow at generating tokens because it is a CPU. It is slow because a desktop memory bus moves far fewer bytes per second than GPU memory does.

Weight bytes depend on precision. The [llama.cpp quantize README](https://github.com/ggml-org/llama.cpp/blob/master/tools/quantize/README.md) lists Llama 3.1 8B at 4.58 GiB in Q4_K_M (4.89 bits per weight), 7.95 GiB in Q8_0 (8.50 bits) and 14.96 GiB in F16. That is 4.92 GB, 8.54 GB and 16.06 GB. Note that "8-bit" Q8_0 costs 8.5 bits per weight, because each block of weights stores a scale.

For Llama 3.1 70B, the same README gives 280.9 GB at full 32-bit size and 43.1 GB in Q4_K_M. Halving the first gives 140.45 GB for F16, and scaling it by 8.5008 / 32 gives 74.62 GB for Q8_0. Our [quantization guide](https://www.nodus-compute.ai/blog/llm-quantization-explained/) covers what each format does to quality.

A dual-channel DDR5 desktop reaches about 21 tokens per second on an 8B model at 4-bit and about 2.4 on a 70B model. A many-channel server CPU does roughly six times better. We took bandwidth from each vendor's own spec page and divided it by the weight sizes above. These are theoretical upper bounds computed from bandwidth, not benchmarks.

The bandwidth inputs:

| Hardware | Bandwidth | 8B Q4_K_M | 8B Q8_0 | 8B F16 | 70B Q4_K_M | 70B Q8_0 | 
|---|---|---|---|---|---|---|
| Desktop CPU, 2 x DDR5-6400 | 102.4 GB/s | 20.8 | 12.0 | 6.4 | 2.4 | 1.4 | 
| Server CPU, 12 x DDR5-6400 | 614 GB/s | 124.8 | 71.9 | 38.2 | 14.2 | 8.2 | 
| Mac Studio, M5 Ultra | 1,200 GB/s | 243.9 | 140.5 | 74.7 | 27.8 | 16.1 | 
| NVIDIA L4, 24 GB | 300 GB/s | 61.0 | 35.1 | 18.7 | does not fit | does not fit | 
| NVIDIA L40S, 48 GB | 864 GB/s | 175.6 | 101.2 | 53.8 | 20.0 | does not fit | 
| NVIDIA H100 SXM, 80 GB | 3,350 GB/s | 680.9 | 392.3 | 208.6 | 77.7 | 44.9 | 

Values are single-user decode ceilings in tokens per second. Specs checked December 1, 2026 on the linked vendor pages. "Does not fit" means the weights alone exceed the GPU's memory.

*For an 8B model, a 12-channel server CPU has a higher ceiling than an L4 GPU; a desktop does not.*

Real runs land below these numbers. Each token also reads the KV cache, threads contend for memory, and no system sustains its peak bandwidth. Treat the table as the most you could get, then expect less.

The 70B row is where a desktop stops being practical. At 2.4 tokens per second, a 300-token answer takes over two minutes at the theoretical best.

*A 70B model on a desktop CPU tops out near 2 tokens per second, too slow for chat even before real-world losses.*

Reading the prompt, called prefill, is limited by compute, not bandwidth, and GPUs have vastly more compute. A forward pass costs about 2 operations per parameter per token. So an 8B model reading a 2,000-token prompt does about 2 x 8 billion x 2,000 = 32 trillion operations, and a 32,000-token prompt does 512 trillion.

Intel lists the Core Ultra 9 285K at 36 peak INT8 TOPS, and that figure already counts its built-in GPU (8 TOPS) and NPU (13 TOPS). NVIDIA lists the H100 SXM at 3,958 INT8 TOPS with sparsity, which is 1,979 dense. That is about 55 times the desktop chip's entire figure.

At those peaks, the 2,000-token prompt takes at least 0.89 seconds on the desktop chip and 0.016 seconds on the H100. The 32,000-token prompt takes at least 14.2 seconds versus 0.26 seconds. These are floors at the vendors' peak ratings; real prefill is slower on both.

*Before the first token appears, a long prompt costs a desktop chip seconds that cost an H100 a fraction of one.*

This matters more every year, because coding agents and retrieval pipelines send long prompts by default. A 32,000-token context is ordinary for an agent that has read a few source files. On a CPU, that wait comes before every reply.

Serving several users at once shares each weight read across all of them, which turns decoding back into a compute problem. One pass over the weights can produce a token for every request in the batch. A GPU has the spare compute to fill that batch; a CPU runs out of it quickly.

Our [tokens per second post](https://www.nodus-compute.ai/blog/llm-tokens-per-second/) cites NVIDIA's published 14,992 tokens per second for Llama 3.1 8B on one H100 at full load, against a single-user ceiling of about 209. Nothing in the CPU column comes close to that kind of aggregate. If more than a handful of people or processes will share one model, plan on a GPU.

Usually not. The [llama.cpp build guide](https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md) says Metal is enabled by default on macOS and makes the computation run on the GPU. What a Mac really brings is unified memory: the GPU can read a large model from the same pool the CPU uses, at the bandwidth Apple lists.

That is why the M5 Ultra row sits between the server CPU and the H100. It is also why a Mac holds 70B models that no consumer GPU card can, as our post on [running an LLM locally vs in the cloud](https://www.nodus-compute.ai/blog/run-llm-locally-vs-cloud/) works through with prices.

Use the bandwidth formula as a filter, then apply four checks. This is our decision rule, built from the numbers above.

A middle path exists. llama.cpp's server takes `--n-gpu-layers N`, the [maximum number of layers to store in VRAM](https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md), and keeps the rest in system RAM. The layers left in RAM run at CPU memory speed, so a mostly offloaded model runs at mostly CPU speed.

For small models, very little. An L4 is listed at $0.430/hr on the [Nodus pricing page](https://www.nodus-compute.ai/pricing/), and from the table its ceiling on an 8B Q4_K_M model is 61.0 tokens per second, about three times the desktop's. For a 70B model at 4-bit, the L40S at $0.793/hr fits the 43.1 GB of weights, with little room left for KV cache. The H100 SXM at $2.600/hr carries the long-prompt and many-user cases.

Prices checked December 1, 2026.

To run your own script on one of those, a Nodus [Job](https://www.nodus-compute.ai/docs/guides/jobs/) takes a GPU type and a command, and prints the expected cost before anything runs:

``` bash
$ nodus run --gpu L4 --image nodus/pytorch -- python hello.py
```

Swap `hello.py` for your serving or batch script, and add `--max-cost 5` to stop the Job if it would spend more than $5. If you would rather not manage a GPU at all, the Nodus [inference API (Beta)](https://www.nodus-compute.ai/docs/guides/inference/) serves shared open-weight models through an OpenAI-compatible endpoint with no deployment. Our [VRAM tiers post](https://www.nodus-compute.ai/blog/which-llms-fit-in-8gb-16gb-24gb-vram/) helps pick the smallest GPU that holds your model and its context.

Not much, once memory bandwidth is the limit. Extra cores help prompt processing, which is compute-bound, but single-user decode on a dual-channel desktop stays near 102.4 GB/s divided by the weight size however many cores you add.

Yes, roughly in proportion. Dual-channel DDR5-5600 gives 5,600 x 8 x 2 = 89.6 GB/s, so the 8B Q4_K_M ceiling drops from 20.8 to about 18.2 tokens per second compared with DDR5-6400.

Technically, for tiny models, but training repeats a forward and backward pass over every token in the dataset, which is the compute-bound case where CPUs fall furthest behind. Fine-tuning is the clearest case for paying for a GPU by the hour, for example as a Nodus Job with a `--max-cost` cap.

Each token reads the whole model, and 43.1 GB is almost nine times 4.92 GB. The ceiling falls by the same factor, from 20.8 to 2.4 tokens per second.

*Originally published on the [Nodus blog](https://www.nodus-compute.ai/blog/can-you-run-an-llm-on-cpu/).*
