Zero-dependency mixed-load benchmark, trace replayer, and live TUI monitor for OpenAI-compatible LLM servers (vLLM, SGLang, llama.cpp, TensorRT-LLM, Hyperflare, Ollama, etc.). Requires Python 3.10+ (stdlib only) on Linux, macOS, and Windows.
Includes pure isolated prefill + decode matrix sweeps (Context × Concurrency with auto KV-cap & max-concurrency skipping), seeded fluctuating random-mix (C/2..C random workload chaos), one-command head-to-head ab runs, mid-stream disconnect & KV-leak resilience (abort-storm / --cancel-rate), strict tokenizer-calibrated prompt sizing (--token-sizing strict|approx), reasoning TTFA / Think% tracking (--no-thinking, --reasoning-effort), multimodal vision + strict JSON Schema + streaming tool-calling validation, adaptive find-max goodput search, zero-CDN interactive HTML Pareto & Historical Trend (open --trend) dashboards, live [D] Details overlay, high-concurrency asyncio HTTP/1.1 keep-alive transport (C=128+), pre/post canary integrity checks, 5-minute soak stability grading, and side-by-side regression gating.
curl -fsSLO https://github.com/FujitsuPolycom/tokbench/releases/latest/download/tokbench.pyz# Interactive 3-tab TUI launcher (Core / Capabilities / All; press D during any run for live details)
python3 tokbench.pyz
# Auto-sized mixed-load run (probes server max_concurrency, fallback mixed-c32)
python3 tokbench.pyz http://127.0.0.1:8000
# Pure isolated prefill + decode throughput matrix (Context × Concurrency)
python3 tokbench.pyz matrix host:8000 -c 1,4,8,16 --contexts 0k,8k,32k,64k --open
python3 tokbench.pyz matrix host:8000 --prefill-only --contexts 0k,8k,32k,64k,128k
# Seeded variable-concurrency random assortment (fluctuates C/2..C, e.g. 4-8 at C=8; repeatable with --seed)
python3 tokbench.pyz host:8000 --scenario random-mix -c 8 --seed 42
# Head-to-head A/B benchmark across two endpoints with side-by-side HTML + regression gate
python3 tokbench.pyz ab hostA:8000 hostB:8000 --label-a "Main" --label-b "PR-123" --scenario mixed-c32 --fail-on-regression 5% --open
# Adaptively find max sustainable goodput under SLO (exponential ramp + bisection)
python3 tokbench.pyz find-max host:8000 --target-slo 90 --max-rps 64
# 5-minute all-in-one proving ground with 1m stability checkpoints + pre/post canary check
python3 tokbench.pyz host:8000 --scenario soak-5m --canary --label "endpoint-A"
# Disconnect resilience & post-drain KV/slot leak check (20% mid-prefill/decode TCP aborts)
python3 tokbench.pyz host:8000 --scenario abort-storm
# Multimodal vision, strict JSON schema grammar, streaming tool calling, or high-concurrency asyncio stress
python3 tokbench.pyz host:8000 --scenario vision-mixed
python3 tokbench.pyz host:8000 --scenario structured-json --no-thinking
python3 tokbench.pyz host:8000 --scenario tool-calling
python3 tokbench.pyz host:8000 --scenario high-c128 --transport async
# Replay real OpenAI / ShareGPT / prompt JSONL traces (with optional original arrival timing)
python3 tokbench.pyz host:8000 --prompts prod_trace.jsonl --replay-timing
# One-shot cold document/TTP/report analysis (built-in or over any local directory of files)
python3 tokbench.pyz host:8000 --scenario doc-analysis
python3 tokbench.pyz host:8000 --corpus-dir ./reports --template "analyze and give me a summary of {{this}} supplied ttp/report"
# Warm-state A/B with baseline regression gate
python3 tokbench.pyz host:8000 --scenario agentic-coding --discard-first --repeats 2 --baseline tokbench-runs/main.json --fail-on-regression 5%
# List all 28 grouped scenarios / compare / inspect / open graphs & historical trends
python3 tokbench.pyz scenarios
python3 tokbench.pyz compare tokbench-runs/a.json tokbench-runs/b.json --html diff.html --fail-on-regression 5%
python3 tokbench.pyz inspect tokbench-runs/a.json
python3 tokbench.pyz open # Open latest run's interactive HTML graphs in browser (or pass --open on run/ab/compare/inspect)
python3 tokbench.pyz open --latest 2 # Side-by-side comparison graphs of the 2 newest runs
python3 tokbench.pyz open --trend # Chronological Historical Trend Dashboard across saved runsCommon flags: --menu, -c N, -d 90s|5m, --seed N, --contexts 0k,8k,32k, --max-tokens 512, --prefill-only, --decode-only, --kv-budget N, --no-skip, --repeats N, --discard-first, --prompts FILE, --replay-timing, --corpus-dir DIR, --template STR, --transport auto|async|threads, --canary, --cancel-rate 0.20, --token-sizing strict|approx, --no-thinking, --reasoning-effort none|low|medium|high|xhigh, --checkpoint 1m, --mode open-loop --rps 5.0, --rps-stages 2,4,6,8, --mode find-max --target-slo 90 --max-rps 64 --max-steps 7, --hardware TEXT, --notes TEXT, --extra-body '{...}', --open, --no-tui, --no-save.
Adaptive Goodput Finder (tokbench find-max) — Interactivity vs. Throughput Pareto Curve & Reasoning TTFA
python3 build_pyz.py
python3 -m unittest discover -s tests -vMIT License.



