Skip to main content

MizanBench — open LLM cost simulator

Estimate what your LLM workload actually costs — and what smarter routing would save — before you spend a dollar. MizanBench models three strategies over your real traffic numbers:

  • Single model — everything to one model (your baseline)
  • Mix — static traffic split across models
  • Cascade — cheap model tries first, unresolved requests escalate

MizanBench's cascade accounting is deliberately honest: a request that escalates past a cheap tier still pays for that tier's attempt, exactly as real routers bill. Charging every tier a request reaches can make cascade savings smaller than accounting that charges only the tier that resolves it, at the same prices. Where a model is priced in bands, the lowest band is entered, so a prompt above the band's limit costs more than shown (see Pricing catalog).

Quickstart

pip install pyyaml
PYTHONPATH=src python -m mizanbench.cli simulate examples/workload.yaml
# (after `pip install -e .`: just `mizanbench simulate examples/workload.yaml`)

Output for the example workload (examples/workload.yaml in the repository), a 20k-requests/day support assistant:

scenario                                 monthly  per-request    vs baseline
-----------------------------------------------------------------------------
all frontier (GPT-5.6 Sol)             $9,900.00        $0.02       baseline
all mid-tier (Claude Sonnet 5)         $3,540.00    $0.005900         -64.2%
70/30 mix (Flash + Sonnet 5)           $1,580.70    $0.002635         -84.0%
cascade nano -> small -> frontier      $1,285.35    $0.002142         -87.0%

List the pricing catalog:

PYTHONPATH=src python -m mizanbench.cli models

Describe your own workload

Copy examples/workload.yaml and edit:

workload:
  requests_per_day: 20000
  avg_input_tokens: 1200
  avg_output_tokens: 350
  days: 30

scenarios:
  - name: "baseline"
    type: single
    model: gpt-5.6-sol
    baseline: true

  - name: "cascade"
    type: cascade
    tiers:
      - { model: gpt-5.4-nano,     resolve_rate: 0.65 }  # fraction resolved here
      - { model: gemini-2.5-flash, resolve_rate: 0.80 }  # of what escalated
      - { model: claude-opus-4.8 }                       # final tier takes the rest

resolve_rate is the honest knob: it is the fraction of requests the tier successfully terminates. Measure it from your own eval data — an optimistic guess here produces optimistic savings.

Pricing catalog

src/mizanbench/data/pricing.yaml ships with prices as of 2026-12-02 (USD per 1M tokens) for OpenAI, Anthropic, Google, DeepSeek and Groq models. That is the catalogue's date; each entry records the provider page it was read from (source) and its own date (verified), which mizanbench models shows. Every price was read directly from its provider's page between 2026-11-28 and 2026-12-02, except one entry that could not be re-checked and keeps its older date. The notes at the top of the file say which, and record every modelling limit (price bands, DeepSeek's peak rate).

Where a model is priced in bands, the catalogue uses the lowest band, so prompts above the band's limit cost more than shown. Newer banded entries name their limit (for example -le272k); a few older entries keep their original names, and the notes at the top of the file list every banded model.

Prices change often:

  • override with your own file: mizanbench -p my-pricing.yaml simulate ...
  • or better, send a PR updating the catalog — it's the easiest first contribution to this project, and the as_of field keeps us honest.

Use as a library

from mizanbench import PricingCatalog, Workload, simulate_cascade

catalog = PricingCatalog.load()
w = Workload(requests_per_day=20000, avg_input_tokens=1200, avg_output_tokens=350)
result = simulate_cascade(catalog, w, [
    {"model": "gpt-5.4-nano", "resolve_rate": 0.65},
    {"model": "claude-sonnet-5"},
])
print(result.monthly_cost, result.per_request_cost)

Website and browser calculator

The project site is https://mizan.globalmarkgroup.com/. Its source is in site/: one self-contained page with a calculator that runs in the browser on this package's catalogue and arithmetic. Nothing typed into it is sent anywhere, and it can export its inputs as a workload.yaml to check with mizanbench simulate workload.yaml.

python site/build.py builds site/dist/index.html from the package: the prices, the version and the terminal samples are read at build time. CI fails if the committed page is out of date. CI also checks the calculator against the package on the cases that site/tests/ generates and runs: on each of those cases the totals, the formatted figures and the accept/reject decision must be the same. That is a check on those cases, not a proof for every input. The page is deployed by hand, so the live site can trail this repository.

Tests

pip install pyyaml        # or: pip install -e .  The tests need the one dependency.
PYTHONPATH=src python -m unittest discover -s tests   # stdlib unittest
# or: pytest

Roadmap

  • Benchmark harness: measured (not assumed) resolve rates per model/task.
  • Latency modeling alongside cost.

License

Apache-2.0 — see LICENSE.

Metadata

Release files for mizanbench 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mizanbench 0.1.3
File Size Uploaded Provenance Actions
mizanbench-0.1.3.tar.gz 36.7 kB With provenance Details for mizanbench-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mizanbench 0.1.3
File Interpreter ABI Platform Actions
mizanbench-0.1.3-py3-none-any.whl Python 3 none any Details for mizanbench-0.1.3-py3-none-any.whl

Total release size: 57.8 kB

Release files / mizanbench-0.1.3.tar.gz

Download URL mizanbench-0.1.3.tar.gz
Size 36.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5cd3799f7c06c8c008280807292a30f3b9f7a03ee15f4043988ceaea71243a85
BLAKE2b-256 checksum
How to use checksums
fb83d96fb1db1631c91e60c7da1de12074bc9946c35018dfb79d49740d9f9693
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Release files / mizanbench-0.1.3-py3-none-any.whl

Download URL mizanbench-0.1.3-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99570be1e209e0904bfd8534f9c8b24a71bb7bb4478cf46b64ccb16e29ccfac6
BLAKE2b-256 checksum
How to use checksums
d66e8b6ce05055fca6a97a80f82810ab400a07ebcbed20fd891ae4aeaf8b53cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Security for mizanbench 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mizanbench-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page