Skip to main content Switch to mobile version valueproof 0.6.1 Prove an AI cost cut on your own traffic before you ship it: cheap and strong models working together (Scout & Rescue), measured by cost per outcome with a blind quality review.
pip install valueproof Copy PIP instructions
Prove an AI cost cut before you ship it. Measure cost per usable outcome, not cost per token.
The same cheap model answered 40 support tickets twice, with two different eval checks. A frontier model stepped in whenever the check failed. Then a person compared 20 of the replies blind with the frontier model's own replies.
Claude Haiku 5.5 answers first, Claude Opus 5.5 steps in; compared with Opus 5.5 alone. The check in plain language is one more call, so replies were 10–35% slower than Opus alone; a mid-size model as the rescuer made it as fast as Opus again (one run). So choose the eval check first, then the model.
Made-up tickets, one human reviewer: read it as a direction, not a rule. Full results
If you work on an AI product, you probably get two questions:
"What is the value of it, and how do you prove it?"
"Our token cost needs to go down, but we can't sacrifice the quality of outcomes."
The two sides often work apart. Engineering and FinOps bring token cost down; product managers worry that quality gets sacrificed. When an eval fails, it goes back to engineering, who often don't know what outcome is expected.
Acceptance criteria that run on every answer
Today: the PM writes acceptance criteria → engineering builds → a user acceptance test checks a sample, late → failures go back to engineering, who guess what "right" means.
With an eval check: the PM writes the acceptance criteria once, with the source that defines "right" → they run on every answer at runtime; an answer that fails goes to the frontier model before the user sees it → before shipping, a blind review measures how good the check is.
Each acceptance criterion becomes two kinds of check, and most tasks need both:
The check in plain language has a price: one more call on every answer, so about twice the cost of rules in code and 10–35% slower than the frontier model alone. A mid-size rescuer, or checking only the topics the PM marks as high-risk, won the speed back in our test.
The blind review doesn't go away; its job changes. It now tests the check. Ours found a mistake the check had missed twice. Where a wrong answer can hurt someone, such as a vehicle warning or a medical or legal answer, don't let a model write it at all: show fixed, approved text.
A playbook and a small open-source Python package:
An LLM cascade. A cheap model answers first; a frontier model steps in only when the answer fails an eval check. The technique is not new (FrugalGPT); this repo calls it Scout & Rescue.
A test before you ship: your current setup against the cheaper one, on a fixed set of your own real requests (taken from your logs), with a blind review by an LLM judge or a person.
A measure of the check itself: what it caught, what it missed, how many false alarms, what it cost.
Cost per usable outcome, with failed and rescued attempts counted.
Support replies: 40 made-up tickets, five runs, against Claude Opus 5.5 alone.
The LLM judge looked kinder than the person. "2–6% lower" sounded close; a person preferred the frontier model almost every time. The judge and the person agreed on only one of the three real mistakes the person found with rules in code alone. Check the judge too.
The mistake that got past the check twice: offering a carrier trace for a parcel that had already arrived. That is the next line for the PM to add to the check.
→ Full support test, with the lever ledger, check ratings and raw data.
A live language-learning app: the step that searches the web for a news story ran on Claude Sonnet 5.5 for every lesson, at 9.7 ¢ per article. With Haiku first and Sonnet only when a code check finds no usable or only an old story, it cost 4.6–7.7 ¢. Quality held: an LLM judge scored 18 articles 472 vs 434 for the cheaper setup, and a person comparing 14 German article pairs blind found a tie (6 for the cheaper search, 7 for the old one, 1 equal). Here the cheap model only finds the story; a strong model still writes the lesson. → Case study
Twelve cost ideas, tested one at a time: 7 made things worse or saved nothing. A shorter prompt made the model search more. → Lessons
pip install "valueproof[claude]" # or [openai], [gemini], [all] from valueproof import scout_and_rescue from valueproof.claude import claude POLICY = open("refund_policy.md").read() # the source that defines "right" ticket = "Order 48213 arrived yesterday, but the box is damaged." checker = claude("claude-haiku-5-5") # a cheap model reads each reply against the policy def check(reply): if "48213" not in reply: # rule in code: free and instant return "order number missing" verdict = checker( # check in plain language: one more cheap call f"Policy:\n{POLICY}\n\nTicket:\n{ticket}\n\nReply:\n{reply}\n\n" "Does the reply apply the policy correctly to this ticket, without assuming facts " "the ticket doesn't give? Answer OK, or NO and the reason." ).text return None if verdict.strip().startswith("OK") else verdict out = scout_and_rescue( f"Reply to this support ticket, following this policy:\n{POLICY}\n\nTicket: {ticket}", scout=claude("claude-haiku-5-5"), # the cheap model answers first rescue=claude("claude-opus-5-5"), # the frontier model runs only if the check fails check=check, ) print(out.path, out.cost_usd) # "scout" or "rescue", and what the answers cost A check returns None when the answer is fine, or a reason when it is not. Start with the rules in code, and add the check in plain language where a wrong answer is not acceptable. out.cost_usd covers the answers; the check's own cost comes on top (about 0.02 ¢ per reply in our test). The support test example counts it, and caches it.
Test a change before you ship it
valueproof init my_test.py # a starter test that runs straight away, with fake models valueproof compare my_test.py # offline, free valueproof compare my_test.py --live --estimate # runs 2 requests for real and prints the projected bill valueproof compare my_test.py --live --max-spend 5 # the full test; stops starting new requests at $5 compare runs every setup on every request in the same moment and prints:
cost per usable outcome, average and median cost, time, and how often the frontier model ran
blind-review quality, with hard failures counted separately so no average can hide them
check quality: how many of the judge's hard failures each eval check caught, missed, and how many false alarms it raised
the lever ledger: each change against the setup it changes, your estimate written down before the test, and a keep-or-drop verdict
To rate a new eval check on replies you already paid for, without running the models again: --from-results results.json.
Blind review, two ways. An LLM judge gets one answer at a time, in random order, never the setup's name. Give it the reference that defines "right"; without it, a judge can only tell whether an answer looks usable. Or review it yourself: every run writes blind_review.csv and a separate blind_key.csv.
→ How to write my_test.py, and a demo that runs without an API key: examples/ · The step-by-step method: docs/method.md
It fits when your product sends many requests to a frontier model, most of them routine, and you can say what a usable answer is: support replies, data extraction, document summaries, search and research assistants, code review, code migration (does it compile, do the tests pass).
Be careful where a wrong answer carries legal, money or safety risk. Measure your eval check against a blind review first, or keep that step on the frontier model until the check catches the mistakes that matter.
How this differs from other tools
Cost-first, not QA-first. Eval suites such as promptfoo and Braintrust are built around quality regression and observability, and show cost alongside. Valueproof starts from the decision a product manager or CFO has to make: cost per usable outcome, an estimate before the test, and a keep-or-drop verdict after it. Use it to get evidence on your own requests before you commit to a router or gateway.
Why this exists: who it is for, cost per outcome vs value shipped, and real-world signals from 2026
Support test · Case study · Game article test · A chatbot estimate
Scout & Rescue in detail · Method · Lessons · Templates
Version 0.6, early: the API may still change. Python 3.10+ (the Gemini adapter needs 3.11+). The core has no dependencies; a model is any function prompt -> ModelResult, so a local model works too. Adapters come as extras: [claude], [openai], [gemini], [all].
The old package name ai-mixed-model-cost-optimization still installs and pulls in valueproof.
LLM cascade / Scout & Rescue: a cheap model (the scout) answers first; a frontier model (the rescuer) runs only when the answer fails an eval check.
Eval check: judges one answer at runtime and decides whether the rescuer runs. A rule in code, or a cheap model asked in plain language with a reference.
Eval: the fixed test before shipping: real requests, the eval checks, and a blind review, run the same way for every change.
Blind review: answers scored on a fixed rubric without knowing which setup wrote them, by an LLM judge or a person.
Hard failure / serious mistake: a wrong policy rule, a promise the policy doesn't allow, an invented fact, or no answer.
Usable outcome: a final answer that passed the checks and had no hard failure.
Cost per usable outcome: everything a setup spent, failed and rescued attempts included, divided by its usable outcomes.
Lever: one change meant to lower cost, tested on its own.
Built from a real cost-reduction project on a live language-learning app. Engineering, testing and blind reviews were done with an AI coding assistant (Claude); a product owner made every keep-or-drop decision and did the human blind checks.
Text: CC BY 4.0. Code in src/ and examples/: MIT.
Both files in this release have provenance metadata.
MIT View SPDX License List
claude openai gemini all dev
llm llm cost cost per outcome model cascade evaluation finops llmops
Development Status 3 - Alpha
Programming Language Python :: 3
Topic Scientific/Engineering :: Artificial Intelligence
Release files for valueproof 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 59.4 kB
Release files / valueproof-0.6.1.tar.gz
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 verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Release files / valueproof-0.6.1-py3-none-any.whl
Security for valueproof 0.6.1
Both files in this release have been uploaded with provenance metadata.
With provenance valueproof-0.6.1.tar.gz Nov 27, 2026
With provenance valueproof-0.6.1-py3-none-any.whl Nov 27, 2026
Attestation for valueproof-0.6.1.tar.gz
Attestation for valueproof-0.6.1-py3-none-any.whl
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
Nov 27, 2026 2 release files Full provenance
Nov 26, 2026 2 release files Full provenance
Nov 26, 2026 2 release files Change of provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




