valueproof 0.6.0__tar.gz → 0.6.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. valueproof-0.6.2/PKG-INFO +208 -0
  2. valueproof-0.6.2/README.md +180 -0
  3. {valueproof-0.6.0 → valueproof-0.6.2}/pyproject.toml +1 -1
  4. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof/__init__.py +1 -1
  5. valueproof-0.6.2/src/valueproof.egg-info/PKG-INFO +208 -0
  6. valueproof-0.6.0/PKG-INFO +0 -315
  7. valueproof-0.6.0/README.md +0 -287
  8. valueproof-0.6.0/src/valueproof.egg-info/PKG-INFO +0 -315
  9. {valueproof-0.6.0 → valueproof-0.6.2}/LICENSE-CODE +0 -0
  10. {valueproof-0.6.0 → valueproof-0.6.2}/setup.cfg +0 -0
  11. {valueproof-0.6.0 → valueproof-0.6.2}/src/mixed_model_cost/__init__.py +0 -0
  12. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof/claude.py +0 -0
  13. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof/cli.py +0 -0
  14. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof/gemini.py +0 -0
  15. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof/lever_runner.py +0 -0
  16. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof/openai.py +0 -0
  17. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof/pipeline.py +0 -0
  18. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof/scout_rescue.py +0 -0
  19. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof/starter.py +0 -0
  20. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof.egg-info/SOURCES.txt +0 -0
  21. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof.egg-info/dependency_links.txt +0 -0
  22. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof.egg-info/entry_points.txt +0 -0
  23. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof.egg-info/requires.txt +0 -0
  24. {valueproof-0.6.0 → valueproof-0.6.2}/src/valueproof.egg-info/top_level.txt +0 -0
  25. {valueproof-0.6.0 → valueproof-0.6.2}/tests/test_adapters.py +0 -0
  26. {valueproof-0.6.0 → valueproof-0.6.2}/tests/test_core.py +0 -0
  27. {valueproof-0.6.0 → valueproof-0.6.2}/tests/test_runner_cli.py +0 -0
@@ -0,0 +1,208 @@
1
+ Metadata-Version: 2.4
2
+ Name: valueproof
3
+ Version: 0.6.2
4
+ Summary: 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.
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/AndyJakob78/valueproof
7
+ Project-URL: Old package name, https://pypi.org/project/ai-mixed-model-cost-optimization/
8
+ Keywords: llm,llm cost,cost per outcome,model cascade,evaluation,finops,llmops
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE-CODE
15
+ Provides-Extra: claude
16
+ Requires-Dist: anthropic>=2.14; extra == "claude"
17
+ Provides-Extra: openai
18
+ Requires-Dist: openai>=3.60; extra == "openai"
19
+ Provides-Extra: gemini
20
+ Requires-Dist: google-genai>=3.6; python_version >= "3.11" and extra == "gemini"
21
+ Provides-Extra: all
22
+ Requires-Dist: anthropic>=2.14; extra == "all"
23
+ Requires-Dist: openai>=3.60; extra == "all"
24
+ Requires-Dist: google-genai>=3.6; python_version >= "3.11" and extra == "all"
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=8; extra == "dev"
27
+ Dynamic: license-file
28
+
29
+ # Valueproof
30
+
31
+ **Prove an AI cost cut before you ship it. Measure cost per usable outcome, not cost per token.**
32
+
33
+ ## Cheapest isn't the win
34
+
35
+ **Same cheap model, different check: 4 of 20 good replies with code rules, 13 of 20 with the PM's acceptance criteria, still about 70% cheaper.**
36
+
37
+ The same cheap model answered 40 support tickets twice, with two different eval checks. A top-tier model stepped in whenever the check failed. Then a person compared 20 of the replies blind with the top-tier model's own replies.
38
+
39
+ | | Eval check: rules in code only | Eval check: the PM's acceptance criteria, in plain language |
40
+ |---|---|---|
41
+ | **Replies as good as the top-tier model's** (blind human review, 20 tickets) | ❌ **4 of 20** | ✅ **13 of 20** |
42
+ | **Serious mistakes that reached the customer** | 3 of 20 | 2 of 20 |
43
+ | **Cost vs. the top-tier model alone** | 82–92% cheaper | 69–73% cheaper |
44
+ | **Verdict** | Biggest saving, worse outcomes: less value | **Higher value, for a somewhat smaller saving** |
45
+
46
+ 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.**
47
+
48
+ Made-up tickets, one human reviewer: read it as a direction, not a rule. [Full results](#full-results)
49
+
50
+ ## Two questions, two sides
51
+
52
+ If you work on an AI product, you probably get two questions:
53
+
54
+ - "What is the value of it, and how do you prove it?"
55
+ - "Our token cost needs to go down, but we can't sacrifice the quality of outcomes."
56
+
57
+ 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.
58
+
59
+ ## Acceptance criteria that run on every answer
60
+
61
+ **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.
62
+
63
+ **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 top-tier model before the user sees it → before shipping, a blind review measures how good the check is.
64
+
65
+ Each acceptance criterion becomes two kinds of check, and most tasks need both:
66
+
67
+ | Use case | Your acceptance criterion | Becomes a rule in code (free, instant) | Becomes a check in plain language (a cheap model reads the answer against the source) |
68
+ |---|---|---|---|
69
+ | A **support chatbot** answers routine tickets | "A reply applies our refund policy correctly to this ticket." | The order number is in the reply; no voucher is offered | Is the right rule applied to *this* case? From our test: it offered a carrier trace for a parcel the customer had already received. |
70
+ | An app **writes a match report** after every game | "The report tells the match as it happened." | Score, teams and scorers match the match data | Does it invent quotes or events? |
71
+ | An AI **writes product descriptions** | "It sounds like our brand." | No word from the banned list; length within limits | Calm, friendly, no exaggerated claims? |
72
+ | An **in-car travel guide** tells stories along the route | "Stories are true, family-friendly and safe to hear while driving." | Every place is on the route and in the database; under 60 seconds read aloud | Do the facts match the database? Does it ever ask the driver to look away from the road? |
73
+
74
+ Two things to know:
75
+
76
+ - **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 top-tier model alone. A mid-size rescuer, or checking only the topics the PM marks as high-risk, won the speed back in our test.
77
+ - **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.
78
+
79
+ ## What Valueproof is
80
+
81
+ A playbook and a small open-source Python package:
82
+
83
+ - **An LLM cascade.** A cheap model answers first; a top-tier model steps in only when the answer fails an eval check. The technique is not new ([FrugalGPT](https://github.com/stanford-futuredata/FrugalGPT)); this repo calls it *Scout & Rescue*.
84
+ - **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.
85
+ - **A measure of the check itself:** what it caught, what it missed, how many false alarms, what it cost.
86
+ - **Cost per usable outcome,** with failed and rescued attempts counted.
87
+
88
+ ## Full results
89
+
90
+ **Support replies:** 40 made-up tickets, five runs, against Claude Opus 5.5 alone.
91
+
92
+ | Setup | As good as Opus (blind human review, 20 tickets) | Serious mistakes | Quality, LLM judge | Cost per usable reply | Response time vs. Opus alone |
93
+ |---|---|---|---|---|---|
94
+ | Rules in code as the eval check | ❌ 4 of 20 | the rules caught 0 of 10 (four runs) | 2–6% lower | 82–92% cheaper | 22–35% faster |
95
+ | + an eval check in plain language | ✅ 13 of 20 | caught the one in its run; 2 of 20 got past it in the human review | 3.5–4.9% lower | 69–73% cheaper | 10–35% slower |
96
+ | + a mid-size model as the rescuer (one run) | not checked by a person | none occurred in that run | 5% lower | 87% cheaper | about as fast |
97
+
98
+ - **The LLM judge looked kinder than the person.** "2–6% lower" sounded close; a person preferred the top-tier 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.
99
+ - **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.
100
+
101
+ → [Full support test](https://github.com/AndyJakob78/valueproof/blob/main/docs/support-test.md), with the lever ledger, check ratings and raw data.
102
+
103
+ **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](https://github.com/AndyJakob78/valueproof/blob/main/docs/case-study.md)
104
+
105
+ **Twelve cost ideas, tested one at a time:** 7 made things worse or saved nothing. A shorter prompt made the model search *more*. → [Lessons](https://github.com/AndyJakob78/valueproof/blob/main/docs/lessons.md)
106
+
107
+ ## Quick start
108
+
109
+ ```bash
110
+ pip install "valueproof[claude]" # or [openai], [gemini], [all]
111
+ ```
112
+
113
+ ```python
114
+ from valueproof import scout_and_rescue
115
+ from valueproof.claude import claude
116
+
117
+ POLICY = open("refund_policy.md").read() # the source that defines "right"
118
+ ticket = "Order 48213 arrived yesterday, but the box is damaged."
119
+ checker = claude("claude-haiku-5-5") # a cheap model reads each reply against the policy
120
+
121
+ def check(reply):
122
+ if "48213" not in reply: # rule in code: free and instant
123
+ return "order number missing"
124
+ verdict = checker( # check in plain language: one more cheap call
125
+ f"Policy:\n{POLICY}\n\nTicket:\n{ticket}\n\nReply:\n{reply}\n\n"
126
+ "Does the reply apply the policy correctly to this ticket, without assuming facts "
127
+ "the ticket doesn't give? Answer OK, or NO and the reason."
128
+ ).text
129
+ return None if verdict.strip().startswith("OK") else verdict
130
+
131
+ out = scout_and_rescue(
132
+ f"Reply to this support ticket, following this policy:\n{POLICY}\n\nTicket: {ticket}",
133
+ scout=claude("claude-haiku-5-5"), # the cheap model answers first
134
+ rescue=claude("claude-opus-5-5"), # the top-tier model runs only if the check fails
135
+ check=check,
136
+ )
137
+ print(out.path, out.cost_usd) # "scout" or "rescue", and what the answers cost
138
+ ```
139
+
140
+ 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](https://github.com/AndyJakob78/valueproof/blob/main/examples/test_levers_support.py) counts it, and caches it.
141
+
142
+ ## Test a change before you ship it
143
+
144
+ ```bash
145
+ valueproof init my_test.py # a starter test that runs straight away, with fake models
146
+ valueproof compare my_test.py # offline, free
147
+ valueproof compare my_test.py --live --estimate # runs 2 requests for real and prints the projected bill
148
+ valueproof compare my_test.py --live --max-spend 5 # the full test; stops starting new requests at $5
149
+ ```
150
+
151
+ `compare` runs every setup on every request in the same moment and prints:
152
+
153
+ - **cost per usable outcome**, average and median cost, time, and how often the top-tier model ran
154
+ - **blind-review quality**, with hard failures counted separately so no average can hide them
155
+ - **check quality:** how many of the judge's hard failures each eval check caught, missed, and how many false alarms it raised
156
+ - **the lever ledger:** each change against the setup it changes, your estimate written down before the test, and a keep-or-drop verdict
157
+
158
+ To rate a new eval check on replies you already paid for, without running the models again: `--from-results results.json`.
159
+
160
+ **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`.
161
+
162
+ → How to write `my_test.py`, and a demo that runs without an API key: [examples/](https://github.com/AndyJakob78/valueproof/tree/main/examples/) · The step-by-step method: [docs/method.md](https://github.com/AndyJakob78/valueproof/blob/main/docs/method.md)
163
+
164
+ ## When it fits
165
+
166
+ It fits when your product sends many requests to a top-tier 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).
167
+
168
+ 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 top-tier model until the check catches the mistakes that matter.
169
+
170
+ ## How this differs from other tools
171
+
172
+ | Tool | What it does | How it relates |
173
+ |---|---|---|
174
+ | [RouteLLM](https://github.com/lm-sys/RouteLLM) | Trained routers that pick a model per request | A routing technique. Test it against your setup with `valueproof compare`. |
175
+ | [cascadeflow](https://github.com/lemony-ai/cascadeflow) | A cascading runtime for agents | A runtime for production. Test it here first. |
176
+ | [LiteLLM](https://github.com/BerriAI/litellm) | A gateway to 100+ model APIs | Infrastructure to call models. Works as the model behind a setup here. |
177
+ | [promptfoo](https://github.com/promptfoo/promptfoo) | Broad testing of prompts, agents and RAG | A general eval suite. This repo is narrower. |
178
+
179
+ **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.
180
+
181
+ ## More
182
+
183
+ - [Why this exists](https://github.com/AndyJakob78/valueproof/blob/main/docs/why.md): who it is for, cost per outcome vs value shipped, and real-world signals from 2026
184
+ - [Support test](https://github.com/AndyJakob78/valueproof/blob/main/docs/support-test.md) · [Case study](https://github.com/AndyJakob78/valueproof/blob/main/docs/case-study.md) · [Game article test](https://github.com/AndyJakob78/valueproof/blob/main/docs/game-article-test.md) · [A chatbot estimate](https://github.com/AndyJakob78/valueproof/blob/main/docs/example-service-chatbot.md)
185
+ - [Scout & Rescue in detail](https://github.com/AndyJakob78/valueproof/blob/main/docs/scout-and-rescue.md) · [Method](https://github.com/AndyJakob78/valueproof/blob/main/docs/method.md) · [Lessons](https://github.com/AndyJakob78/valueproof/blob/main/docs/lessons.md) · [Templates](https://github.com/AndyJakob78/valueproof/tree/main/templates/)
186
+
187
+ ## Install
188
+
189
+ 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]`.
190
+
191
+ The old package name `ai-mixed-model-cost-optimization` still installs and pulls in `valueproof`.
192
+
193
+ ## Terms
194
+
195
+ - **LLM cascade / Scout & Rescue:** a cheap model (the scout) answers first; a top-tier model (the rescuer) runs only when the answer fails an eval check.
196
+ - **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.
197
+ - **Eval:** the fixed test before shipping: real requests, the eval checks, and a blind review, run the same way for every change.
198
+ - **Blind review:** answers scored on a fixed rubric without knowing which setup wrote them, by an LLM judge or a person.
199
+ - **Hard failure / serious mistake:** a wrong policy rule, a promise the policy doesn't allow, an invented fact, or no answer.
200
+ - **Usable outcome:** a final answer that passed the checks and had no hard failure.
201
+ - **Cost per usable outcome:** everything a setup spent, failed and rescued attempts included, divided by its usable outcomes.
202
+ - **Lever:** one change meant to lower cost, tested on its own.
203
+
204
+ ## About
205
+
206
+ 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.
207
+
208
+ Text: [CC BY 4.0](https://github.com/AndyJakob78/valueproof/blob/main/LICENSE). Code in [src/](https://github.com/AndyJakob78/valueproof/tree/main/src/) and [examples/](https://github.com/AndyJakob78/valueproof/tree/main/examples/): [MIT](https://github.com/AndyJakob78/valueproof/blob/main/LICENSE-CODE).
@@ -0,0 +1,180 @@
1
+ # Valueproof
2
+
3
+ **Prove an AI cost cut before you ship it. Measure cost per usable outcome, not cost per token.**
4
+
5
+ ## Cheapest isn't the win
6
+
7
+ **Same cheap model, different check: 4 of 20 good replies with code rules, 13 of 20 with the PM's acceptance criteria, still about 70% cheaper.**
8
+
9
+ The same cheap model answered 40 support tickets twice, with two different eval checks. A top-tier model stepped in whenever the check failed. Then a person compared 20 of the replies blind with the top-tier model's own replies.
10
+
11
+ | | Eval check: rules in code only | Eval check: the PM's acceptance criteria, in plain language |
12
+ |---|---|---|
13
+ | **Replies as good as the top-tier model's** (blind human review, 20 tickets) | ❌ **4 of 20** | ✅ **13 of 20** |
14
+ | **Serious mistakes that reached the customer** | 3 of 20 | 2 of 20 |
15
+ | **Cost vs. the top-tier model alone** | 82–92% cheaper | 69–73% cheaper |
16
+ | **Verdict** | Biggest saving, worse outcomes: less value | **Higher value, for a somewhat smaller saving** |
17
+
18
+ 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.**
19
+
20
+ Made-up tickets, one human reviewer: read it as a direction, not a rule. [Full results](#full-results)
21
+
22
+ ## Two questions, two sides
23
+
24
+ If you work on an AI product, you probably get two questions:
25
+
26
+ - "What is the value of it, and how do you prove it?"
27
+ - "Our token cost needs to go down, but we can't sacrifice the quality of outcomes."
28
+
29
+ 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.
30
+
31
+ ## Acceptance criteria that run on every answer
32
+
33
+ **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.
34
+
35
+ **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 top-tier model before the user sees it → before shipping, a blind review measures how good the check is.
36
+
37
+ Each acceptance criterion becomes two kinds of check, and most tasks need both:
38
+
39
+ | Use case | Your acceptance criterion | Becomes a rule in code (free, instant) | Becomes a check in plain language (a cheap model reads the answer against the source) |
40
+ |---|---|---|---|
41
+ | A **support chatbot** answers routine tickets | "A reply applies our refund policy correctly to this ticket." | The order number is in the reply; no voucher is offered | Is the right rule applied to *this* case? From our test: it offered a carrier trace for a parcel the customer had already received. |
42
+ | An app **writes a match report** after every game | "The report tells the match as it happened." | Score, teams and scorers match the match data | Does it invent quotes or events? |
43
+ | An AI **writes product descriptions** | "It sounds like our brand." | No word from the banned list; length within limits | Calm, friendly, no exaggerated claims? |
44
+ | An **in-car travel guide** tells stories along the route | "Stories are true, family-friendly and safe to hear while driving." | Every place is on the route and in the database; under 60 seconds read aloud | Do the facts match the database? Does it ever ask the driver to look away from the road? |
45
+
46
+ Two things to know:
47
+
48
+ - **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 top-tier model alone. A mid-size rescuer, or checking only the topics the PM marks as high-risk, won the speed back in our test.
49
+ - **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.
50
+
51
+ ## What Valueproof is
52
+
53
+ A playbook and a small open-source Python package:
54
+
55
+ - **An LLM cascade.** A cheap model answers first; a top-tier model steps in only when the answer fails an eval check. The technique is not new ([FrugalGPT](https://github.com/stanford-futuredata/FrugalGPT)); this repo calls it *Scout & Rescue*.
56
+ - **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.
57
+ - **A measure of the check itself:** what it caught, what it missed, how many false alarms, what it cost.
58
+ - **Cost per usable outcome,** with failed and rescued attempts counted.
59
+
60
+ ## Full results
61
+
62
+ **Support replies:** 40 made-up tickets, five runs, against Claude Opus 5.5 alone.
63
+
64
+ | Setup | As good as Opus (blind human review, 20 tickets) | Serious mistakes | Quality, LLM judge | Cost per usable reply | Response time vs. Opus alone |
65
+ |---|---|---|---|---|---|
66
+ | Rules in code as the eval check | ❌ 4 of 20 | the rules caught 0 of 10 (four runs) | 2–6% lower | 82–92% cheaper | 22–35% faster |
67
+ | + an eval check in plain language | ✅ 13 of 20 | caught the one in its run; 2 of 20 got past it in the human review | 3.5–4.9% lower | 69–73% cheaper | 10–35% slower |
68
+ | + a mid-size model as the rescuer (one run) | not checked by a person | none occurred in that run | 5% lower | 87% cheaper | about as fast |
69
+
70
+ - **The LLM judge looked kinder than the person.** "2–6% lower" sounded close; a person preferred the top-tier 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.
71
+ - **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.
72
+
73
+ → [Full support test](https://github.com/AndyJakob78/valueproof/blob/main/docs/support-test.md), with the lever ledger, check ratings and raw data.
74
+
75
+ **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](https://github.com/AndyJakob78/valueproof/blob/main/docs/case-study.md)
76
+
77
+ **Twelve cost ideas, tested one at a time:** 7 made things worse or saved nothing. A shorter prompt made the model search *more*. → [Lessons](https://github.com/AndyJakob78/valueproof/blob/main/docs/lessons.md)
78
+
79
+ ## Quick start
80
+
81
+ ```bash
82
+ pip install "valueproof[claude]" # or [openai], [gemini], [all]
83
+ ```
84
+
85
+ ```python
86
+ from valueproof import scout_and_rescue
87
+ from valueproof.claude import claude
88
+
89
+ POLICY = open("refund_policy.md").read() # the source that defines "right"
90
+ ticket = "Order 48213 arrived yesterday, but the box is damaged."
91
+ checker = claude("claude-haiku-5-5") # a cheap model reads each reply against the policy
92
+
93
+ def check(reply):
94
+ if "48213" not in reply: # rule in code: free and instant
95
+ return "order number missing"
96
+ verdict = checker( # check in plain language: one more cheap call
97
+ f"Policy:\n{POLICY}\n\nTicket:\n{ticket}\n\nReply:\n{reply}\n\n"
98
+ "Does the reply apply the policy correctly to this ticket, without assuming facts "
99
+ "the ticket doesn't give? Answer OK, or NO and the reason."
100
+ ).text
101
+ return None if verdict.strip().startswith("OK") else verdict
102
+
103
+ out = scout_and_rescue(
104
+ f"Reply to this support ticket, following this policy:\n{POLICY}\n\nTicket: {ticket}",
105
+ scout=claude("claude-haiku-5-5"), # the cheap model answers first
106
+ rescue=claude("claude-opus-5-5"), # the top-tier model runs only if the check fails
107
+ check=check,
108
+ )
109
+ print(out.path, out.cost_usd) # "scout" or "rescue", and what the answers cost
110
+ ```
111
+
112
+ 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](https://github.com/AndyJakob78/valueproof/blob/main/examples/test_levers_support.py) counts it, and caches it.
113
+
114
+ ## Test a change before you ship it
115
+
116
+ ```bash
117
+ valueproof init my_test.py # a starter test that runs straight away, with fake models
118
+ valueproof compare my_test.py # offline, free
119
+ valueproof compare my_test.py --live --estimate # runs 2 requests for real and prints the projected bill
120
+ valueproof compare my_test.py --live --max-spend 5 # the full test; stops starting new requests at $5
121
+ ```
122
+
123
+ `compare` runs every setup on every request in the same moment and prints:
124
+
125
+ - **cost per usable outcome**, average and median cost, time, and how often the top-tier model ran
126
+ - **blind-review quality**, with hard failures counted separately so no average can hide them
127
+ - **check quality:** how many of the judge's hard failures each eval check caught, missed, and how many false alarms it raised
128
+ - **the lever ledger:** each change against the setup it changes, your estimate written down before the test, and a keep-or-drop verdict
129
+
130
+ To rate a new eval check on replies you already paid for, without running the models again: `--from-results results.json`.
131
+
132
+ **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`.
133
+
134
+ → How to write `my_test.py`, and a demo that runs without an API key: [examples/](https://github.com/AndyJakob78/valueproof/tree/main/examples/) · The step-by-step method: [docs/method.md](https://github.com/AndyJakob78/valueproof/blob/main/docs/method.md)
135
+
136
+ ## When it fits
137
+
138
+ It fits when your product sends many requests to a top-tier 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).
139
+
140
+ 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 top-tier model until the check catches the mistakes that matter.
141
+
142
+ ## How this differs from other tools
143
+
144
+ | Tool | What it does | How it relates |
145
+ |---|---|---|
146
+ | [RouteLLM](https://github.com/lm-sys/RouteLLM) | Trained routers that pick a model per request | A routing technique. Test it against your setup with `valueproof compare`. |
147
+ | [cascadeflow](https://github.com/lemony-ai/cascadeflow) | A cascading runtime for agents | A runtime for production. Test it here first. |
148
+ | [LiteLLM](https://github.com/BerriAI/litellm) | A gateway to 100+ model APIs | Infrastructure to call models. Works as the model behind a setup here. |
149
+ | [promptfoo](https://github.com/promptfoo/promptfoo) | Broad testing of prompts, agents and RAG | A general eval suite. This repo is narrower. |
150
+
151
+ **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.
152
+
153
+ ## More
154
+
155
+ - [Why this exists](https://github.com/AndyJakob78/valueproof/blob/main/docs/why.md): who it is for, cost per outcome vs value shipped, and real-world signals from 2026
156
+ - [Support test](https://github.com/AndyJakob78/valueproof/blob/main/docs/support-test.md) · [Case study](https://github.com/AndyJakob78/valueproof/blob/main/docs/case-study.md) · [Game article test](https://github.com/AndyJakob78/valueproof/blob/main/docs/game-article-test.md) · [A chatbot estimate](https://github.com/AndyJakob78/valueproof/blob/main/docs/example-service-chatbot.md)
157
+ - [Scout & Rescue in detail](https://github.com/AndyJakob78/valueproof/blob/main/docs/scout-and-rescue.md) · [Method](https://github.com/AndyJakob78/valueproof/blob/main/docs/method.md) · [Lessons](https://github.com/AndyJakob78/valueproof/blob/main/docs/lessons.md) · [Templates](https://github.com/AndyJakob78/valueproof/tree/main/templates/)
158
+
159
+ ## Install
160
+
161
+ 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]`.
162
+
163
+ The old package name `ai-mixed-model-cost-optimization` still installs and pulls in `valueproof`.
164
+
165
+ ## Terms
166
+
167
+ - **LLM cascade / Scout & Rescue:** a cheap model (the scout) answers first; a top-tier model (the rescuer) runs only when the answer fails an eval check.
168
+ - **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.
169
+ - **Eval:** the fixed test before shipping: real requests, the eval checks, and a blind review, run the same way for every change.
170
+ - **Blind review:** answers scored on a fixed rubric without knowing which setup wrote them, by an LLM judge or a person.
171
+ - **Hard failure / serious mistake:** a wrong policy rule, a promise the policy doesn't allow, an invented fact, or no answer.
172
+ - **Usable outcome:** a final answer that passed the checks and had no hard failure.
173
+ - **Cost per usable outcome:** everything a setup spent, failed and rescued attempts included, divided by its usable outcomes.
174
+ - **Lever:** one change meant to lower cost, tested on its own.
175
+
176
+ ## About
177
+
178
+ 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.
179
+
180
+ Text: [CC BY 4.0](https://github.com/AndyJakob78/valueproof/blob/main/LICENSE). Code in [src/](https://github.com/AndyJakob78/valueproof/tree/main/src/) and [examples/](https://github.com/AndyJakob78/valueproof/tree/main/examples/): [MIT](https://github.com/AndyJakob78/valueproof/blob/main/LICENSE-CODE).
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "valueproof"
7
- version = "0.6.0"
7
+ version = "0.6.2"
8
8
  description = "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."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -15,7 +15,7 @@ from .lever_runner import (Report, Run, Score, check_quality, estimate, is_outco
15
15
  from .pipeline import RunResult, Step, StepLog, run_pipeline
16
16
  from .scout_rescue import Check, Model, ModelResult, Outcome, handoff_prompt, scout_and_rescue
17
17
 
18
- __version__ = "0.6.0"
18
+ __version__ = "0.6.2"
19
19
 
20
20
  __all__ = [
21
21
  "Check", "Model", "ModelResult", "Outcome", "handoff_prompt", "scout_and_rescue",
@@ -0,0 +1,208 @@
1
+ Metadata-Version: 2.4
2
+ Name: valueproof
3
+ Version: 0.6.2
4
+ Summary: 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.
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/AndyJakob78/valueproof
7
+ Project-URL: Old package name, https://pypi.org/project/ai-mixed-model-cost-optimization/
8
+ Keywords: llm,llm cost,cost per outcome,model cascade,evaluation,finops,llmops
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE-CODE
15
+ Provides-Extra: claude
16
+ Requires-Dist: anthropic>=2.14; extra == "claude"
17
+ Provides-Extra: openai
18
+ Requires-Dist: openai>=3.60; extra == "openai"
19
+ Provides-Extra: gemini
20
+ Requires-Dist: google-genai>=3.6; python_version >= "3.11" and extra == "gemini"
21
+ Provides-Extra: all
22
+ Requires-Dist: anthropic>=2.14; extra == "all"
23
+ Requires-Dist: openai>=3.60; extra == "all"
24
+ Requires-Dist: google-genai>=3.6; python_version >= "3.11" and extra == "all"
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=8; extra == "dev"
27
+ Dynamic: license-file
28
+
29
+ # Valueproof
30
+
31
+ **Prove an AI cost cut before you ship it. Measure cost per usable outcome, not cost per token.**
32
+
33
+ ## Cheapest isn't the win
34
+
35
+ **Same cheap model, different check: 4 of 20 good replies with code rules, 13 of 20 with the PM's acceptance criteria, still about 70% cheaper.**
36
+
37
+ The same cheap model answered 40 support tickets twice, with two different eval checks. A top-tier model stepped in whenever the check failed. Then a person compared 20 of the replies blind with the top-tier model's own replies.
38
+
39
+ | | Eval check: rules in code only | Eval check: the PM's acceptance criteria, in plain language |
40
+ |---|---|---|
41
+ | **Replies as good as the top-tier model's** (blind human review, 20 tickets) | ❌ **4 of 20** | ✅ **13 of 20** |
42
+ | **Serious mistakes that reached the customer** | 3 of 20 | 2 of 20 |
43
+ | **Cost vs. the top-tier model alone** | 82–92% cheaper | 69–73% cheaper |
44
+ | **Verdict** | Biggest saving, worse outcomes: less value | **Higher value, for a somewhat smaller saving** |
45
+
46
+ 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.**
47
+
48
+ Made-up tickets, one human reviewer: read it as a direction, not a rule. [Full results](#full-results)
49
+
50
+ ## Two questions, two sides
51
+
52
+ If you work on an AI product, you probably get two questions:
53
+
54
+ - "What is the value of it, and how do you prove it?"
55
+ - "Our token cost needs to go down, but we can't sacrifice the quality of outcomes."
56
+
57
+ 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.
58
+
59
+ ## Acceptance criteria that run on every answer
60
+
61
+ **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.
62
+
63
+ **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 top-tier model before the user sees it → before shipping, a blind review measures how good the check is.
64
+
65
+ Each acceptance criterion becomes two kinds of check, and most tasks need both:
66
+
67
+ | Use case | Your acceptance criterion | Becomes a rule in code (free, instant) | Becomes a check in plain language (a cheap model reads the answer against the source) |
68
+ |---|---|---|---|
69
+ | A **support chatbot** answers routine tickets | "A reply applies our refund policy correctly to this ticket." | The order number is in the reply; no voucher is offered | Is the right rule applied to *this* case? From our test: it offered a carrier trace for a parcel the customer had already received. |
70
+ | An app **writes a match report** after every game | "The report tells the match as it happened." | Score, teams and scorers match the match data | Does it invent quotes or events? |
71
+ | An AI **writes product descriptions** | "It sounds like our brand." | No word from the banned list; length within limits | Calm, friendly, no exaggerated claims? |
72
+ | An **in-car travel guide** tells stories along the route | "Stories are true, family-friendly and safe to hear while driving." | Every place is on the route and in the database; under 60 seconds read aloud | Do the facts match the database? Does it ever ask the driver to look away from the road? |
73
+
74
+ Two things to know:
75
+
76
+ - **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 top-tier model alone. A mid-size rescuer, or checking only the topics the PM marks as high-risk, won the speed back in our test.
77
+ - **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.
78
+
79
+ ## What Valueproof is
80
+
81
+ A playbook and a small open-source Python package:
82
+
83
+ - **An LLM cascade.** A cheap model answers first; a top-tier model steps in only when the answer fails an eval check. The technique is not new ([FrugalGPT](https://github.com/stanford-futuredata/FrugalGPT)); this repo calls it *Scout & Rescue*.
84
+ - **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.
85
+ - **A measure of the check itself:** what it caught, what it missed, how many false alarms, what it cost.
86
+ - **Cost per usable outcome,** with failed and rescued attempts counted.
87
+
88
+ ## Full results
89
+
90
+ **Support replies:** 40 made-up tickets, five runs, against Claude Opus 5.5 alone.
91
+
92
+ | Setup | As good as Opus (blind human review, 20 tickets) | Serious mistakes | Quality, LLM judge | Cost per usable reply | Response time vs. Opus alone |
93
+ |---|---|---|---|---|---|
94
+ | Rules in code as the eval check | ❌ 4 of 20 | the rules caught 0 of 10 (four runs) | 2–6% lower | 82–92% cheaper | 22–35% faster |
95
+ | + an eval check in plain language | ✅ 13 of 20 | caught the one in its run; 2 of 20 got past it in the human review | 3.5–4.9% lower | 69–73% cheaper | 10–35% slower |
96
+ | + a mid-size model as the rescuer (one run) | not checked by a person | none occurred in that run | 5% lower | 87% cheaper | about as fast |
97
+
98
+ - **The LLM judge looked kinder than the person.** "2–6% lower" sounded close; a person preferred the top-tier 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.
99
+ - **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.
100
+
101
+ → [Full support test](https://github.com/AndyJakob78/valueproof/blob/main/docs/support-test.md), with the lever ledger, check ratings and raw data.
102
+
103
+ **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](https://github.com/AndyJakob78/valueproof/blob/main/docs/case-study.md)
104
+
105
+ **Twelve cost ideas, tested one at a time:** 7 made things worse or saved nothing. A shorter prompt made the model search *more*. → [Lessons](https://github.com/AndyJakob78/valueproof/blob/main/docs/lessons.md)
106
+
107
+ ## Quick start
108
+
109
+ ```bash
110
+ pip install "valueproof[claude]" # or [openai], [gemini], [all]
111
+ ```
112
+
113
+ ```python
114
+ from valueproof import scout_and_rescue
115
+ from valueproof.claude import claude
116
+
117
+ POLICY = open("refund_policy.md").read() # the source that defines "right"
118
+ ticket = "Order 48213 arrived yesterday, but the box is damaged."
119
+ checker = claude("claude-haiku-5-5") # a cheap model reads each reply against the policy
120
+
121
+ def check(reply):
122
+ if "48213" not in reply: # rule in code: free and instant
123
+ return "order number missing"
124
+ verdict = checker( # check in plain language: one more cheap call
125
+ f"Policy:\n{POLICY}\n\nTicket:\n{ticket}\n\nReply:\n{reply}\n\n"
126
+ "Does the reply apply the policy correctly to this ticket, without assuming facts "
127
+ "the ticket doesn't give? Answer OK, or NO and the reason."
128
+ ).text
129
+ return None if verdict.strip().startswith("OK") else verdict
130
+
131
+ out = scout_and_rescue(
132
+ f"Reply to this support ticket, following this policy:\n{POLICY}\n\nTicket: {ticket}",
133
+ scout=claude("claude-haiku-5-5"), # the cheap model answers first
134
+ rescue=claude("claude-opus-5-5"), # the top-tier model runs only if the check fails
135
+ check=check,
136
+ )
137
+ print(out.path, out.cost_usd) # "scout" or "rescue", and what the answers cost
138
+ ```
139
+
140
+ 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](https://github.com/AndyJakob78/valueproof/blob/main/examples/test_levers_support.py) counts it, and caches it.
141
+
142
+ ## Test a change before you ship it
143
+
144
+ ```bash
145
+ valueproof init my_test.py # a starter test that runs straight away, with fake models
146
+ valueproof compare my_test.py # offline, free
147
+ valueproof compare my_test.py --live --estimate # runs 2 requests for real and prints the projected bill
148
+ valueproof compare my_test.py --live --max-spend 5 # the full test; stops starting new requests at $5
149
+ ```
150
+
151
+ `compare` runs every setup on every request in the same moment and prints:
152
+
153
+ - **cost per usable outcome**, average and median cost, time, and how often the top-tier model ran
154
+ - **blind-review quality**, with hard failures counted separately so no average can hide them
155
+ - **check quality:** how many of the judge's hard failures each eval check caught, missed, and how many false alarms it raised
156
+ - **the lever ledger:** each change against the setup it changes, your estimate written down before the test, and a keep-or-drop verdict
157
+
158
+ To rate a new eval check on replies you already paid for, without running the models again: `--from-results results.json`.
159
+
160
+ **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`.
161
+
162
+ → How to write `my_test.py`, and a demo that runs without an API key: [examples/](https://github.com/AndyJakob78/valueproof/tree/main/examples/) · The step-by-step method: [docs/method.md](https://github.com/AndyJakob78/valueproof/blob/main/docs/method.md)
163
+
164
+ ## When it fits
165
+
166
+ It fits when your product sends many requests to a top-tier 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).
167
+
168
+ 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 top-tier model until the check catches the mistakes that matter.
169
+
170
+ ## How this differs from other tools
171
+
172
+ | Tool | What it does | How it relates |
173
+ |---|---|---|
174
+ | [RouteLLM](https://github.com/lm-sys/RouteLLM) | Trained routers that pick a model per request | A routing technique. Test it against your setup with `valueproof compare`. |
175
+ | [cascadeflow](https://github.com/lemony-ai/cascadeflow) | A cascading runtime for agents | A runtime for production. Test it here first. |
176
+ | [LiteLLM](https://github.com/BerriAI/litellm) | A gateway to 100+ model APIs | Infrastructure to call models. Works as the model behind a setup here. |
177
+ | [promptfoo](https://github.com/promptfoo/promptfoo) | Broad testing of prompts, agents and RAG | A general eval suite. This repo is narrower. |
178
+
179
+ **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.
180
+
181
+ ## More
182
+
183
+ - [Why this exists](https://github.com/AndyJakob78/valueproof/blob/main/docs/why.md): who it is for, cost per outcome vs value shipped, and real-world signals from 2026
184
+ - [Support test](https://github.com/AndyJakob78/valueproof/blob/main/docs/support-test.md) · [Case study](https://github.com/AndyJakob78/valueproof/blob/main/docs/case-study.md) · [Game article test](https://github.com/AndyJakob78/valueproof/blob/main/docs/game-article-test.md) · [A chatbot estimate](https://github.com/AndyJakob78/valueproof/blob/main/docs/example-service-chatbot.md)
185
+ - [Scout & Rescue in detail](https://github.com/AndyJakob78/valueproof/blob/main/docs/scout-and-rescue.md) · [Method](https://github.com/AndyJakob78/valueproof/blob/main/docs/method.md) · [Lessons](https://github.com/AndyJakob78/valueproof/blob/main/docs/lessons.md) · [Templates](https://github.com/AndyJakob78/valueproof/tree/main/templates/)
186
+
187
+ ## Install
188
+
189
+ 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]`.
190
+
191
+ The old package name `ai-mixed-model-cost-optimization` still installs and pulls in `valueproof`.
192
+
193
+ ## Terms
194
+
195
+ - **LLM cascade / Scout & Rescue:** a cheap model (the scout) answers first; a top-tier model (the rescuer) runs only when the answer fails an eval check.
196
+ - **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.
197
+ - **Eval:** the fixed test before shipping: real requests, the eval checks, and a blind review, run the same way for every change.
198
+ - **Blind review:** answers scored on a fixed rubric without knowing which setup wrote them, by an LLM judge or a person.
199
+ - **Hard failure / serious mistake:** a wrong policy rule, a promise the policy doesn't allow, an invented fact, or no answer.
200
+ - **Usable outcome:** a final answer that passed the checks and had no hard failure.
201
+ - **Cost per usable outcome:** everything a setup spent, failed and rescued attempts included, divided by its usable outcomes.
202
+ - **Lever:** one change meant to lower cost, tested on its own.
203
+
204
+ ## About
205
+
206
+ 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.
207
+
208
+ Text: [CC BY 4.0](https://github.com/AndyJakob78/valueproof/blob/main/LICENSE). Code in [src/](https://github.com/AndyJakob78/valueproof/tree/main/src/) and [examples/](https://github.com/AndyJakob78/valueproof/tree/main/examples/): [MIT](https://github.com/AndyJakob78/valueproof/blob/main/LICENSE-CODE).