feat: measure model cost per order; explain the held-out name score - #26
Merged
Conversation
Two reporting gaps that a careful reader would question. Cost per order is now a measurement, not prose. The LLM client counts prompt/completion tokens on every real call (cache hits never reach it, so it is a true spend), prices them at listed model rates, and the run report derives cost per completed order. A cold-cache probe (every call live) measured ₹3.37/order on gpt-4o over 40 tasks / 27 orders — which corrects the earlier "under ₹1" prose, and the README now states the measured figure with the small-model path (~10–15x cheaper on gpt-4o-mini, zero on the free gpt-oss backend) and the cost story: only the propose step calls a model, so cost does not scale with order value. Evidence in results/gpt4o_costprobe/. Held-out name score (0.094) now carries one sentence explaining why it is reported: it is the offline dictionary backend, which cannot know a brand it was never given (gpt-4o lifts the same column to 0.469), and it is not a safety number — an uncertain name is review-queued, never guessed, so it costs review clicks, not a wrong price or order (those fields score 1.000 on both backends). Also: run_heldout skips a catalog whose vertical has no loaded template merchant instead of crashing on a trimmed corpus (surfaced by the cost probe running on 20 merchants). 91 tests, ruff clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BLrj9TWybDCNw1mWxZgAks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: measure model cost per order; explain the held-out name score
Two reporting gaps that a careful reader would question.
Cost per order is now a measurement, not prose. The LLM client counts
prompt/completion tokens on every real call (cache hits never reach it,
so it is a true spend), prices them at listed model rates, and the run
report derives cost per completed order. A cold-cache probe (every call
live) measured ₹3.37/order on gpt-4o over 40 tasks / 27 orders — which
corrects the earlier "under ₹1" prose, and the README now states the
measured figure with the small-model path (~10–15x cheaper on
gpt-4o-mini, zero on the free gpt-oss backend) and the cost story: only
the propose step calls a model, so cost does not scale with order value.
Evidence in results/gpt4o_costprobe/.
Held-out name score (0.094) now carries one sentence explaining why it
is reported: it is the offline dictionary backend, which cannot know a
brand it was never given (gpt-4o lifts the same column to 0.469), and it
is not a safety number — an uncertain name is review-queued, never
guessed, so it costs review clicks, not a wrong price or order (those
fields score 1.000 on both backends).
Also: run_heldout skips a catalog whose vertical has no loaded template
merchant instead of crashing on a trimmed corpus (surfaced by the cost
probe running on 20 merchants).
91 tests, ruff clean.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01BLrj9TWybDCNw1mWxZgAks