How do I benchmark my own setup?

5 min readMarkdown

A speed number means nothing until you know what it measured. Record two numbers, prefillPrefillThe phase where the model reads your prompt. Limited by compute.Read more and decodeDecodeThe phase where the model writes its answer one token at a time. Limited by memory bandwidth.Read more, on a warm model with a fixed prompt. Then a number from today can be compared with a number from next month.

Prefill and decode separately

Every answer has two stages, and they run at very different speeds. What happens when I press enter? explains why.

StageWhat it isFelt asLimited by
PrefillReading your promptThe wait before the first tokenCompute
DecodeWriting the answerHow fast the text streamsMemory bandwidth

Prefill runs many times faster per tokenTokenA chunk of text, usually part of a word. Models read and write in tokens.Read more than decode, so one blended "tokens per second" number hides both. A setup with quick decode can still feel slow if it takes a long time to read a long prompt. That is the usual complaint with agents, which send long prompts.

Most runtimesRuntimeThe software that loads a model file and runs it.Read more report both. Ollama prints them with --verbose.

shell
ollama run qwen3:8b --verbose "Summarise the rules of chess in five lines."

prompt eval rate is prefill. eval rate is decode. LM Studio shows similar stats under each reply, and mlx-lm prints them after each mlx_lm.generate run.

For llama.cpp, use llama-bench. It runs a fixed prefill test and a fixed decode test and prints a table.

shell
llama-bench -m ~/models/model-Q4_K_M.gguf -p 512 -n 128

-p 512 measures prefill on a 512-token prompt. -n 128 measures decode over 128 tokens. Each test repeats several times and reports the mean and spread.

Add -p 8192 to see how prefill holds up on a long prompt.

Rule of thumb

Report decode speed for chat and prefill speed for agents. Report time to first tokenTime to first tokenHow long you wait before the first word of the answer appears.Read more for anything a person waits on.

To judge whether a number is good enough, compare it with how people feel speed. Reading pace is about 7 to 15 tok/s.

Speed thresholds
Use caseSpeedScaleWhy
Batch or overnightunder 10 tok/s is fineThroughput per dollar matters more than latency.
Reading-speed chat10 to 30 tok/sHuman reading is about 7 to 15 tok/s. 15 and up feels comfortable.
Coding assistant30+ tok/sPlus fast prefill. Large prompts need a quick time to first token.
Agent loops50+ tok/sMulti-step tool calls multiply token counts. Reasoning models emit thousands of thinking tokens.

As of 27 Nov 2026

Cold versus warm

The first request after loading is slower than the rest. The model may be loading from disk, the GPU may be warming up its kernels, and no prompt cache exists yet.

Measure both, and label which is which.

  • Cold is the first request after the runtime starts. It includes load time. It is what you feel after a reboot or after the model unloads.
  • Warm is a repeat request with the model already loaded. It is what you feel all day. Compare runtimes and settings on warm numbers.

Throw away the first run when you measure warm speed. Then run at least three times and take the middle result.

The catch

A warm repeat of the same prompt can hit the prompt cache and skip prefill entirely. That makes prefill look instant. Change one word at the start of the prompt between runs, or turn caching off, when you want a real prefill number.

A standard prompt set

Use the same few prompts every time. Then a change in the number comes from your change, not from the prompt. We suggest three, saved in files you keep next to your notes.

PromptShapeWhat it measures
Short question, long answerAbout 50 tokens in, ask for about 500 outDecode speed
Long document, short answerPaste about 8K tokens of text, ask for a two-line summaryPrefill speed and time to first token
Agent turnA long system prompt with tool definitions, then a short taskWhat a coding agent feels

Fix the answer length where the runtime allows it, with a max tokens setting. Otherwise one run writes 200 tokens and the next writes 900, and the averages drift.

Write down the setup next to every number: the model file and quantizationQuantizationStoring each weight with fewer bits so the model takes less memory.Read more, the context size, the runtime and its build or version, the backendBackendThe hardware path an engine uses: Metal, CUDA, Vulkan, ROCm or CPU.Read more, and the machine. Without those, a number cannot be compared with anything. How do I test a model for my own use? covers measuring quality, which is a separate job.

Try it
shell
ollama run qwen3:8b --verbose "Explain how a refrigerator works in about 300 words."

Run it three times. Note the middle eval rate. That is your baseline for every change on How do I make it faster?.

Reading other people's claims

A benchmark on a forum or a launch page is only comparable to yours if four things match.

  1. Same model file. Not just the model name, the exact upload. Two GGUFs of one model from different uploaders can differ.
  2. Same quantization. Q4_K_M and Q8_0 differ in decode speed by close to two times.
  3. Same context. Speed at an empty context is far better than at 32K tokens of history.
  4. Same build. A runtime version from three months apart can differ by a wide margin on new models.

Check also what is being reported. Many claims quote decode only, at a near-empty context, with a short prompt. That is the best case.

Your agent will see prefill-heavy traffic at a full context.

Vendor numbers, for hardware or software, are vendor-reported until someone independent repeats them. Treat a claim with no stated setup as a rumour.

Go deeperThat's enough

Measuring over the API

If you want numbers from your own code, time it yourself. Record when the request starts, when the first streamed token arrives, and when the last one arrives.

Time to first token covers network, queueing and prefill. The rest, divided by the tokens written, is decode speed. The usage field in the response gives the token counts. llama-server also returns a timings object with its own measurements.

Variance

Laptops throttle when hot, and the second minute of a long run can be slower than the first. Plug in, close other heavy apps and keep the machine on a hard surface. On a desktop GPU, check the card is not also driving a busy display.

Run enough repeats that the spread is small next to the difference you are measuring. A gap smaller than the run-to-run noise is no gap.

Throughput under load

Single-user speed and multi-user throughput are different benchmarks. For a server, you send many requests at once and measure total tokens per second plus per-user latency. vLLM ships a benchmark tool for this. What changes when many people use one model? explains how to read those results.