Repository navigation
logs --ttl-check: why calls had to write the cache again (0.5.0) - #3
Merged
Merged
Conversation
For every call that read nothing from the cache but wrote to it, find the previous call that started the same way (same model, system prompt and tools from the logged request body; same caller and model when there is no body) and show how long before it came: 5 to 60 minutes (the cache expired; the 1-hour cache helps), within 5 minutes (a different server or region, a change later in the request, or parallel calls; the 1-hour cache won't help), over an hour, or after a write that was all on the 1-hour cache. Prices only what the logs show: those re-writes as writes and as reads, and all cache writes at today's and the 1-hour write price. Tested on real invocation logs with request bodies (Converse, ConverseStream, InvokeModel, one body stored in S3; eu-west-1, redacted fixture) and a live 5-minute vs 1-hour run on Sonnet 4.5. Output without the flag is unchanged.
This branch was successfully deployed
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.
Adds
logs --ttl-check: classifies every call that read nothing from the cache but wrote to it by the time since the previous call that started the same way (and region), and prices what the logs show at the read and 1-hour write prices. Tested on real invocation logs with request bodies (eu-west-1, redacted fixture) and a live 5-minute vs 1-hour run. Output without the flag is unchanged.