How to record context versions in an AI cost benchmark

Record the versions of the prompt, retrieved inputs, tool definitions and model along with usage. You can then repeat a comparison without confusing changes in supplied context with changes in model pricing.

Example

Two tests use the same base prompt. The second also includes four retrieval chunks and three extra tool definitions, making it more expensive before the model responds.

What to do

  1. Record the versions of the instructions, tools and retrieval corpus while avoiding storage of any private input text.
  2. Log counts for added context by source and compare token counts against the provider's usage record.
  3. Change one variable at a time. When comparing versions, make the changed input visible in the benchmark report.

How to verify

Another run with the same recorded context versions produces similar token usage. A deliberate context change appears in the correct category.

Limits

Token accounting can change across model or API versions. Record which accounting rules you observed.

Spendplane for this workflow

Estimate usage before committing to a model mix

Related reading