Repository navigation
docs(metrics): Add cache effects and interaction to the net saving - #107
Merged
Merged
Conversation
The metrics doc called llm.savings.cache_effect.usd and llm.savings.interaction.usd "a breakdown" and said "never add it to saved or added". That is correct for tokens: a cache effect nets zero tokens. It is wrong for money. No operation contains an effect, and design §6.2 and check 6 define the bill difference as the operations plus the effects plus the interaction. A dashboard that followed the old text showed every keep-alive ping as a cost (the ping is a spend in added.usd) and never its rescue. - Say that each counter is a separate part, not in saved or added. - Add a "The net saving" section with the full formula. - Update the two metric descriptions and two test comments. No counter changes. The sink still books effects to their own counter. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: DAVID BOAZ <[email protected]>
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.
Summary
The metrics doc called
llm.savings.cache_effect.usdandllm.savings.interaction.usd"a breakdown" and said "never add it to saved or added". That is correct for tokens, because a cache effect nets zero tokens. It is wrong for money:saved.usdandadded.usdfromop.Savedandop.Causedonly.spend(design §4.2, rule 5), so it is inadded.usd. A dashboard that followed the old text showed every ping as a cost and never its rescue.What changed
docs/metrics/metrics.md: each counter is a separate part. It is not insavedoradded. A new section, "The net saving", gives the full formula.metrics/metrics.go: the two metric descriptions say the same.metrics/metrics_test.go: two test comments.No counter changes. The sink still books effects to their own counter.
How it was tested
go test ./...in the root module and inmetrics/.Related: the Cortex dashboards use this formula in boazdavid/cortex PR 1958.
Assisted-By: Claude (Anthropic AI) [email protected]