# What changes when many people use one model?

> Each person gets a little slower, but the machine as a whole gets much faster, because requests are batched. Size the server by users, requests per minute and tokens per request.

One person chatting leaves most of the machine idle. Ten people sharing it use the same hardware far better, as long as the runtime can batch their requests together.

## Latency versus throughput

Two numbers describe a server, and they pull in opposite directions. Latency is what one person feels: how long until the first word appears, then how fast the rest streams. Throughput is what the machine delivers in total, summed across everyone using it.

On a laptop you only care about latency, because you are the only user. On a shared server you care about both. A server that streams beautifully for one user and makes the second user wait a full minute is a bad server.

Both are measured in tokens per second, and that causes confusion. A single stream at reading speed and an aggregate of hundreds of tok/s can describe the same box at the same moment. When a vendor quotes a big number, check which one it is.

**Rule of thumb.** 
Single-stream speed tells you how it feels. Aggregate speed tells you how many people it can serve. Always ask which one a benchmark measured.

## Concurrency per runtime

When two requests arrive at once, runtimes do one of three things: queue the second, run a fixed number side by side, or batch everything that arrives.

| Runtime | What happens with two requests | Setting that controls it |
| --- | --- | --- |
| [Ollama](https://localagi.co/ollama) | Runs a few in parallel per model, queues the rest | `OLLAMA_NUM_PARALLEL`, `OLLAMA_MAX_QUEUE` |
| [llama-server](https://localagi.co/llama-cpp) | Splits the context into a fixed number of slots and batches across them | `--parallel` (`-np`) |
| [LM Studio](https://localagi.co/lm-studio) | Recent versions can serve parallel requests on the llama.cpp engine | A per-model setting in the app |
| [mlx_lm.server](https://localagi.co/mlx) | Built for one user. Expect requests to queue | None worth relying on |
| [vLLM and SGLang](https://localagi.co/vllm-and-sglang) | Continuous batching across everything in flight | `--max-num-seqs` in vLLM |

A queue is not a failure. For a household of three it is fine. For a team of thirty, the person at the back waits for everyone in front, and they will tell you about it.

More machines are the other lever. Superfluid, from Base Compute, puts a full copy of the model on each machine and places each session on one of them, so total throughput grows with the machine count. Its README also says interactive chat jumps ahead of queued agent work, and [Which tools run a model across machines?](https://localagi.co/cluster-tools) covers the setup.

**The catch.** 
In llama-server, slots share one context budget. Set `-c 32768 -np 4` and each slot gets 8K tokens, not 32K. Raise the context when you raise the slot count, and check it still fits in memory.

## Batching

Batching is why a shared server gets more total work out of the same chip. Writing each token means reading the whole model out of memory, as [What makes a model fast?](https://localagi.co/what-makes-it-fast) explains.

That read is the slow part. The maths on top of it is cheap.

So the runtime reads the weights once and applies them to many users' tokens in the same pass. Eight users cost little more memory traffic than one. Aggregate throughput climbs steeply while each person's stream slows only a little.

Continuous batching goes one step further. Instead of waiting for a whole batch to finish, the runtime adds new requests and drops finished ones at every step. Nobody waits for the longest answer in their group.

1. Requests arrive
2. Runtime groups them
3. Weights read once
4. One token for each user
5. Repeat, adding and dropping requests

The ceiling is memory. Every request in flight holds its own [KV cache](https://localagi.co/context-window), so more users means less room. When the cache is full, new requests wait.

This is why serving runtimes take most of the GPU memory at start-up and manage it themselves.

## Sizing

Size a server from three numbers you can estimate: how many people, how often they send requests, and how long the requests are.

1. Count active users at the busiest hour, not total accounts. Ten accounts might mean three people typing at once.
2. Estimate requests per user per minute. Chat is slow, about one request every minute or two. A [coding agent](https://localagi.co/coding-agents) fires many requests in a burst.
3. Estimate tokens per request, in and out. Chat replies are a few hundred tokens. Agents send tens of thousands of input tokens per call.

Multiply out the output tokens per minute, then compare with the aggregate throughput of your hardware and runtime. Leave at least half the capacity spare for bursts. Input tokens matter too, because long prompts cost [prefill](https://localagi.co/life-of-a-prompt) time before anyone sees a word.

Then check single-stream speed at that load against what each job needs.

| Use case | Speed | Why |
| --- | --- | --- |
| Batch or overnight | under 10 tok/s is fine | Throughput per dollar matters more than latency. |
| Reading-speed chat | 10 to 30 tok/s | Human reading is about 7 to 15 tok/s. 15 and up feels comfortable. |
| Coding assistant | 30+ tok/s | Plus fast prefill. Large prompts need a quick time to first token. |
| Agent loops | 50+ tok/s | Multi-step tool calls multiply token counts. Reasoning models emit thousands of thinking tokens. |

**Try it.** 
Start llama-server with four slots, then send two requests from two terminals at once and watch both stream.

```bash
llama-server -m model.gguf -c 16384 -np 4 --port 8080
```

## Go deeper

### Why batching is nearly free at small batch sizes

A GPU has far more compute than one stream can use. At batch size one, it spends most of each step waiting for weights to arrive from memory. Extra users fill that idle compute.

Past some batch size, compute becomes the limit instead. From there, adding users slows everyone in proportion. That turning point is higher on GPUs with lots of compute, which is why data-centre cards shine at serving and less so at single-user chat.

### Prefill competes with decode

A new request with a long prompt needs a big burst of prefill compute. While that runs, the other users' streams can stall. vLLM and SGLang split long prefills into chunks and mix them in with decode steps, so nobody freezes for long.

Desktop runtimes handle this less gracefully. If one colleague pastes a whole codebase, everyone else feels it.

### MoE models and batching

A [mixture of experts](https://localagi.co/dense-vs-moe) model reads only some experts per token. With many users, different tokens want different experts, so a large batch ends up reading most of the model anyway. MoE models still batch well, but the single-user speed advantage shrinks as load rises.
