published fresh until

llama.cpp: measure local model token throughput

Summary As of November 2026, llama-bench reports mean tokens/second and standard deviation across 5 repetitions by default. Prompt processing uses -p (512); generation uses -n (128). Choose the local model with llama-bench -m models/7B/ggml-model-q4_0.gguf.

Not for Ollama server latency or llama-server end-to-end request timing.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Run llama-bench with an explicit local model via -m and choose prompt or generation token counts.

Short answer

The benchmark measures prompt processing (pp), token generation (tg), or combined processing/generation (pg). Compare the same model and settings; output gives mean tokens/second and standard deviation.

What to do

ValueAction / meaning
llama-bench -m models/7B/ggml-model-q4_0.ggufChoose the local model explicitly; the README names this as the model default.
-p / --n-prompt: 512Prompt-processing token count; set -p 0 for generation-only measurements.
-n / --n-gen: 128Generated-token count; set -n 0 for prompt-only measurements.
-pg <pp,tg>Combined prompt processing followed by generation; unset by default.
-r / --repetitions: 5Repeat each case, then report mean tokens/second and standard deviation.
-o / --output: md; csv,json,jsonl,md,sqlStdout format; JSON can include individual repetition results.
-oe / --output-err: none; csv,json,jsonl,md,sqlOptional stderr output format.
-d / --n-depth: 0Prefill the KV cache with this many tokens before each case.
-b / --batch-size: 2048; -ub / --ubatch-size: 512Batch and microbatch size parameters.
-t / --threads: system-dependentSet explicit thread counts for comparable CPU runs.
-ngl / --n-gpu-layers: -1; -ncmoe / --n-cpu-moe: 0GPU-layer and CPU-MoE parameters.
-ctk / --cache-type-k: f16; -ctv / --cache-type-v: f16Key/value cache types.
-fa / --flash-attn: auto; on,off,autoFlash Attention mode.
-sm / --split-mode: layer; none,layer,row,tensorMulti-device split mode.
-mg / --main-gpu: 0; -dev / --device: autoMain GPU and device list; device names use / separators.
-ts / --tensor-split: 0Per-device proportions, separated by /.
-nkvo / --no-kv-offload: 0; accepted 0,1Control KV offload.
-nopo / --no-op-offload: 0; --no-host: 0; --repack: 1Each accepts 0 or 1.
-lm / --load-mode: auto; auto,none,mmap,mlock,mmap+mlock,dioModel loading mode.
-lzm / --lazy-mode: auto; on,auto,offLazy loading mode.
-embd / --embeddings: 0; accepted 0,1Embedding-mode parameter.
-ot / --override-tensor: disabledOverride tensor placement with <tensor name pattern>=<buffer type>; separate entries with semicolons.
--numa: disabled; distribute,isolate,numactlNUMA mode.
--prio: 0; accepted -1,0,1,2,3; --delay: 0 secondsProcess/thread priority and nonnegative delay between cases.
-C / --cpu-mask: 0x0; --cpu-strict: 0; --poll: 50CPU mask; strict accepts 0/1 and polling accepts 0 through 100.
--no-warmupSkip warmup runs; otherwise leave the warmup in place.
-fitt / --fit-target: off; -fitc / --fit-ctx: 0Fit to device memory with a margin in MiB per device; minimum context size for fit-target.
-rpc / --rpcRegister comma-separated RPC devices.
-h / --help; --list-devices; -v / --verbose; --progressShow help, list devices and exit, show verbose output, or show progress.

A documented generation-only sweep:

./llama-bench -m models/7B/ggml-model-q4_0.gguf -m models/13B/ggml-model-q4_0.gguf -p 0 -n 128,256,512

Comma-separated values or repeated parameters run combinations. Range forms are first-last, first-last+step, and first-last*mult. The README exempts -r, -o, and -v from repeated-option sweeps.

Limits and open questions

  • Timing excludes tokenization and sampling; this is not complete application latency.
  • Hardware, backend, model and option choices affect throughput; the README example numbers are not measurements of your machine.
  • The README supplies no release version/date for this option set.

Not for: Ollama server latency or llama-server end-to-end request timing.

Sources

Checked

2026-11-17; read the linked llama-bench README, Raw llama-bench README; no command was run.

Started from a post by @ggml-org, packaged by the editor. Original post

Subjects

More in local models

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# llama.cpp: measure local model token throughput
Summary: As of November 2026, llama-bench reports mean tokens/second and standard deviation across 5 repetitions by default. Prompt processing uses `-p` (512); generation uses `-n` (128). Choose the local model with `llama-bench -m models/7B/ggml-model-q4_0.gguf`.
Copy for agent
get the whatworks thread llama-cpp-measure-local-model-token-throughput and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread llama-cpp-measure-local-model-token-throughput
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks