# Mac exercise for mission 6.2: Long prompt and a pause

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

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

In the mission, Anke waited over a minute for the first word, and depending on the load, the test Mac needed 46 or 80 seconds. Here you measure it yourself: how long does the model take to read a two-page document, and what does it cost when the model has to be reloaded after a pause? The time to first token is loading plus reading, and Ollama shows both after every answer.

**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. Get the model ready

As in the exercise for 6.1: qwen3:8b with 24 GB, qwen3:1.7b with 16 GB, qwen3:0.6b with 8 GB (then keep the long text under 2,000 tokens).

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

### 2. Prepare a long text

Copy two to three pages of text into a file `lang.txt`, for example a report or a section from this course. I took the beginning of [chapter 6](https://llm.yoga/en/06-inferenz.md) up to “Two phases”, 717 words (the German version of the chapter). The easiest way: select the text, copy it, and in the terminal run

```
pbpaste > lang.txt
```

### 3. Have it summarized

```
ollama run qwen3:8b --verbose --think=false "Fasse in einem Satz zusammen: $(cat lang.txt)"
```

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

```
total duration:       50.585980042s
load duration:        2.375458ms
prompt eval count:    1357 token(s)
prompt eval cached:   1 token(s)
prompt eval duration: 32.151256s
prompt eval rate:     42.18 tokens/s
eval count:           84 token(s)
eval duration:        16.709987s
eval rate:            5.03 tokens/s
```

The prompt is in German, as in the measurement: „Fasse in einem Satz zusammen:“ means “Summarize in one sentence:”. 717 words became 1,357 tokens. The model was already loaded, so the time to first token is almost entirely the `prompt eval duration`: 32 seconds of silence before the first word came. It read 42 tokens per second and wrote 5.0; the Mac was under load at the time (load average around 17). The mission has two measurements with a little over 2,300 tokens: 80 seconds on the heavily loaded Mac, 46 on the calmer one. Your number depends on what else is running on your Mac; `sysctl -n vm.loadavg` shows you the load.

### 4. Recreate a pause

Ollama takes a model out of memory after five minutes without a request. So you don’t have to wait, `--keepalive 10s` sets the keep-alive time to ten seconds for this call. The question is the one from the exercise for 6.1 (Explain in two sentences what inference is.):

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

```
sleep 15; ollama ps
```

**Output of ollama ps (Measured on an M4 Mac (24 GB) on November 25, 2026)**

```
NAME    ID    SIZE    PROCESSOR    CONTEXT    RUNNER    UNTIL
```

The list is empty; the model has been unloaded. Now ask the same question again, without `--keepalive`:

```
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:       14.646734792s
load duration:        1.560675167s
prompt eval count:    30 token(s)
prompt eval duration: 220.117ms
prompt eval rate:     136.29 tokens/s
eval count:           60 token(s)
eval duration:        12.86287s
eval rate:            4.66 tokens/s
```

The `load duration` is back: 1.6 seconds. In the first run of the exercise for 6.1 it was 5.4 seconds, in the chapter 8.0; the load time varies from run to run. The writing speed has barely changed.

### 5. Let the page check it

Paste the output from step 3 and from the last call in step 4. The page compares both writing speeds with the upper limit of 23 tokens per second (120 GB/s ÷ 5.2 GB).

The check needs JavaScript. Without it: 5.03 and 4.66 tokens per second, 22 and 20 percent of the limit, ratio 0.93.

What the check doesn’t show is in your lines: the wait before the first word was 32 seconds with the long prompt, and after the pause, 1.6 seconds of loading were added.

### 6. Clean up

```
rm lang.txt
```

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

With qwen3:1.7b, the upper limit is 120 ÷ 1.4 = 86 tokens per second; the check calculates with 23 and then reports “above the limit”. Reading goes much faster with the small model.

#### On the DGX Spark

This is where the difference is biggest. On the Spark, Ollama measured 7,614 tokens per second for reading with llama3.1:8b. Anke’s 2,367 tokens would be read after 2,367 ÷ 7,614 = 0.31 seconds, instead of after 46 to 80 seconds on the test Mac, depending on the load; after that, writing runs at 38.02 tokens per second. With Ollama on the Spark, for example from the playbook “Chat with LLMs Using Open WebUI and Ollama”, you measure this with the same commands. With vLLM from the playbook “Serve LLMs with vLLM on One Device” (port 8000), you can also send eight identical requests at the same time and see that they take much less than eight times as long. (Checked against the documentation, not run here)
