Project: build a multi-engine LLM benchmark platform
A multi-week portfolio brief: build a harness that runs the same workloads against several serving engines (for example vLLM, SGLang, llama.cpp and TensorRT-LLM), measures them with open-loop load, records full provenance and publishes comparable results with confidence intervals. Includes the fairness rules, a results schema, milestones, a rubric and the questions reviewers ask.
By Sandip Maity, Applied AI Engineer
Key takeaways
- A benchmark platform is mostly about fairness and provenance: same model, precision, prompts, output lengths and hardware, and a record of every version and flag.
- Use open-loop arrivals and report latency percentiles at fixed request rates, plus goodput against a target. Closed-loop loads hide queueing.
- Count tokens yourself with the model's tokenizer. Engines report usage differently.
- Report intervals, not single numbers: repeat runs and use a bootstrap interval to say whether two engines really differ.
- Run each engine both at its defaults and with a documented tuned configuration, so the comparison is about engines, not about who tuned more.
Goal: build a platform that runs the same LLM serving workloads against several engines, measures them the same way, and publishes results that another engineer could rerun and trust. The headline deliverable is a results page with a short write-up; the real deliverable is the harness and its rules.
You need: Python, Docker, and four to six weeks part-time. The harness can be built and tested on a laptop with llama.cpp and a small model; the final comparison needs one GPU you can rent by the hour. Background: benchmarking done properly, the baseline-to-3× lab, engines compared from the inside and how to build a portfolio project.
Honest limits. Your results hold for your hardware, models, versions and workloads, on the day you ran them. Engines change monthly. The platform's value is that it makes the comparison repeatable, not that it crowns a winner. Say that in the write-up.
#The brief
Build a harness that takes a matrix of engines × models × workloads × request rates, starts each engine in a pinned container, warms it up, drives it with open-loop load, collects client-side and engine-side metrics, and writes one record per run with full provenance. Then publish a comparison of at least three engines on one model and two workloads.
flowchart LR CFG[Matrix config<br/>engines, models,<br/>workloads, rates] --> ORC[Orchestrator] ORC --> ENG[Engine container<br/>pinned image digest] ORC --> LG[Open-loop<br/>load generator] LG -->|streaming requests| ENG ENG -->|/metrics| COL[Collector] LG --> COL COL --> DB[(Results store<br/>one record per run)] DB --> REP[Report: tables,<br/>curves, intervals]
#Minimum version
- Engine adapters. A small adapter per engine: how to start it (image, command, flags), how to check it is ready, and its OpenAI-compatible endpoint. Start with three that cover different designs, for example vLLM, SGLang and llama.cpp's
llama-server. TensorRT-LLM (trtllm-serve) or Ollama make good fourth entries. - Workloads as data. Each workload is a file of prompts plus a target output length per request, generated once with a fixed seed and checked in. At minimum: chat (short prompts, about 200-token outputs) and RAG (prompts of several thousand tokens, short outputs). A third with a shared system prompt shows prefix caching.
- Open-loop load generator. Poisson arrivals at a fixed rate, streaming, timestamps for send, first token and every token, and timeouts.
code/benchmarking/loadgen.pyfrom the course is a starting point. Make sure the generator itself is not the bottleneck: check that it keeps the schedule at your highest rate against a fake server (code/benchmarking/fake_server.py). - Fixed output lengths. Ask for exactly the target number of tokens where the engine supports ignoring the end-of-sequence token (vLLM and SGLang accept
ignore_eos; check each engine's docs). Otherwise record the real output length and compare per-token metrics only. - Your own token counts. Count prompt and output tokens with the model's tokenizer from the streamed text, and compare with each engine's reported
usage. Flag runs where they disagree. - Provenance. Every record stores: engine and version, image digest, every flag, model and revision, precision, GPU model and count, driver and CUDA version, the workload file's hash, the rate, the seed, the harness's git commit and the start time.
- Results and report. One JSON line per run with the raw per-request timings in a side file. A script turns them into tables and curves: output tokens per second, TTFT and inter-token latency at p50, p95 and p99 against request rate, and goodput against a stated SLO.
- Repeats and intervals. At least three runs per cell. Report the median across runs and a bootstrap interval (the course's
code/benchmarking/bench_stats.pyhas one).
#The fairness rules
Write these in the README and stick to them. Reviewers check them first.
| Rule | Why |
|---|---|
| Same model weights and precision for every engine, or the difference stated in the table | A quantised model is a different model |
| Same prompts, output lengths, arrival schedule and seed | Otherwise you compare workloads, not engines |
| The same chat template applied (check one rendered prompt per engine) | A wrong template changes prompt length and output quality |
| Warm-up before measuring, and the warm-up excluded | First requests pay for compilation, graph capture and cache filling |
| Each engine at its defaults and with a documented tuned config | Defaults show the out-of-the-box experience; tuning shows the ceiling. Both are fair if labelled |
| One quality spot check per engine (a few greedy outputs, or a small eval) | Catches a misconfigured engine that is fast because it is wrong |
| Nothing else running on the GPU | Check nvidia-smi before each run and record it |
#Stretch goals
- Engine metrics alongside client metrics. Scrape each engine's
/metricsduring the run (running and waiting requests, KV cache usage, prefix cache hits where exposed) and plot them next to latency. This is what turns "engine B is slower at 8 requests per second" into "engine B starts queueing at 8 requests per second because its KV cache is full". - A sweep that finds the knee. Search for the highest rate that still meets the SLO for each engine, instead of a fixed list of rates.
- Regression mode. Run a small fixed matrix nightly against a pinned engine and a "latest" engine, and flag changes larger than the interval.
- A second GPU type, to show which conclusions change with hardware.
- Cost per million tokens at the SLO-limited rate, using a stated hourly price (capacity planning and cost).
The rest is Pro
Keep reading this full lab
Pro unlocks this full lab, every advanced lesson, the hands-on labs and completion certificates.
One year
$25
365 days, no auto-renewal
Lifetime Best value
$75
pay once, keep it forever
7-day refund, no questions asked. One payment, no auto-renewal.Compare plansHave a licence key?
Not ready? Keep learning free
Free lessons from Portfolio Projects, no sign-up. Or follow the free roadmap →
Not ready? Take the free 5-day email course
One short email a day for five days, each built on a free lesson, then the occasional new lesson or offer. Unsubscribe in one click.
Still to come in this lab
- Milestones
- What a good result looks like
- Rubric
- What a reviewer will ask you
- Checklist
- Where to go next
You will be able to answer
- Why does the harness send requests on a schedule instead of waiting for each reply before sending the next?
- Engine A reports 10% more output tokens per second than engine B on the same run. What should you check before believing it?
- Two engines' median TTFT differ by 4%, and the bootstrap intervals overlap a lot. What does the report say?
- Why store the container image digest, driver version and every engine flag with each result?