Skip to content

logs --ttl-check: why calls had to write the cache again (0.5.0) - #3

Merged
Haarris merged 1 commit into
mainfrom
feat/ttl-check
Nov 4, 2026
Merged

Haarris merged 1 commit into
mainfrom
feat/ttl-check

Conversation

@Haarris

@Haarris Haarris commented Nov 4, 2026

Copy link
Copy Markdown
Owner

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.

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.
@Haarris
Haarris merged commit 0d76f58 into main Nov 4, 2026
9 of 10 checks passed

This branch was successfully deployed

1 active deployment
pypi — 0d76f58e Deployed Nov 4, 2026 by Haarris via publish-pypi #9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant