Projects / LLM Serving Bench

LLM Serving Bench

CPU inference measured over HTTP/SSE: per-token arrivals, TTFT, TPOT, latency and memory. Eight SmolLM2 configurations with raw evidence and offline replay.

Author: · Python 3.11.13 · License: MIT

Page published: · Page updated:

Repository · Original evidence · Release v0.1.0

Problem and relevance to agents

A tokens-per-second counter does not explain user waiting time or queue formation. This benchmark records each generated and received token to separate time to first token, decoding and total latency.

It supports agent latency budgets with measurements from a real server. Results identify the model, precision, hardware, concurrency and input length needed to interpret a performance number.

Architecture

  1. Measured server. SmolLM2-135M-Instruct in FP32 on CPU, with one generation slot and one SSE event per token ID. Clients connect through loopback HTTP.
  2. Controlled matrix. One or two CPU threads, one or two concurrent clients, and exactly 64 or 256 input tokens. Each configuration processes six recorded prompts after an excluded warmup.
  3. Replayable evidence. Requests, IDs, arrival times, errors, RSS samples and model hashes are retained. A dependency-free verifier recomputes report metrics.

What this demonstrates

  • Token-level instrumentation with explicit metric boundaries.
  • Configuration comparisons with recorded requests and controlled concurrency.
  • Separation of observed resource use, assumed costs and unmeasured variables.

Published results

Published measurement on Intel Xeon W-3223, macOS, Python 3.11.13 and PyTorch 2.2.2. All 48 requests succeeded and generated 1,152 output tokens. Eight warmups are excluded.

TTFT includes connection setup, tokenization, queueing and prefill. TPOT divides the first-to-last token interval by the number of generation intervals. Percentiles interpolate six requests per configuration; throughput uses the complete configuration duration.

Eight measured configurations

Results and analysis ·
Threads / input / concurrencyTTFT p50 (s)TPOT p50 (ms)Latency p95 (s)Output tokens/s
1 / 64 / 10.19662.921.70414.49
1 / 64 / 21.87163.743.35514.35
1 / 256 / 10.65472.022.41510.28
1 / 256 / 23.00272.844.69110.24
2 / 64 / 10.12842.891.14321.50
2 / 64 / 21.25643.242.46020.80
2 / 256 / 10.41448.941.60115.51
2 / 256 / 22.04150.613.23414.93

Two threads produced higher throughput in this sample. Doubling clients mostly added waiting because the server retains one generation slot. Six requests per configuration do not establish an SLA or a general server ranking.

Sampled peak RSS ranged from 838.7 to 1,023.5 MiB. Energy is unmeasured. Reported cost uses an illustrative USD 0.10 per machine-hour allocation; it is not a bill or observed expenditure. Original evidence.

Reproduce

Replay requires Python 3.11 and the standard library. Repeating inference requires model dependencies and downloading public weights; subsequent execution uses local files.

Environment commands use a POSIX shell. Choose a new output directory and run only one compute-intensive measurement at a time. The published lock describes Intel macOS; other systems may need different PyTorch wheels.

Replay saved evidence

git clone https://github.com/lucioduran/llm-serving-bench.git
cd llm-serving-bench
git checkout f291bbe0e3fbd377438b56f4cbf4a7a808720d98
python -m serving_bench verify results/reference/report.json

Repeat the local measurement

python -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements-models.txt
python -m serving_bench download
python -m serving_bench run --output work/reproduction --hourly-usd 0.10
python -m serving_bench verify work/reproduction/report.json

Scope and limitations

  • One model, host and fixed execution order. Client and server share CPU resources.
  • Closed-loop load without continuous batching, GPU, arrival-rate saturation or answer-quality evaluation.
  • Sampled RSS can miss peaks. Replay checks consistency; it neither measures timings again nor authenticates hardware.

Sources and revision

Values on this page come from the linked report. They are not live measurements. The report records the executed revision; the reviewed revision includes the subsequent publication of that report.