# Mission 6.3: One Mac mini with Ollama for 30 people?

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

Belongs to [Chapter 6: Inference](https://llm.yoga/en/06-inferenz.md).

Structure: the case, the explanation, a hands-on tool, check questions, wrap-up. The answers to all questions are collected at the end.

## The case

**Dirk**, head of IT at a customer:

> “We’re putting a Mac mini with an M4 Pro in the server room, running Ollama with an 8B model. The 30 people in sales chat with it through a web interface. If everyone asks at the same time, each of them just gets a thirtieth of the speed. That works, right?”

Plans like this often come together without you, and when the server buckles under the load on day one, the problem still lands on your desk. Ollama is a program that runs language models on your own computer and offers them to other programs as a server. An 8B model has 8 billion parameters.

**Question 1 (decision):** What do you ask Dirk first?

- A) Which 8B model he wants to use and how good its German is.
- B) How much compute the Mac mini with M4 Pro has.
- C) How many ask at the same time and how long their inputs are.

## What’s behind it

Remember the translator who fetches the dictionary from the basement for every word (mission 6.1)? If ten customers are waiting, he can look up one word for each of the ten on every trip. The trip takes almost as long, but delivers ten words instead of one.

That’s called **batching**. When writing, the weights are read in full anyway; whether they then compute for one conversation or for eight makes hardly any difference to the memory. Today the usual approach is continuous batching: after every step, a finished conversation can leave and a new one can join.

On the test Mac, measured under heavy, changing load, the small model qwen3:1.7b wrote 12.8 tokens per second in one conversation, and 43.1 together in sixteen at once, 2.7 per conversation. A token is a word or a piece of a word. So each conversation got not a sixteenth but a bit more than a fifth. It isn’t entirely free: each conversation needs its own **KV cache**, a cache for its text, and at some point the compute runs out.

The catch for Dirk: by default, Ollama doesn’t batch. With its usual engine, it handles one request per model, and the rest wait. You can configure more parallel slots, but then the memory needed grows: according to the docs, 2,048 tokens of context become 8,192 with four parallel requests.

For Dirk this means: for a few people who rarely ask at the same time, the Mac mini can be enough. If a department asks a lot at the same time, chapter 6 recommends a server built for batching, such as vLLM or SGLang on an NVIDIA graphics card.

### In more detail: measurement, setting and servers at a glance

Measured with llama-batched-bench from llama.cpp, model file of qwen3:1.7b, 128 tokens of input and 64 tokens of answer per conversation, two runs under heavy, changing load. Writing speed in total and per conversation: 1 conversation 11.5 to 12.8; 2 conversations 16.2 to 17.5 (8.1 to 8.8 each); 4 conversations 26.7 to 31.6 (6.7 to 7.9 each); 8 conversations 31.3 to 71.2 (3.9 to 8.9 each); 16 conversations 43.1 to 65.2 (2.7 to 4.1 each). The calculator above shows run 2.

The setting is called `OLLAMA_NUM_PARALLEL`. According to the Ollama docs, it defaults to 1 with the llama.cpp engine; the MLX engine chooses on its own. More parallel requests multiply the context and with it the KV cache.

| Server | built for | Port |
| --- | --- | --- |
| Ollama | simple local use | 11434 |
| llama-server | lean server for GGUF | 9931 |
| mlx_lm.server | experiments on Apple Silicon | 8080 |
| vLLM | many users, mainly NVIDIA | 8000 |
| SGLang | throughput, agents, JSON | 30000 |

According to the docs, llama-server has continuous batching turned on by default. On the Mac, vLLM officially runs only experimentally on the CPU.

## Try it

**Measured batching**

**Task:** With 16 conversations at the same time, Dirk expects a sixteenth of the speed, so 12.8 ÷ 16 = 0.8 tokens per second per conversation. Set 16 conversations and compare with the measurement.

The calculator needs JavaScript. Measured on the test Mac (run 2): 1 conversation 12.8 tokens per second; 2 conversations 16.2 in total, 8.1 each; 4 conversations 26.7, 6.7 each; 8 conversations 31.3, 3.9 each; 16 conversations 43.1, 2.7 each.

Measurements were taken with 1, 2, 4, 8 and 16 conversations; in between, the calculator shows the next lower measured value. The big number at the top is the measured speed per conversation.

## Check

**Question 2 (check question):** Dirk sets up Ollama to handle eight requests at the same time. What does that cost?

- A) More memory, because each slot needs its own context.
- B) Nothing, the weights are only read once anyway.
- C) Each individual request becomes eight times slower.

**Question 3 (check question):** Why does a server with batching hardly get slower for the individual user when more users join?

- A) Because each user gets their own copy of the model.
- B) One pass through the weights serves several conversations at once.
- C) Because servers always have faster memory than a Mac.

**Question 4 (check question):** Dirk mentions that the sales team often pastes entire multi-page quotes into the chat. What does that change?

- A) Nothing, for Dirk all that counts is how fast it writes.
- B) The answers get written more slowly; reading stays just as fast.
- C) Reading the inputs gets expensive, and there compute is what counts.

## Done

**What you can do now**

- You can explain batching: one pass through the weights serves several conversations.
- You know that by default Ollama handles one request per model and that more parallel slots cost memory.
- When a customer plans their own chat server for a team, you first ask how many will ask at the same time and how long their inputs are, and once there are many simultaneous users, you recommend a server with continuous batching.

### Two cards for review

**Card 1:** True or false? “When ten people use the same model server, it gets ten times slower for each of them.”

**Card 2:** A department of 50 people wants to chat with an open model through a web interface. According to chapter 6, what fits?

- A) Ollama on a colleague’s laptop
- B) A server with continuous batching like vLLM on an NVIDIA GPU
- C) mlx_lm.server on a Mac

- [Next mission: I only typed „Hallo“ (hello), so why so much memory?](https://llm.yoga/en/einsatz-7-1.md)
- [Read chapter 6](https://llm.yoga/en/06-inferenz.md)

## Read more in the chapter

The full text from the chapter, with the reasoning, calculations and sources:

- [Batching: many users, one trip to memory](https://llm.yoga/en/06-inferenz-3.md)
- [What an inference server does](https://llm.yoga/en/06-inferenz-4.md)
- [The well-known servers at a glance](https://llm.yoga/en/06-inferenz-4.md)

## Answers: only reveal them after the learner has answered or explicitly asks

**Question 1:** The correct answer is C.
- A: That comes later. Whether a single computer can carry 30 people depends first on how many ask at the same time and how long their inputs are.
- B: For writing, memory bandwidth counts more than compute (mission 6.1). What matters first is how many requests come in at the same time.
- C, correct: These are the two follow-up questions from the practical example in chapter 6. The first decides whether you need a server that bundles requests; the second, how much compute reading long inputs costs.

**Question 2:** The correct answer is A.
- A, correct: 2,048 tokens of context become 8,192 with four parallel requests, and correspondingly more with eight. That has to fit into memory together with the model.
- B: All conversations share the weights, but each one needs its own KV cache. According to the Ollama docs, the context multiplies with the number of parallel requests.
- C: The measurement shows something else: with eight conversations, each got 3.9 instead of 12.8 tokens per second, just under a third, not an eighth.

**Question 3:** The correct answer is B.
- A: Then each user would need the full memory for the weights. With batching, everyone shares the same weights; only the KV cache is per conversation.
- B, correct: The expensive part is reading the weights. With batching, it’s spread across many conversations. Only when the compute units are fully busy and the KV caches grow does it get noticeably slower for everyone.
- C: More bandwidth raises the upper limit but doesn’t explain the effect. The measurement ran on the same Mac: one conversation 12.8, sixteen together 43.1 tokens per second.

**Question 4:** The correct answer is C.
- A: Long inputs have to be read before the first word comes. On the test Mac, a little over 2,300 tokens took 46 to 80 seconds depending on the load.
- B: It’s the other way around: mainly reading the input takes longer. Writing slows down only a little, because the larger KV cache is read along with it.
- C, correct: Then compute and reusing identical beginnings count for more than bandwidth, as the practical example in chapter 6 says. Reading is compute work, and there a large NVIDIA GPU is far ahead of a Mac: the DGX Spark reads 2,367 tokens in 0.31 seconds.

**Card 1:** **False.** A server with batching serves several conversations with one pass through the weights. On the test Mac, measured under heavy load, each of eight conversations got 3.9 instead of 12.8 tokens per second, just under a third. By default, though, Ollama doesn’t batch; there the other requests wait.

**Card 2:** Correct: B, A server with continuous batching like vLLM on an NVIDIA GPU Many simultaneous users need a server with continuous batching like vLLM or SGLang, mainly on NVIDIA graphics cards. Ollama and mlx_lm.server are built for individual users and experiments.
