# Mac exercise for mission 6.1: Reading versus writing

Part of the course “AI from Zero to Autonomous Agents” (https://llm.yoga/en). Page for humans: https://llm.yoga/en/mac-6-1

About 12 minutes at your computer · Type this address: **llm.yoga/en/mac-6-1**

In the mission you did the math; here you measure. After every answer, Ollama shows how fast the model read the input (prefill) and wrote the answer (decode). The upper limit for writing is memory bandwidth divided by the size of the model: 120 GB/s on the MacBook with M4. Other Macs have other values; you’ll find them in Apple’s tech specs.

**Before you start**

You need **Ollama** in the terminal. Ollama comes as an app: download it from ollama.com/download and drag it into your Applications folder. On first launch, the app asks permission, if needed, to set up the `ollama` terminal command. It requires macOS 14 or newer. More on this in [chapter 10](https://llm.yoga/en/10-lokale-modelle-4.md). Check:

```
ollama --version
```

### 1. Load the model

qwen3:8b is 5.2 GB; that’s how the exercise in chapter 6 is set up for a Mac with 24 GB. With 16 GB, use qwen3:1.7b (1.4 GB) in all steps; with 8 GB, qwen3:0.6b (523 MB). If you already have the model, skip this step.

```
ollama pull qwen3:8b
```

### 2. Short question, first run

`--verbose` shows the timings at the end, `--think=false` turns off thinking mode. The prompt is in German, as in the measurement: „Erkläre in zwei Sätzen, was Inferenz ist.“ (Explain in two sentences what inference is.)

```
ollama run qwen3:8b --verbose --think=false "Erkläre in zwei Sätzen, was Inferenz ist."
```

**End of the output (Measured on an M4 Mac (24 GB) on November 25, 2026, under load)**

```
total duration:       16.990318583s
load duration:        5.352487291s
prompt eval count:    30 token(s)
prompt eval duration: 227.136ms
prompt eval rate:     132.08 tokens/s
eval count:           62 token(s)
eval duration:        11.407692s
eval rate:            5.43 tokens/s
```

Three lines matter: `load duration` is loading the model (5.4 seconds), `prompt eval rate` is reading the question (132 tokens per second), `eval rate` is writing (5.4). Here, reading was 24 times as fast as writing. The answer itself is worth a look too: for me, the model took inference to mean „Schlussfolgerungen ziehen“ (drawing conclusions); in this course it means running a finished model.

### 3. Right away, once more

```
ollama run qwen3:8b --verbose --think=false "Erkläre in zwei Sätzen, was Inferenz ist."
```

**End of the output (Measured on an M4 Mac (24 GB) on November 25, 2026, under load)**

```
total duration:       10.837755875s
load duration:        670.334µs
prompt eval count:    30 token(s)
prompt eval cached:   29 token(s)
prompt eval duration: 67.759ms
prompt eval rate:     14.76 tokens/s
eval count:           66 token(s)
eval duration:        10.765508s
eval rate:            6.13 tokens/s
```

Loading drops out; the model was still in memory. And 29 of the 30 tokens came from the cache of the previous request, so only one was read. That’s why the `prompt eval rate` doesn’t tell you much here. The writing speed stays similar: 6.1 instead of 5.4.

### 4. Work out the upper limit

Bandwidth divided by model size: on the M4, 120 GB/s ÷ 5.2 GB = 23 tokens per second at most. On the M4 Pro with 273 GB/s, it would be 52. Ollama reached about 70 percent of the limit on a DGX Spark; if you’re much lower, other programs are sharing the bandwidth.

### 5. Let the page check it

Paste the output of both runs. The page reads the `eval rate` lines and compares them with the upper limit for the M4.

The check needs JavaScript. Without it: 5.43 ÷ 23 is 24 percent, 6.13 ÷ 23 is 27 percent of the upper limit.

On the busy test Mac, it was about a quarter of the limit. If you have a different Mac, plug in your own bandwidth; the page calculates with 120 GB/s.

### 6. Once more without load

Close browsers with lots of tabs, videos and other big programs, and repeat step 3. If the `eval rate` goes up, the load was sharing the bandwidth. You won’t get above the limit of 23.

### 7. Clean up

Keep the model if you still want to do the exercise for 6.2. Otherwise take it out of memory and, if you don’t need it anymore, off the disk:

```
ollama stop qwen3:8b
```

```
ollama rm qwen3:8b
```

With qwen3:1.7b, the upper limit is 120 ÷ 1.4 = 86 tokens per second. The check above calculates with 23 and then reports “above the limit”; in that case, divide by 86 yourself.

#### On the DGX Spark

The Spark has 273 GB/s, so for llama3.1:8b at 4.9 GB, at most 55.7 tokens per second when writing, the same as a Mac with M4 Pro. Ollama measured on the Spark (Ollama 0.12.6, ten runs, 500 tokens of output): llama3.1:8b in Q4_K_M read 7,614 and wrote 38.02 tokens per second, 68 percent of the limit. Reading there was 200 times as fast as writing, because the Blackwell graphics chip is far ahead at computing. With Ollama on the Spark, for example from the playbook “Chat with LLMs Using Open WebUI and Ollama”, you can compare the same `prompt eval rate` and `eval rate` lines; calculate the limit with 273 GB/s. (Checked against the documentation, not run here)
