AIForum.

How to Benchmark Local LLM Speed: Tokens per Second, Latency, and Memory Usage

On this page

THE SHORT ANSWER

A single tokens-per-second figure cannot tell you whether a local model is fast enough for your workload. This guide explains the metrics that actually describe an endpoint — time to first token, time per output token, end-to-end latency, throughput, and memory — and how to run a measurement someone else can reproduce.
Quick facts

Benchmarking a local model with one tokens-per-second figure produces a number that cannot be interpreted on its own. A tokens-per-second value describes a particular run, and it only becomes useful when you know what was running, how it was measured, and how many requests were in flight at the same time. The more honest deliverable is a curve: latency plotted against offered load, from which you read the highest request rate that still meets your latency target.

This guide is for technically curious beginners and intermediate practitioners running models on their own hardware. It defines the measurements that describe a local endpoint, explains how memory use is actually composed, and gives a test protocol you can repeat and share. It does not report benchmark scores, because no hardware, model, or configuration was tested for this article.

The four measurements that describe a local endpoint

According to a detailed treatment of inference benchmarking at dreaming.press, four metrics describe an LLM endpoint, and each answers a different question:

  • Time to first token (TTFT) — how long the user waits before anything appears. It is set by prefill, the stage that processes the input prompt.
  • Inter-token latency (ITL), also called time per output token (TPOT) — the gap between successive output tokens. It is set by decode, the stage that generates the answer.
  • End-to-end latency — total wall-clock time for a complete answer.
  • Throughput — output tokens per second, or requests per second, across all requests being served.

These are not interchangeable. Generation speed measures output tokens; prompt processing measures how quickly the input is handled. Neither number alone tells you how long a complete answer takes, and a long prompt can mean a substantial wait before the first output token appears. A benchmark report that gives only one of these figures is describing a slice of the system, not the system.

End-to-end latency is meaningless without an output length

The relationship is approximately:

end-to-end latency ≈ TTFT + (TPOT × number of output tokens)

Because the second term scales with output length, quoting an end-to-end latency without stating how many tokens were generated makes the number uninterpretable. A 20-token reply and a 2,000-token reply from the same model on the same hardware will produce very different totals, and the difference is arithmetic rather than a change in performance.

Why one tokens-per-second number misleads

Offered load is part of the measurement

A throughput figure quoted without its offered load cannot be interpreted. You must state whether the run was closed-loop (a fixed number of concurrent requests) or open-loop (a fixed request rate, such as Poisson arrivals). The two designs answer different questions and produce different tail latencies. Aggregate throughput adds up tokens across concurrent requests, which is useful for sizing a server for many users, but it is not the speed any single person sees. If a report does not specify concurrency, do not assume its figure describes a single conversation.

Averages hide the tail users actually feel

Report p50, p90, and p99 rather than the mean. The average can look healthy while the slowest one percent of requests — the ones users complain about — are far worse. Tail latency is exactly what a latency-vs-throughput curve reveals: as you sweep offered load upward, latency eventually climbs while throughput stops rising. The knee of that curve is where extra concurrency buys you nothing but delay. The maximum request rate at which p99 still meets your service-level objective is the number worth quoting; this is the goodput framing.

Workload shape changes which part of the GPU is stressed

The same hardware looks dramatically faster or slower depending on the mix of input and output lengths. Prefill-heavy workloads — retrieval-augmented generation, summarization, long-document analysis — stress prompt processing. Decode-heavy workloads — chat, code completion — stress token generation. A benchmark run on short chat prompts tells you very little about how the same machine will behave on long-context summarization.

How memory use is actually composed

Model weight size is not total memory use. Three components matter, and only the first is fixed by the model file.

1. Weights

Weight memory is roughly the parameter count multiplied by the bytes stored per parameter. This is arithmetic, not a measured result: FP16 stores 2 bytes per parameter, 8-bit quantization stores 1 byte, and 4-bit quantization stores approximately 0.5 bytes, before accounting for any per-block scale or zero-point metadata that a particular quantization format adds.

2. KV cache

The key-value cache holds attention state for every token in context, for every concurrent sequence. Its size grows with context length and with the number of simultaneous requests, which is why a configuration that fits comfortably at short context can run out of memory once you raise the context window or serve several users at once. A general shape for the calculation is:

KV bytes ≈ 2 × layers × KV heads × head dimension × context length × batch × bytes per element

The leading 2 accounts for both keys and values. KV-cache settings and context length are among the configuration details that change benchmark results, so they belong in any report. Some engines allow the cache to be quantized, which reduces this term at some cost to quality.

3. Runtime overhead

Beyond weights and cache, a runtime needs memory for activations, framework buffers, and its own context. This overhead is not captured by the size of the model file, and it is one reason a model that “should fit” on paper may fail to load or may fall back to slower paths.

A VRAM calculator can estimate memory use and, where hardware data exists, speed, and it may also surface community measurements. Treat those community numbers as evidence about one specific setup, not a guarantee for yours; open the report and its source to check the conditions behind it.

A reproducible measurement protocol

The following protocol follows the reproducibility requirements described in the benchmarking guide at llamaperf.com. It produces results you can compare against your own later runs, and that others can attempt to reproduce.

  1. Fix and record the environment. Note GPU count and model, total GPU memory, system RAM, operating system, runtime and engine version, model name and version, quantization, context length, KV-cache settings, and sampling parameters. A comparison missing these details is incomplete.
  2. Choose prompts representative of your task. If your real workload is long-context summarization, do not benchmark with short chat prompts. Include at least one prefill-heavy and one decode-heavy case if you serve both.
  3. Separate loading from warmed-up runs. Model loading and first-request compilation are not steady-state performance. Discard warm-up runs and measure only after the system has stabilized.
  4. Repeat the workload and retain every result. Keep the raw per-run output rather than only a summary. Variation between runs is information, not noise to be hidden.
  5. Sweep offered load. Run a series at increasing concurrency or request rate to build a latency-vs-throughput curve, rather than measuring a single point.
  6. Report percentiles, not just averages. Include p50, p90, and p99 for TTFT, TPOT, and end-to-end latency.
  7. Use observed token counts. Count the tokens actually generated, not the requested output limit, because a model may stop early.
  8. Disclose input caching and background activity. Prompt caching can make repeat runs look faster than cold ones, and other processes competing for the GPU can make them look slower.

Record memory alongside speed: peak GPU memory during the run, and whether any layers were offloaded to CPU. CPU offloading lets a model use memory outside the GPU, but it changes performance, so a result obtained with offloading is not comparable to one without it.

Reading someone else’s benchmark

When you evaluate a published number, work through the same checklist in reverse:

  • Is the hardware setup complete — GPU count, total memory, system RAM, and any mixed GPU models in the notes?
  • Are generation and prompt processing reported separately?
  • Is concurrency or request rate stated, and is the loop design named?
  • Is the model the same size and quantization, with matching context length, engine version, KV-cache settings, and speculative decoding?
  • Is the figure a measurement or an estimate? A calculator estimate and a warmed-up measured run are different kinds of evidence.
  • Are percentiles reported, or only a mean?

If several of these are missing, the number is not wrong — it is simply not yet comparable to anything.

Tools that produce these measurements

Several established tools implement the load-sweep approach: vLLM’s vllm bench serve, NVIDIA’s AIPerf (which the source notes has superseded GenAI-Perf), Ray’s llmperf, and GuideLLM for SLO-driven sweeps. For standardized cross-system comparisons, MLPerf Inference and InferenceMAX provide common methodology. Using one of these is usually faster and less error-prone than writing a bespoke harness, and it makes your results easier for others to interpret.

Common pitfalls and honest limits

Two classic mistakes are worth naming: benchmarking only at concurrency 1, which tells you nothing about serving behavior, and mixing tokenizers between systems being compared, which makes token counts — and therefore tokens per second — non-equivalent. Beyond those, remember that a result is evidence about one setup. Engine versions change performance, quantization formats differ, and a community report from a similar GPU is a starting point for your own measurement rather than a substitute for it. If you cannot measure at all, state the gap explicitly instead of extrapolating from someone else’s curve.

What to do next

Pick one prompt that resembles your real task. Run it at least three times after warm-up on fixed settings, and record TTFT, TPOT, end-to-end latency, observed output token count, and peak memory. Then raise concurrency and repeat until latency climbs sharply without throughput rising. That small dataset will tell you more about your machine than any single published tokens-per-second figure. If you would like help interpreting a result, share your hardware, runtime version, model, quantization, context length, concurrency, and the raw per-run numbers in the community discussion.

FAQ

Why is my tokens-per-second result different from a published number for the same GPU?

Published figures depend on the whole setup: GPU count, total memory, system RAM, CPU offloading, model size and quantization, context length, engine version, KV-cache settings, speculative decoding, concurrency, and prompt shape. If any of these differ, the numbers are not comparable. Check the report's conditions before assuming your hardware is underperforming.

Is benchmarking at concurrency 1 useful?

It describes a single conversation, which can be useful for a personal setup, but it says nothing about serving behavior. Benchmarks at concurrency 1 are flagged as a classic mistake when the goal is to understand an endpoint under load. Aggregate throughput across concurrent requests is a different measurement from the speed one user sees.

How much memory does a local model need?

More than the weight file. Budget for weights (parameter count multiplied by bytes per parameter), the KV cache (which grows with context length and concurrent sequences), and runtime overhead for activations and framework buffers. A model that fits at short context may not fit once you raise the context window or serve multiple users.

What single number should I quote from a benchmark?

There is no single number, but the most decision-relevant one is goodput: the maximum request rate at which p99 latency still meets your objective. Quote it alongside the hardware, model, quantization, context length, concurrency, and loop design that produced it.

References

  1. https://llamaperf.com/guides/reading-benchmarks
  2. https://dreaming.press/posts/how-to-benchmark-llm-inference.html

Related terms

TTFT (time to first token)
The delay before the first output token appears; determined by how fast the runtime processes the input prompt.
TPOT / ITL
Time per output token, also called inter-token latency; the gap between successive generated tokens, determined by the decode stage.
Prefill vs decode
Prefill processes the input prompt in one pass; decode generates output tokens one at a time. They stress the GPU differently and are measured separately.
KV cache
Attention state stored for every token in context and every concurrent sequence; its size grows with context length and batch size.
Closed-loop vs open-loop load
Closed-loop holds a fixed number of concurrent requests; open-loop offers requests at a fixed rate. They answer different questions and yield different tail latencies.
Goodput
The highest traffic level a system can serve while still meeting a stated latency objective, read from the knee of a latency-vs-throughput curve.

Leave a Reply

Your email address will not be published. Required fields are marked *