Marigold examples / benchmark-llm

benchmark-llm

marigold registry add https://www.bayis.co.uk/marigold-examples/
marigold application install benchmark-llm
Version0.1.0
Models55 declared
Archivebenchmark-llm-0.1.0.tar.gz
sha2568bfd33654cbfbcb62d452b3d60f9ce58556e942ee19cd359f4602f282e0aaa01

Submits a fixed prompt set to every instruct model in a running Marigold deployment and records timing, token counts, VRAM, and power draw per response. Safe to re-run – each request’s ID is a hash of its contents, so resubmitting already-completed work is just a cheap cache-status check, not a re-run.

Used to build the analysis in AI-Wales/build-llm-power-sampling.

Setup

pip install requests

Run

Start the deployment with the models you want to benchmark declared in models.yaml:

marigold deployment start marigold-examples/benchmark-llm

Run the benchmark against it:

python run_benchmark.py --base-url http://localhost:8000 --user-id benchmark --out results/run1.csv

--user-id is required and can be any string – Marigold doesn’t require authentication, it just tags requests by this value.

Re-run the same command later to pick up anything that finished since – results are appended fresh each run, nothing is skipped by tracking state.

Options

Note: --max-tokens is accepted but currently has no effect – each prompt in prompts.jsonl carries its own max_tokens, which always takes precedence.

Regenerating the prompt set

prompts.jsonl is already built and committed. Only needed if you’re changing the prompt set itself:

python build_prompts.py

Three prompt groups: varying_context (system prompt length, short through long), structured (JSON-schema-constrained output), long_form (long generations, for sustained power/VRAM sampling). Edit the topic and template lists in build_prompts.py to grow the set – prompts are generated combinatorially, not hand-written.

Full walkthrough