--- license: apache-2.0 pretty_name: llm-serving-bench language: [en, de] task_categories: [text-generation] tags: [benchmark, llm-serving, inference, speculative-decoding, long-context, local-llm] size_categories: [n<1K] configs: - config_name: short data_files: short.jsonl - config_name: code data_files: code.jsonl - config_name: agent data_files: agent.jsonl - config_name: long data_files: long.jsonl --- # llm-serving-bench (v3.3) **A small benchmark for the single-stream serving speed of OpenAI-compatible LLM servers.** It answers the questions you have when you run a model on your own GPU: - How fast does the server write on everyday prompts? - How fast does it write code? - How fast does it read a long prompt? - How fast does it write once the context is deep? - How fast does it answer a coding agent that resends its whole conversation every turn? It takes about 2 minutes for the short and code sets, plus a few minutes per long window, against any server with a streaming `/v1/chat/completions` endpoint: vLLM, SGLang, llama.cpp, TensorRT-LLM, ingine, etc. Its prompts come from public datasets that are already widely used, so its numbers can be compared. ```bash curl -LO https://huggingface.co/datasets/Francesco/llm-serving-bench/resolve/v3.3/bench.py python3 bench.py --url http://127.0.0.1:8003/v1 --out result.json --label "my-gpu" python3 bench.py --url ... --short-only # skip the long prompts (about 2 minutes) python3 bench.py --url ... --windows 4K,8K,16K,32K # only the long windows your server's context holds python3 bench.py --url ... --temperature 1 # sample as most models are served (speculative decoding accepts less) python3 bench.py --url ... --repeat-long 3 # also repeat 224K and 512K (the windows up to 32K run 3x by default) ``` - **Python standard library only.** The script downloads the four data files once (revision `v3.3`) into `~/.cache/llm-serving-bench` (move it with `--cache` or `LLM_SERVING_BENCH_CACHE`), so the timed part never touches the network. - **Warm-up first:** one short request and one ~4K-token prompt, untimed. - **Output:** one JSON with every request, and one markdown table. ## What it measures | set | prompts | what it tells you | metric | |---|---|---|---| | **short** | 60 | everyday writing: chat, translation, summaries, Q&A, math, RAG | decode tok/s, time to first token (median and p90) | | **code** | 20 | writing code | decode tok/s, time to first token | | **agent** | 3 sessions × 8 turns | a coding agent: system prompt with its tools, the issue, then tool outputs, each turn resending the conversation | decode tok/s, time to first token of the follow-up turns (how well the server reuses the conversation it already read) | | **long** | 1 question × 6 windows (4K, 8K, 16K, 32K, 224K, 512K tokens) | reading a long code repository, then writing at that depth | prefill tok/s, time to first token, decode tok/s at depth, the answer | **How each number is measured:** - **Decoding:** every request is streamed with `temperature 0`, so two runs or two servers that agree produce the same tokens. Each request is timed on the wire. - **Decode tok/s:** tokens after the first ÷ the time from the first to the last streamed token. A set's number is token-weighted, so long answers count more than short ones. - **Prefill tok/s:** prompt tokens ÷ time to first token. This is request 1 of the long set. - **Repeats, like `llama-bench`:** - **Windows up to 32K:** run 3 times and reported as mean ± standard deviation. A short prefill takes well under a second, so one run would mostly measure timer noise. - **224K and 512K:** run once by default (`--repeat-long N` for more), since each costs from 30 s to minutes. - **No cache reuse between runs:** every run starts with its own tag, so no run is served from another run's prefix cache. - **Short sets:** one pass over many prompts, as vLLM's `bench_serving` does: the prompts do the averaging. - **Decode at depth:** request 2 continues the same conversation ("Explain your answer step by step."). A server that keeps the conversation's cache only reads the new turn, so this times writing with the whole window in context. - **Speculative decoding** (drafters, MTP, EAGLE, …) is measured as it is served: on varied, realistic text. That is why the short set is Spec-Bench, the standard benchmark for speculative decoding. Run once with speculation on and once off to see what it buys. ## The data | file | contents | source (pinned) | licence | |---|---|---|---| | `short.jsonl` | the first 10 first-turn questions of each of Spec-Bench's 6 tasks: multi-turn conversation (MT-Bench), translation (WMT14 DE-EN), summarization (CNN/DM), question answering (Natural Questions), mathematical reasoning (GSM8K), retrieval-augmented generation. At most 256 new tokens. | [hemingkx/Spec-Bench](https://github.com/hemingkx/Spec-Bench) commit `fd2c1cd7d220` | Apache-2.0 | | `code.jsonl` | HumanEval problems 0–19 as "Complete this Python function. Reply with code only." plus the function stub. At most 384 new tokens. | [openai/openai_humaneval](https://huggingface.co/datasets/openai/openai_humaneval) rev `7dce6050` | MIT | | `agent.jsonl` | the first 3 SWE-agent sessions of nebius/SWE-agent-trajectories (real agent runs on a GitHub issue), cut to their first 8 user turns, with the recorded agent replies between them. At most 256 new tokens per turn. | [nebius/SWE-agent-trajectories](https://huggingface.co/datasets/nebius/SWE-agent-trajectories) rev `68195a14` | CC-BY-4.0 | | `long.jsonl` | one LongBench v2 *Code Repository Understanding* question (`66fa208bbb02136c067c5fc1`: a 1.9M-character Python repository, mpmath), with its four choices and the answer. At most 256 new tokens. | [zai-org/LongBench-v2](https://huggingface.co/datasets/zai-org/LongBench-v2) rev `2b48e494` | Apache-2.0 (the repository text keeps its own open-source licence) | **Long windows:** 4K = 4,096 tokens, 8K = 8,192, 16K = 16,384, 32K = 32,768, 224K = 229,376 and 512K = 512,000. The first four line up with the context depths `llama-bench -d` reports. - **Cut:** the repository is cut from the middle (keep the start and the end, as LongBench does) so that prompt and answer fit the window, with LongBench v2's official prompt template. - **Tokens:** the script measures the model's tokens per character on the warm-up prompt (a 12,000-character slice of the same repository), so every model gets prompts that fill its own window. - **Windows that don't fit:** a window larger than the server's reported context (`/v1/models` `max_model_len`), or one the server refuses, is reported as `does not fit`. `build_dataset.py` rebuilds the three files from the pinned sources. ## Results Inkling-2-Mini on one 24 GB GPU, 2026-11-27. Each engine serves its best setup at the same 245,760-token context where it fits, plus [ingine](https://github.com/FrancescoSaverioZuppichini/inkling-2-mini-abliterated-ingine) at 512,000. Greedy, one request at a time, every engine with its drafter as it ships (strata's tuner turns its own off on the 3090). The raw JSON of every run is in `results/`. **RTX 3090 · 300 W** (tokens/s unless marked) | | ingine INT8 + k8v4 · 245K | ingine BF16 · 245K | vLLM · 245K | strata · 245K | ingine INT8 + k8v4 · 512K | |---|---:|---:|---:|---:|---:| | **decode, all short + code** | **223.0** | 189.5 | 157.6 | 82.5 | 221.2 | | decode, chat (MT-Bench) | **185.6** | 153.8 | 118.0 | 82.8 | 184.7 | | decode, code (HumanEval) | **239.8** | 210.6 | 183.2 | 81.3 | 237.9 | | decode, coding agent | **272.5** | 234.8 | 209.8 | 78.4 | 271.9 | | agent follow-up, time to first token | 0.20 s | 0.20 s | 0.23 s | 0.57 s | 0.20 s | | prefill 4K / 32K | 5,208 / 4,890 | 5,213 / 4,899 | 4,571 / 4,102 | 1,815 / 1,706 | 5,190 / 4,863 | | prefill 224K | **3,070** | 3,026 | 1,676 | 783 | 3,044 | | time to read the 224K prompt | **73.9 s** | 74.9 s | 135.3 s | 289.7 s | 74.5 s | | decode at 32K / 224K depth | **216.9 / 160.4** | 188.1 / 115.1 | 161.5 / 89.6 | 72.3 / 5.2 | 216.1 / 160.2 | | 512K prompt | | does not fit | does not fit | not run | **2,012 prefill · 102.8 decode** | **RTX 4090 · 400 W** | | ingine INT8 + k8v4 · 245K | ingine BF16 · 245K | vLLM · 129K (its maximum) | ingine INT8 + k8v4 · 512K | |---|---:|---:|---:|---:| | **decode, all short + code** | **289.2** | 228.8 | 209.3 | 289.1 | | decode, chat (MT-Bench) | **233.6** | 184.3 | 160.1 | 233.4 | | decode, code (HumanEval) | **325.3** | 244.8 | 231.9 | 325.2 | | decode, coding agent | **337.1** | 283.1 | 309.2 | 337.2 | | agent follow-up, time to first token | 0.094 s | 0.096 s | 0.115 s | 0.094 s | | prefill 4K / 32K | 10,973 / 10,769 | 11,056 / 11,081 | 9,949 / 9,563 | 11,014 / 10,768 | | prefill 224K | 7,283 | **7,661** | does not fit | 7,281 | | time to read the 224K prompt | 31.1 s | **29.6 s** | does not fit | 31.1 s | | decode at 32K / 224K depth | **281.0 / 224.2** | 218.2 / 161.8 | 218.1 / does not fit | 281.0 / 224.2 | | 512K prompt | | does not fit | does not fit | **4,976 prefill · 127.1 decode** | **The setups:** | | weights | KV cache | drafter | version | |---|---|---|---|---| | ingine INT8 + k8v4 (`start.sh`) | NVFP4 experts as shipped; INT8 dense (qkv, `wo`, heads) | k8v4: 8-bit keys, 4-bit values | DSpark, threshold 0.8 | this PR (the 3090 rows ran on `3bfecfa`; the GEMM pin changes nothing there) | | ingine BF16 | NVFP4 experts; BF16 dense, the checkpoint as shipped | int8 (3090) / FP8 (4090), each GPU's default | DSpark, threshold 0.8 | this PR (the 3090 rows ran on `3bfecfa`; the GEMM pin changes nothing there) | | vLLM | NVFP4 experts; int8 qkv, LM head, Markov head and drafter; BF16 rest | FP8 on the 3090; BF16 on the 4090 (the recipe enables FP8 KV only on sm_86 and sm_120), so 129,280 tokens there | DSpark, 7 tokens | `vllm/vllm-openai` nightly `7cb5dae22` + [inkling2-mini-3090-recipe](https://github.com/lulakien/inkling2-mini-3090-recipe) `9f246b3`, the only vLLM setup for Inkling on Ampere/Ada | | strata | SQ-20 (strata's own quant) | FP16, its default for Inkling: 77K tokens fit on the GPU, the rest of the 245,760 sits in host RAM | off (strata's tuner: 1.06× is below its 1.10× bar) | strata 0.2.22, Inkling engine 0.1.69 | **How to read the tables:** - **Runs:** windows up to 32K are the mean of 3 runs (prefill spread under 2 %). 224K and 512K are one run each. - **Decode at depth** moves between runs: the answer text changes the drafter's acceptance. - **Context:** the context limit itself costs ingine no speed. 245K and 512K give the same numbers. - **strata at 224K:** only 77K tokens of its KV fit on the GPU; the rest is read from host RAM over PCIe, so it decodes at 5.2 tokens/s there. ## Why it looks like this - **Small on purpose.** It is a speed benchmark, not a quality benchmark: 105 requests are enough for stable speed numbers, and a full run takes minutes, so you can run it after every change. The long question's answer is reported as a sanity check, not as a score. - **Widely used sources.** Spec-Bench is the benchmark speculative-decoding papers report. HumanEval is the most common code prompt set. LongBench v2 is a standard long-context benchmark with real code repositories. - **Single stream.** One request at a time: the case of a person or a coding agent on their own GPU. Throughput under many concurrent users is a different benchmark (see vLLM's `benchmark_serving`). - **Greedy by default.** Same tokens on every run, so two builds or two servers can be compared token for token. `--temperature 1` shows what speculative decoding gives when the model samples, as most chat clients use it. ## Citation If you use it, please cite the sources: Spec-Bench (Xia et al., 2024), HumanEval (Chen et al., 2021), LongBench v2 (Bai et al., 2024) and the SWE-agent trajectories (Nebius, 2024).