ctxcache 0.3.0__tar.gz → 0.4.1__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 (162) hide show
  1. {ctxcache-0.3.0 → ctxcache-0.4.1}/.github/workflows/ci.yml +6 -4
  2. {ctxcache-0.3.0 → ctxcache-0.4.1}/.github/workflows/contract.yml +1 -3
  3. ctxcache-0.4.1/CHANGELOG.md +15 -0
  4. {ctxcache-0.3.0 → ctxcache-0.4.1}/LICENSE +25 -0
  5. {ctxcache-0.3.0 → ctxcache-0.4.1}/PKG-INFO +52 -26
  6. {ctxcache-0.3.0 → ctxcache-0.4.1}/README.md +50 -24
  7. ctxcache-0.4.1/bench/live/2026-11-30-haiku-claude-code.json +36 -0
  8. ctxcache-0.4.1/bench/live/2026-11-30-model-proof.json +154 -0
  9. {ctxcache-0.3.0 → ctxcache-0.4.1}/ctxcache-synthesis.html +6 -6
  10. {ctxcache-0.3.0 → ctxcache-0.4.1}/ctxcache-v0.1-proof.html +2 -2
  11. {ctxcache-0.3.0 → ctxcache-0.4.1}/ctxcache-v0.1-proof.typescript +1 -1
  12. ctxcache-0.4.1/docs/ADOPTION_BASELINE.md +24 -0
  13. {ctxcache-0.3.0 → ctxcache-0.4.1}/docs/BENCH.md +16 -3
  14. {ctxcache-0.3.0 → ctxcache-0.4.1}/docs/BREAKS.md +2 -2
  15. {ctxcache-0.3.0 → ctxcache-0.4.1}/docs/BUILD_HANDBOOK.md +17 -17
  16. ctxcache-0.4.1/docs/CLAIMS.md +34 -0
  17. {ctxcache-0.3.0 → ctxcache-0.4.1}/docs/DECISIONS.md +1 -1
  18. ctxcache-0.4.1/docs/LIMITS.md +11 -0
  19. {ctxcache-0.3.0 → ctxcache-0.4.1}/docs/METRICS.md +1 -1
  20. ctxcache-0.4.1/docs/PYPI.md +23 -0
  21. ctxcache-0.4.1/docs/REPRODUCE.md +21 -0
  22. {ctxcache-0.3.0 → ctxcache-0.4.1}/docs/STATUS.md +18 -18
  23. ctxcache-0.4.1/docs/hdiagrams/h3_call.svg +1 -0
  24. ctxcache-0.4.1/docs/media/ctxcache-cost-proof-preview.gif +0 -0
  25. ctxcache-0.4.1/docs/media/ctxcache-cost-proof.mp4 +0 -0
  26. ctxcache-0.4.1/examples/01_quickstart_openai.py +134 -0
  27. ctxcache-0.4.1/examples/02_fastapi_streaming_service.py +106 -0
  28. ctxcache-0.4.1/examples/03_opentelemetry_tracing.py +75 -0
  29. ctxcache-0.4.1/examples/README.md +29 -0
  30. ctxcache-0.4.1/examples/github-action/workflow.yml +16 -0
  31. ctxcache-0.4.1/experiments/2026-11-30-m4-sim/RECORD.md +8 -0
  32. ctxcache-0.4.1/experiments/2026-11-30-m4-sim/stdout.txt +99 -0
  33. ctxcache-0.4.1/experiments/RECORD_TEMPLATE.md +23 -0
  34. ctxcache-0.4.1/gtm/hdiagrams/g1_funnel.svg +1 -0
  35. {ctxcache-0.3.0 → ctxcache-0.4.1}/pyproject.toml +2 -2
  36. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/adapters/anthropic.py +8 -5
  37. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/cli.py +116 -0
  38. ctxcache-0.4.1/src/ctxcache/demo.py +101 -0
  39. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/ledger.py +9 -0
  40. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/wrapper.py +1 -1
  41. ctxcache-0.4.1/tests/fixtures/check_clean.py +26 -0
  42. ctxcache-0.4.1/tests/fixtures/check_reorder.py +31 -0
  43. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_bedrock_converse.py +1 -1
  44. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_cli.py +38 -0
  45. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_invariants.py +11 -10
  46. ctxcache-0.4.1/tests/test_observe_wire.py +228 -0
  47. {ctxcache-0.3.0 → ctxcache-0.4.1}/uv.lock +45 -45
  48. ctxcache-0.3.0/AGENTS.md +0 -1
  49. ctxcache-0.3.0/docs/hdiagrams/g1_funnel.svg +0 -1
  50. ctxcache-0.3.0/docs/media/ctxcache-cost-proof.mp4 +0 -0
  51. ctxcache-0.3.0/gtm/hdiagrams/h3_call.svg +0 -1
  52. {ctxcache-0.3.0 → ctxcache-0.4.1}/.githooks/pre-push +0 -0
  53. {ctxcache-0.3.0 → ctxcache-0.4.1}/.github/workflows/bedrock-probe.yml +0 -0
  54. {ctxcache-0.3.0 → ctxcache-0.4.1}/.github/workflows/live-session.yml +0 -0
  55. {ctxcache-0.3.0 → ctxcache-0.4.1}/.github/workflows/release.yml +0 -0
  56. {ctxcache-0.3.0 → ctxcache-0.4.1}/.gitignore +0 -0
  57. {ctxcache-0.3.0 → ctxcache-0.4.1}/CLAUDE.md +0 -0
  58. {ctxcache-0.3.0 → ctxcache-0.4.1}/DELIVERY.md +0 -0
  59. {ctxcache-0.3.0 → ctxcache-0.4.1}/Makefile +0 -0
  60. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/bedrock_probe.py +0 -0
  61. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/live/2026-11-12-broad.json +0 -0
  62. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/live/2026-11-12-tools.json +0 -0
  63. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/live/2026-11-12.json +0 -0
  64. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/live_broad.py +0 -0
  65. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/live_session.py +0 -0
  66. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/live_summary.py +0 -0
  67. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/m0/__init__.py +0 -0
  68. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/m0/arms.py +0 -0
  69. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/m0/runner.py +0 -0
  70. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/m2/compaction_study.py +0 -0
  71. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/m2/runner.py +0 -0
  72. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/m3/runner.py +0 -0
  73. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/m4/freeze_report.py +0 -0
  74. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/m4/runner.py +0 -0
  75. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/m5/runner.py +0 -0
  76. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/m6/runner.py +0 -0
  77. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/render_live.py +0 -0
  78. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/tasks/__init__.py +0 -0
  79. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/tasks/base.py +0 -0
  80. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/tasks/memory.py +0 -0
  81. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/tasks/mixed.py +0 -0
  82. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/tasks/registry.py +0 -0
  83. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/templates/__init__.py +0 -0
  84. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/templates/minimal.py +0 -0
  85. {ctxcache-0.3.0 → ctxcache-0.4.1}/bench/templates/typical.py +0 -0
  86. {ctxcache-0.3.0 → ctxcache-0.4.1}/ctxcache-live-session.html +0 -0
  87. {ctxcache-0.3.0 → ctxcache-0.4.1}/ctxcache-scenarios.html +0 -0
  88. {ctxcache-0.3.0 → ctxcache-0.4.1}/docs/REPORT.md +0 -0
  89. {ctxcache-0.3.0/gtm → ctxcache-0.4.1/docs}/hdiagrams/g1_funnel.svg +0 -0
  90. {ctxcache-0.3.0 → ctxcache-0.4.1}/docs/hdiagrams/g2_flywheel.svg +0 -0
  91. {ctxcache-0.3.0 → ctxcache-0.4.1}/docs/hdiagrams/h1_arch.svg +0 -0
  92. {ctxcache-0.3.0 → ctxcache-0.4.1}/docs/hdiagrams/h2_layout.svg +0 -0
  93. {ctxcache-0.3.0 → ctxcache-0.4.1}/docs/hdiagrams/h4_plan.svg +0 -0
  94. {ctxcache-0.3.0 → ctxcache-0.4.1}/gtm/CLAIMS.md +0 -0
  95. {ctxcache-0.3.0 → ctxcache-0.4.1}/gtm/GTM_HANDBOOK.md +0 -0
  96. {ctxcache-0.3.0 → ctxcache-0.4.1}/gtm/SCOREBOARD.md +0 -0
  97. {ctxcache-0.3.0 → ctxcache-0.4.1}/gtm/hdiagrams/g2_flywheel.svg +0 -0
  98. {ctxcache-0.3.0 → ctxcache-0.4.1}/gtm/hdiagrams/h1_arch.svg +0 -0
  99. {ctxcache-0.3.0 → ctxcache-0.4.1}/gtm/hdiagrams/h2_layout.svg +0 -0
  100. {ctxcache-0.3.0/docs → ctxcache-0.4.1/gtm}/hdiagrams/h3_call.svg +0 -0
  101. {ctxcache-0.3.0 → ctxcache-0.4.1}/gtm/hdiagrams/h4_plan.svg +0 -0
  102. {ctxcache-0.3.0 → ctxcache-0.4.1}/prompts/BUILD_AGENT_PROMPT.md +0 -0
  103. {ctxcache-0.3.0 → ctxcache-0.4.1}/prompts/GTM_AGENT_PROMPT.md +0 -0
  104. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/__init__.py +0 -0
  105. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/adapters/__init__.py +0 -0
  106. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/adapters/base.py +0 -0
  107. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/adapters/bedrock.py +0 -0
  108. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/adapters/gemini.py +0 -0
  109. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/adapters/openai.py +0 -0
  110. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/bedrock_converse.py +0 -0
  111. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/bench/__init__.py +0 -0
  112. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/bench/runner.py +0 -0
  113. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/compaction.py +0 -0
  114. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/cost.py +0 -0
  115. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/data/breaks.yaml +0 -0
  116. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/data/providers.toml +0 -0
  117. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/exceptions.py +0 -0
  118. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/fingerprint.py +0 -0
  119. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/guard.py +0 -0
  120. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/integrations/__init__.py +0 -0
  121. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/integrations/langchain.py +0 -0
  122. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/integrations/langgraph.py +0 -0
  123. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/integrations/openai_agents.py +0 -0
  124. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/integrations/pydantic_ai.py +0 -0
  125. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/layout.py +0 -0
  126. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/memory/__init__.py +0 -0
  127. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/memory/checks.py +0 -0
  128. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/memory/recall.py +0 -0
  129. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/memory/store.py +0 -0
  130. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/offload.py +0 -0
  131. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/openai_chat.py +0 -0
  132. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/otel.py +0 -0
  133. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/planner.py +0 -0
  134. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/policies/__init__.py +0 -0
  135. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/policies/route.py +0 -0
  136. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/replay.py +0 -0
  137. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/scenarios.py +0 -0
  138. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/segments.py +0 -0
  139. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/sim/__init__.py +0 -0
  140. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/sim/cache_sim.py +0 -0
  141. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/sim/tokens.py +0 -0
  142. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/testing.py +0 -0
  143. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/tools.py +0 -0
  144. {ctxcache-0.3.0 → ctxcache-0.4.1}/src/ctxcache/trace.py +0 -0
  145. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/__init__.py +0 -0
  146. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_chat_optimize.py +0 -0
  147. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_compaction.py +0 -0
  148. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_contract.py +0 -0
  149. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_guard.py +0 -0
  150. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_integrations.py +0 -0
  151. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_live_summary.py +0 -0
  152. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_memory.py +0 -0
  153. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_named_tests_exist.py +0 -0
  154. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_otel.py +0 -0
  155. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_outbound.py +0 -0
  156. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_perf.py +0 -0
  157. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_planner.py +0 -0
  158. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_routing.py +0 -0
  159. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_scenarios.py +0 -0
  160. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_sim.py +0 -0
  161. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_stream.py +0 -0
  162. {ctxcache-0.3.0 → ctxcache-0.4.1}/tests/test_testing.py +0 -0
@@ -1,16 +1,18 @@
1
1
  name: check
2
2
 
3
+ # Once per night (~00:00 IST). Manual re-run via Actions tab.
3
4
  on:
4
- push:
5
- pull_request:
5
+ schedule:
6
+ - cron: "30 18 * * *"
7
+ workflow_dispatch:
6
8
 
7
9
  jobs:
8
10
  check:
9
11
  runs-on: ubuntu-latest
10
12
  strategy:
11
- fail-fast: false
13
+ fail-fast: true
12
14
  matrix:
13
- python-version: ["3.10", "3.11", "3.12"]
15
+ python-version: ["3.12"]
14
16
  steps:
15
17
  - uses: actions/checkout@v4
16
18
  - uses: astral-sh/setup-uv@v5
@@ -6,8 +6,6 @@ name: contract
6
6
  # before any model is called, and that stop is a success. A failed model
7
7
  # step does not block a retry the same day.
8
8
  on:
9
- schedule:
10
- - cron: "0 15 * * *"
11
9
  workflow_dispatch:
12
10
 
13
11
  permissions:
@@ -15,7 +13,7 @@ permissions:
15
13
  actions: read
16
14
 
17
15
  concurrency:
18
- group: hearth-contract
16
+ group: ctxcache-contract
19
17
  cancel-in-progress: false
20
18
 
21
19
  jobs:
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ ## 0.4.1
4
+
5
+ - Anthropic `input_tokens` is the uncached tail. A cache read no longer raises after the provider has answered.
6
+ - A recording error on a normal call returns the provider response.
7
+ - `safe` mode does not write Anthropic `cache_control`. The README says so.
8
+ - The README records the one Haiku clock comparison from 2026-11-30.
9
+
10
+ ## 0.4.0
11
+
12
+ - `ctxcache demo` runs offline: three named cache breaks, a simulator price, then the fix.
13
+ - `ctxcache check` fails when a local run records a user-caused prefix break. An empty run fails unless `--allow-empty`.
14
+ - `ctxcache report` prints one row per turn from the ledger.
15
+ - README numbers are tagged in `docs/CLAIMS.md`. Limits are in `docs/LIMITS.md`.
@@ -174,3 +174,28 @@
174
174
  of your accepting any such warranty or additional liability.
175
175
 
176
176
  END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 CtxCache contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: ctxcache
3
- Version: 0.3.0
3
+ Version: 0.4.1
4
4
  Summary: Embeddable context engine that keeps an AI agent's prompt cache warm and proves it with measurements.
5
5
  Author-email: Abhranshu <abhranshu@atnms.ai>
6
6
  License-Expression: Apache-2.0
7
7
  License-File: LICENSE
8
- Classifier: Development Status :: 3 - Alpha
8
+ Classifier: Development Status :: 4 - Beta
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: License :: OSI Approved :: Apache Software License
11
11
  Classifier: Programming Language :: Python :: 3
@@ -30,21 +30,40 @@ Requires-Dist: opentelemetry-api>=1.20.0; extra == 'otel'
30
30
  Requires-Dist: opentelemetry-sdk>=1.20.0; extra == 'otel'
31
31
  Description-Content-Type: text/markdown
32
32
 
33
- # CtxCache (`ctxcache`)
33
+ # CtxCache
34
+
35
+ ```
36
+ ____ _______ ______ _ ____ _ _ _____
37
+ / ___|_ _\ \/ / ___| / \ / ___| | | | ____|
38
+ | | | | \ / | / _ \| | | |_| | _|
39
+ | |___ | | / \ |___ / ___ \ |___| _ | |___
40
+ \____| |_| /_/\_\____/_/ \_\____|_| |_|_____|
41
+ ```
34
42
 
35
43
  [![CI](https://github.com/jishmisc28/ctxcache/actions/workflows/ci.yml/badge.svg)](https://github.com/jishmisc28/ctxcache/actions)
36
44
  [![PyPI version](https://img.shields.io/pypi/v/ctxcache.svg)](https://pypi.org/project/ctxcache/)
37
- [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
45
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
38
46
  [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
39
47
 
48
+ **CtxCache** is an open source Python library that keeps an AI agent's prompt cache warm — in-process, not a gateway — and proves the bill with measurements. Every number on this page is tagged in [`docs/CLAIMS.md`](docs/CLAIMS.md). What is not proven is in [`docs/LIMITS.md`](docs/LIMITS.md).
49
+
40
50
  ## Proof video
41
51
 
42
- A clear measured proof film for CtxCache is being remade. Until it ships, see the live session numbers in [`docs/REPORT.md`](docs/REPORT.md) and [`bench/live/2026-11-12-broad.json`](bench/live/2026-11-12-broad.json) (Kimi K3: paid **$0.95546138**, uncached **$2.22368850**, saved **$1.26822712**).
52
+ LIVE, one Kimi K3 session: the standing document, no-cache vs cached cost, the break when the document changes, and the receipt — **paid $0.95546138** against **$2.22368850** uncached (**saved $1.26822712**). Source: [`bench/live/2026-11-12-broad.json`](bench/live/2026-11-12-broad.json).
53
+
54
+ [`bench/live/2026-11-12-tools.json`](bench/live/2026-11-12-tools.json) is the tool session: one tool description changed, and the cache-read count on that turn stayed high.
55
+
56
+ LIVE, 2026-11-30, the same short prompt twice: Nova Micro, Nova Lite, Nova Pro, and Kimi K3 returned a cache read on the second call. gpt-oss returned no cache field, and both of those calls cost **$0.00014265**. A clock on the first line of the Nova Micro prompt dropped the read to 0. Receipt: [`bench/live/2026-11-30-model-proof.json`](bench/live/2026-11-30-model-proof.json). This run cost **$0.00525445**.
57
+
58
+ LIVE, the same day, one new clock on a Haiku 5.5 prompt: `safe` cost **$0.00124700** and read 0 cached tokens. `optimize` moved the clock and cost **$0.00035128**, with 4,728 tokens read from cache. That call cost **$0.00089572** less. Claude Code had already turned caching on. Receipt: [`bench/live/2026-11-30-haiku-claude-code.json`](bench/live/2026-11-30-haiku-claude-code.json).
43
59
 
60
+ ![CtxCache measured proof](docs/media/ctxcache-cost-proof-preview.gif)
61
+
62
+ [Full MP4 (~81s)](docs/media/ctxcache-cost-proof.mp4) · [Release download](https://github.com/jishmisc28/ctxcache/releases/download/proof-video/ctxcache-cost-proof.mp4) · [Live session write-up](docs/REPORT.md)
44
63
 
45
64
  An embeddable context engine that keeps an AI agent's prompt cache warm and proves it with measurements.
46
65
 
47
- Prompt caching cuts LLM input cost and time-to-first-token (TTFT) by up to 90%, but agent loops routinely break provider caches on every turn: volatile timestamps prepended to system instructions, fluctuating tool definitions, non-deterministic JSON serialization, and uncompacted chat histories invalidate prefixes silently.
66
+ Agent loops break provider caches on later turns when a timestamp sits in the system prompt, tool definitions change order, JSON key order changes, or the history is rewritten. CtxCache wraps the client you already have, records the break, and can put the stable prefix back.
48
67
 
49
68
  CtxCache wraps your existing LLM client in-process, measures cache behavior, restores stable prefix layouts, protects against regressions in CI, and traces every cache break to its exact root cause.
50
69
 
@@ -52,12 +71,11 @@ CtxCache wraps your existing LLM client in-process, measures cache behavior, res
52
71
 
53
72
  ## Highlights
54
73
 
55
- - **Zero Required External Dependencies:** Pure Python standard library implementation on Python 3.11+ (`tomli` backport for 3.10).
56
- - **Sub-Millisecond Overhead:** Adds < 2.0 ms per call at 50,000 tokens of context (measured p50: **0.66 ms**, p99: **1.08 ms**; claim C-06).
57
- - **Comprehensive Break Taxonomy:** Identifies 15 distinct cache break causes and attributes fault honestly (never blames developers for provider cold starts, minimum-token thresholds, or TTL expirations; claim C-05).
58
- - **Proven Cost Savings:** Demonstrates a **42.0% overall input cost reduction** across 4 frameworks × 2 providers on 20 pre-registered tasks (claim C-08).
59
- - **Calibrated Offline Simulation:** Includes `FakeProvider` and `CacheSimulator` predicting per-session read share within **0.00 points MAE** on held-out sessions (claim C-07).
60
- - **One-Line Integration:** Drop-in adapters for LangGraph, Pydantic AI, and the OpenAI Agents SDK (claim C-10).
74
+ - **In process.** Pure Python. Requires Python 3.10+ (`tomli` on 3.10 only). No gateway.
75
+ - **SIM, not a bill.** The frozen simulator report is a **42.0%** input-cost reduction across 4 frameworks × 2 providers on 20 tasks. Source: [`docs/REPORT.md`](docs/REPORT.md) (2026-10-19).
76
+ - **SIM calibration.** Held-out read-share error in that same report is **0.00 points MAE**. That fit is not a forecast of a future provider bill.
77
+ - **MICROBENCH.** `tests/test_perf.py` checks that safe-mode work at about 50,000 tokens stays under 2 ms p50 and 5 ms p99. A status note recorded 0.66 ms p50 and 1.08 ms p99 on one machine with GC off. See [`docs/CLAIMS.md`](docs/CLAIMS.md).
78
+ - **15 break causes** in `src/ctxcache/data/breaks.yaml`. Cold starts, minimum length, and TTL expiry are not labeled as your bug.
61
79
 
62
80
  ---
63
81
 
@@ -67,7 +85,15 @@ CtxCache wraps your existing LLM client in-process, measures cache behavior, res
67
85
  pip install ctxcache
68
86
  ```
69
87
 
70
- See four cache failures without an API key. The prices are the simulator, not a provider bill.
88
+ Run this first. No API key and no network. The prices are the simulator, not a provider bill.
89
+
90
+ ```bash
91
+ ctxcache demo
92
+ ```
93
+
94
+ A CI job can run `ctxcache check` the same way, with no API key. The workflow file is [`examples/github-action/workflow.yml`](examples/github-action/workflow.yml).
95
+
96
+ The same offline prices, four named cases:
71
97
 
72
98
  ```bash
73
99
  ctxcache scenarios
@@ -76,7 +102,7 @@ ctxcache scenarios --html ctxcache-scenarios.html
76
102
 
77
103
  On Amazon Bedrock the Chat Completions URL that answers is `https://bedrock-runtime.us-east-1.amazonaws.com/openai/v1/chat/completions`, and the gpt-oss-120b id is `openai.gpt-oss-120b-1:0`. On 2 Nov 2026 two identical 1,699-token prompts came back with no cached-token field. Optimize mode still moves a clock out of the system message. It does not invent a cache discount the provider did not report.
78
104
 
79
- Nova Micro on the Converse API did return a cache read. Through `ctxcache.wrap` in observe mode, the second identical call reported 3,601 cached input tokens and 6 uncached tokens. The dollar cost is not stated here, because this model has no sourced price in `providers.toml` yet.
105
+ Nova Micro on the Converse API did return a cache read. Through `ctxcache.wrap` in observe mode, the second identical call reported 3,601 cached input tokens and 6 uncached tokens. The priced Nova calls are the 2026-11-30 receipt above.
80
106
 
81
107
  Optional provider and integration extras:
82
108
  ```bash
@@ -106,7 +132,7 @@ response = client.messages.create(
106
132
  ```
107
133
 
108
134
  ### 2. `safe` Mode (Content-Equivalent Stabilization)
109
- Adds, removes, or modifies no prompt or tool text (claim C-04). Restores the first-seen tool order and injects cache breakpoints/metadata strictly matching provider rules (e.g. Anthropic `cache_control` breakpoints, OpenAI cache keys).
135
+ Adds, removes, or modifies no prompt or tool text (claim C-04). Restores the first-seen tool order. On OpenAI it can set `prompt_cache_key`. It does not write Anthropic `cache_control` blocks.
110
136
 
111
137
  ```python
112
138
  client = ctxcache.wrap(Anthropic(), mode="safe")
@@ -114,7 +140,7 @@ client = ctxcache.wrap(Anthropic(), mode="safe")
114
140
 
115
141
  ### 3. `optimize` Mode (Active Context Engineering)
116
142
  Performs structured context layout optimizations:
117
- - **Volatile Relocation:** Relocates dynamic timestamps and runtime identifiers from the static system prefix to the user turn tail, converting 0% cache hits into 100% prefix reuse on subsequent turns.
143
+ - **Volatile Relocation:** Moves timestamps and runtime identifiers from the system prefix to the user turn. This is a layout change. It is not the 42.0% SIM figure and not the Kimi receipt.
118
144
  - **Large Output Offloading:** Stores tool outputs exceeding 2,000 tokens in a local blob store and passes a deterministic handle stub, keeping the prefix stable when frameworks resend full tool outputs.
119
145
  - **Planned History Compaction:** Compares the one-time summary rewrite penalty against expected remaining turns ($k^* \approx 8.0$ calls) to compact history only when it yields net cost savings (claim C-09).
120
146
 
@@ -161,34 +187,34 @@ set_default_openai_client(OpenAI())
161
187
 
162
188
  ## CLI & Tooling
163
189
 
164
- ### `hearth report`
190
+ ### `ctxcache report`
165
191
  Inspect aggregated cache performance, read share, and exact input dollar savings for a session from the SQLite ledger:
166
192
  ```bash
167
- hearth report --session "session-prod-worker-1"
193
+ ctxcache report --session "session-prod-worker-1"
168
194
  ```
169
195
 
170
- ### `hearth diagnose`
196
+ ### `ctxcache diagnose`
171
197
  Analyze root causes of cache breaks in a JSONL trace file:
172
198
  ```bash
173
- hearth diagnose ./traces/session.jsonl
199
+ ctxcache diagnose ./traces/session.jsonl
174
200
  ```
175
201
 
176
- ### `hearth replay`
202
+ ### `ctxcache replay`
177
203
  Replay recorded JSONL traces through the deterministic cache simulator under `observe`, `safe`, and `optimize` policies:
178
204
  ```bash
179
- hearth replay ./traces/session.jsonl
205
+ ctxcache replay ./traces/session.jsonl
180
206
  ```
181
207
 
182
- ### `hearth guard`
208
+ ### `ctxcache guard`
183
209
  Protect against prompt cache regressions in CI test suites. Fails if a code commit introduces user-caused prefix breaks:
184
210
  ```bash
185
- hearth guard --baseline ./traces/baseline.jsonl --run "pytest tests/agent/"
211
+ ctxcache guard --baseline ./traces/baseline.jsonl --run "pytest tests/agent/"
186
212
  ```
187
213
 
188
- ### `hearth bench --report`
214
+ ### `ctxcache bench --report`
189
215
  Reproduce the frozen Cache Efficiency Report v1 across all 20 pre-registered tasks:
190
216
  ```bash
191
- hearth bench --report
217
+ ctxcache bench --report
192
218
  ```
193
219
 
194
220
  ---
@@ -1,18 +1,37 @@
1
- # CtxCache (`ctxcache`)
1
+ # CtxCache
2
+
3
+ ```
4
+ ____ _______ ______ _ ____ _ _ _____
5
+ / ___|_ _\ \/ / ___| / \ / ___| | | | ____|
6
+ | | | | \ / | / _ \| | | |_| | _|
7
+ | |___ | | / \ |___ / ___ \ |___| _ | |___
8
+ \____| |_| /_/\_\____/_/ \_\____|_| |_|_____|
9
+ ```
2
10
 
3
11
  [![CI](https://github.com/jishmisc28/ctxcache/actions/workflows/ci.yml/badge.svg)](https://github.com/jishmisc28/ctxcache/actions)
4
12
  [![PyPI version](https://img.shields.io/pypi/v/ctxcache.svg)](https://pypi.org/project/ctxcache/)
5
- [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
13
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
6
14
  [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
7
15
 
16
+ **CtxCache** is an open source Python library that keeps an AI agent's prompt cache warm — in-process, not a gateway — and proves the bill with measurements. Every number on this page is tagged in [`docs/CLAIMS.md`](docs/CLAIMS.md). What is not proven is in [`docs/LIMITS.md`](docs/LIMITS.md).
17
+
8
18
  ## Proof video
9
19
 
10
- A clear measured proof film for CtxCache is being remade. Until it ships, see the live session numbers in [`docs/REPORT.md`](docs/REPORT.md) and [`bench/live/2026-11-12-broad.json`](bench/live/2026-11-12-broad.json) (Kimi K3: paid **$0.95546138**, uncached **$2.22368850**, saved **$1.26822712**).
20
+ LIVE, one Kimi K3 session: the standing document, no-cache vs cached cost, the break when the document changes, and the receipt — **paid $0.95546138** against **$2.22368850** uncached (**saved $1.26822712**). Source: [`bench/live/2026-11-12-broad.json`](bench/live/2026-11-12-broad.json).
21
+
22
+ [`bench/live/2026-11-12-tools.json`](bench/live/2026-11-12-tools.json) is the tool session: one tool description changed, and the cache-read count on that turn stayed high.
23
+
24
+ LIVE, 2026-11-30, the same short prompt twice: Nova Micro, Nova Lite, Nova Pro, and Kimi K3 returned a cache read on the second call. gpt-oss returned no cache field, and both of those calls cost **$0.00014265**. A clock on the first line of the Nova Micro prompt dropped the read to 0. Receipt: [`bench/live/2026-11-30-model-proof.json`](bench/live/2026-11-30-model-proof.json). This run cost **$0.00525445**.
25
+
26
+ LIVE, the same day, one new clock on a Haiku 5.5 prompt: `safe` cost **$0.00124700** and read 0 cached tokens. `optimize` moved the clock and cost **$0.00035128**, with 4,728 tokens read from cache. That call cost **$0.00089572** less. Claude Code had already turned caching on. Receipt: [`bench/live/2026-11-30-haiku-claude-code.json`](bench/live/2026-11-30-haiku-claude-code.json).
11
27
 
28
+ ![CtxCache measured proof](docs/media/ctxcache-cost-proof-preview.gif)
29
+
30
+ [Full MP4 (~81s)](docs/media/ctxcache-cost-proof.mp4) · [Release download](https://github.com/jishmisc28/ctxcache/releases/download/proof-video/ctxcache-cost-proof.mp4) · [Live session write-up](docs/REPORT.md)
12
31
 
13
32
  An embeddable context engine that keeps an AI agent's prompt cache warm and proves it with measurements.
14
33
 
15
- Prompt caching cuts LLM input cost and time-to-first-token (TTFT) by up to 90%, but agent loops routinely break provider caches on every turn: volatile timestamps prepended to system instructions, fluctuating tool definitions, non-deterministic JSON serialization, and uncompacted chat histories invalidate prefixes silently.
34
+ Agent loops break provider caches on later turns when a timestamp sits in the system prompt, tool definitions change order, JSON key order changes, or the history is rewritten. CtxCache wraps the client you already have, records the break, and can put the stable prefix back.
16
35
 
17
36
  CtxCache wraps your existing LLM client in-process, measures cache behavior, restores stable prefix layouts, protects against regressions in CI, and traces every cache break to its exact root cause.
18
37
 
@@ -20,12 +39,11 @@ CtxCache wraps your existing LLM client in-process, measures cache behavior, res
20
39
 
21
40
  ## Highlights
22
41
 
23
- - **Zero Required External Dependencies:** Pure Python standard library implementation on Python 3.11+ (`tomli` backport for 3.10).
24
- - **Sub-Millisecond Overhead:** Adds < 2.0 ms per call at 50,000 tokens of context (measured p50: **0.66 ms**, p99: **1.08 ms**; claim C-06).
25
- - **Comprehensive Break Taxonomy:** Identifies 15 distinct cache break causes and attributes fault honestly (never blames developers for provider cold starts, minimum-token thresholds, or TTL expirations; claim C-05).
26
- - **Proven Cost Savings:** Demonstrates a **42.0% overall input cost reduction** across 4 frameworks × 2 providers on 20 pre-registered tasks (claim C-08).
27
- - **Calibrated Offline Simulation:** Includes `FakeProvider` and `CacheSimulator` predicting per-session read share within **0.00 points MAE** on held-out sessions (claim C-07).
28
- - **One-Line Integration:** Drop-in adapters for LangGraph, Pydantic AI, and the OpenAI Agents SDK (claim C-10).
42
+ - **In process.** Pure Python. Requires Python 3.10+ (`tomli` on 3.10 only). No gateway.
43
+ - **SIM, not a bill.** The frozen simulator report is a **42.0%** input-cost reduction across 4 frameworks × 2 providers on 20 tasks. Source: [`docs/REPORT.md`](docs/REPORT.md) (2026-10-19).
44
+ - **SIM calibration.** Held-out read-share error in that same report is **0.00 points MAE**. That fit is not a forecast of a future provider bill.
45
+ - **MICROBENCH.** `tests/test_perf.py` checks that safe-mode work at about 50,000 tokens stays under 2 ms p50 and 5 ms p99. A status note recorded 0.66 ms p50 and 1.08 ms p99 on one machine with GC off. See [`docs/CLAIMS.md`](docs/CLAIMS.md).
46
+ - **15 break causes** in `src/ctxcache/data/breaks.yaml`. Cold starts, minimum length, and TTL expiry are not labeled as your bug.
29
47
 
30
48
  ---
31
49
 
@@ -35,7 +53,15 @@ CtxCache wraps your existing LLM client in-process, measures cache behavior, res
35
53
  pip install ctxcache
36
54
  ```
37
55
 
38
- See four cache failures without an API key. The prices are the simulator, not a provider bill.
56
+ Run this first. No API key and no network. The prices are the simulator, not a provider bill.
57
+
58
+ ```bash
59
+ ctxcache demo
60
+ ```
61
+
62
+ A CI job can run `ctxcache check` the same way, with no API key. The workflow file is [`examples/github-action/workflow.yml`](examples/github-action/workflow.yml).
63
+
64
+ The same offline prices, four named cases:
39
65
 
40
66
  ```bash
41
67
  ctxcache scenarios
@@ -44,7 +70,7 @@ ctxcache scenarios --html ctxcache-scenarios.html
44
70
 
45
71
  On Amazon Bedrock the Chat Completions URL that answers is `https://bedrock-runtime.us-east-1.amazonaws.com/openai/v1/chat/completions`, and the gpt-oss-120b id is `openai.gpt-oss-120b-1:0`. On 2 Nov 2026 two identical 1,699-token prompts came back with no cached-token field. Optimize mode still moves a clock out of the system message. It does not invent a cache discount the provider did not report.
46
72
 
47
- Nova Micro on the Converse API did return a cache read. Through `ctxcache.wrap` in observe mode, the second identical call reported 3,601 cached input tokens and 6 uncached tokens. The dollar cost is not stated here, because this model has no sourced price in `providers.toml` yet.
73
+ Nova Micro on the Converse API did return a cache read. Through `ctxcache.wrap` in observe mode, the second identical call reported 3,601 cached input tokens and 6 uncached tokens. The priced Nova calls are the 2026-11-30 receipt above.
48
74
 
49
75
  Optional provider and integration extras:
50
76
  ```bash
@@ -74,7 +100,7 @@ response = client.messages.create(
74
100
  ```
75
101
 
76
102
  ### 2. `safe` Mode (Content-Equivalent Stabilization)
77
- Adds, removes, or modifies no prompt or tool text (claim C-04). Restores the first-seen tool order and injects cache breakpoints/metadata strictly matching provider rules (e.g. Anthropic `cache_control` breakpoints, OpenAI cache keys).
103
+ Adds, removes, or modifies no prompt or tool text (claim C-04). Restores the first-seen tool order. On OpenAI it can set `prompt_cache_key`. It does not write Anthropic `cache_control` blocks.
78
104
 
79
105
  ```python
80
106
  client = ctxcache.wrap(Anthropic(), mode="safe")
@@ -82,7 +108,7 @@ client = ctxcache.wrap(Anthropic(), mode="safe")
82
108
 
83
109
  ### 3. `optimize` Mode (Active Context Engineering)
84
110
  Performs structured context layout optimizations:
85
- - **Volatile Relocation:** Relocates dynamic timestamps and runtime identifiers from the static system prefix to the user turn tail, converting 0% cache hits into 100% prefix reuse on subsequent turns.
111
+ - **Volatile Relocation:** Moves timestamps and runtime identifiers from the system prefix to the user turn. This is a layout change. It is not the 42.0% SIM figure and not the Kimi receipt.
86
112
  - **Large Output Offloading:** Stores tool outputs exceeding 2,000 tokens in a local blob store and passes a deterministic handle stub, keeping the prefix stable when frameworks resend full tool outputs.
87
113
  - **Planned History Compaction:** Compares the one-time summary rewrite penalty against expected remaining turns ($k^* \approx 8.0$ calls) to compact history only when it yields net cost savings (claim C-09).
88
114
 
@@ -129,34 +155,34 @@ set_default_openai_client(OpenAI())
129
155
 
130
156
  ## CLI & Tooling
131
157
 
132
- ### `hearth report`
158
+ ### `ctxcache report`
133
159
  Inspect aggregated cache performance, read share, and exact input dollar savings for a session from the SQLite ledger:
134
160
  ```bash
135
- hearth report --session "session-prod-worker-1"
161
+ ctxcache report --session "session-prod-worker-1"
136
162
  ```
137
163
 
138
- ### `hearth diagnose`
164
+ ### `ctxcache diagnose`
139
165
  Analyze root causes of cache breaks in a JSONL trace file:
140
166
  ```bash
141
- hearth diagnose ./traces/session.jsonl
167
+ ctxcache diagnose ./traces/session.jsonl
142
168
  ```
143
169
 
144
- ### `hearth replay`
170
+ ### `ctxcache replay`
145
171
  Replay recorded JSONL traces through the deterministic cache simulator under `observe`, `safe`, and `optimize` policies:
146
172
  ```bash
147
- hearth replay ./traces/session.jsonl
173
+ ctxcache replay ./traces/session.jsonl
148
174
  ```
149
175
 
150
- ### `hearth guard`
176
+ ### `ctxcache guard`
151
177
  Protect against prompt cache regressions in CI test suites. Fails if a code commit introduces user-caused prefix breaks:
152
178
  ```bash
153
- hearth guard --baseline ./traces/baseline.jsonl --run "pytest tests/agent/"
179
+ ctxcache guard --baseline ./traces/baseline.jsonl --run "pytest tests/agent/"
154
180
  ```
155
181
 
156
- ### `hearth bench --report`
182
+ ### `ctxcache bench --report`
157
183
  Reproduce the frozen Cache Efficiency Report v1 across all 20 pre-registered tasks:
158
184
  ```bash
159
- hearth bench --report
185
+ ctxcache bench --report
160
186
  ```
161
187
 
162
188
  ---
@@ -0,0 +1,36 @@
1
+ {
2
+ "date": "2026-11-30",
3
+ "model": "claude-haiku-5-5",
4
+ "path": "Claude Code CLI 2.1.332, claude -p --output-format json. A thin client forwarded that usage into ctxcache.wrap.",
5
+ "price_url": "https://platform.claude.com/docs/en/about-claude/pricing",
6
+ "price_read_on": "2026-11-30",
7
+ "prices_per_million": {
8
+ "input": "0.10",
9
+ "cache_write_1h": "0.20",
10
+ "cache_read": "0.01",
11
+ "output": "0.50"
12
+ },
13
+ "note": "The CLI set its own 1-hour cache_control and added its own tokens. About 1,000 of those tokens changed on every call. The raw stdout stayed on the machine that ran Claude Code. The dollars below were recomputed from the reported token fields and the price page, and they matched.",
14
+ "calls": [
15
+ {
16
+ "call": "new clock, safe",
17
+ "input_tokens": 2,
18
+ "cache_write_input_tokens": 6224,
19
+ "cache_read_input_tokens": 0,
20
+ "output_tokens": 4,
21
+ "usd": "0.00124700"
22
+ },
23
+ {
24
+ "call": "new clock, optimize",
25
+ "input_tokens": 2,
26
+ "cache_write_input_tokens": 1509,
27
+ "cache_read_input_tokens": 4728,
28
+ "output_tokens": 4,
29
+ "usd": "0.00035128",
30
+ "note": "optimize moved the clock out of the system text. This clock value had not been sent before."
31
+ }
32
+ ],
33
+ "difference_usd": "0.00089572",
34
+ "session_total_usd": "0.00852512",
35
+ "session_calls": 17
36
+ }
@@ -0,0 +1,154 @@
1
+ {
2
+ "date": "2026-11-30",
3
+ "region": "us-east-1",
4
+ "aws_profile": "tieot",
5
+ "api": "bedrock-runtime converse",
6
+ "client": "aws cli. These calls did not go through ctxcache.wrap.",
7
+ "price_source": "src/ctxcache/data/providers.toml",
8
+ "spent_priced_usd": "0.00525445",
9
+ "prompt": "System text is 'The repository rule is stable. ' repeated 140 times. User text is 'Reply with the single word ok.'",
10
+ "results": [
11
+ {
12
+ "model": "amazon.nova-micro-v1:0",
13
+ "cache_checkpoint": true,
14
+ "calls": [
15
+ {
16
+ "call": "stable-1",
17
+ "input_tokens": 6,
18
+ "cache_read_input_tokens": 0,
19
+ "cache_write_input_tokens": 841,
20
+ "output_tokens": 2,
21
+ "usd": "0.00000049",
22
+ "uncached_baseline_usd": "0.00002993"
23
+ },
24
+ {
25
+ "call": "stable-2",
26
+ "input_tokens": 6,
27
+ "cache_read_input_tokens": 841,
28
+ "cache_write_input_tokens": 0,
29
+ "output_tokens": 2,
30
+ "usd": "0.00000785",
31
+ "uncached_baseline_usd": "0.00002993"
32
+ },
33
+ {
34
+ "call": "clock",
35
+ "note": "The system text starts with 'Current time: 2026-11-30T23:50:00'.",
36
+ "input_tokens": 6,
37
+ "cache_read_input_tokens": 0,
38
+ "cache_write_input_tokens": 865,
39
+ "output_tokens": 2,
40
+ "usd": "0.00000049",
41
+ "uncached_baseline_usd": "0.00003077"
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ "model": "amazon.nova-lite-v1:0",
47
+ "cache_checkpoint": true,
48
+ "calls": [
49
+ {
50
+ "call": "stable-1",
51
+ "input_tokens": 6,
52
+ "cache_read_input_tokens": 0,
53
+ "cache_write_input_tokens": 841,
54
+ "output_tokens": 3,
55
+ "usd": "0.00000108",
56
+ "uncached_baseline_usd": "0.00005154"
57
+ },
58
+ {
59
+ "call": "stable-2",
60
+ "input_tokens": 6,
61
+ "cache_read_input_tokens": 841,
62
+ "cache_write_input_tokens": 0,
63
+ "output_tokens": 3,
64
+ "usd": "0.00001370",
65
+ "uncached_baseline_usd": "0.00005154"
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ "model": "amazon.nova-pro-v1:0",
71
+ "cache_checkpoint": true,
72
+ "calls": [
73
+ {
74
+ "call": "stable-1",
75
+ "input_tokens": 6,
76
+ "cache_read_input_tokens": 0,
77
+ "cache_write_input_tokens": 841,
78
+ "output_tokens": 3,
79
+ "usd": "0.00001440",
80
+ "uncached_baseline_usd": "0.00068720"
81
+ },
82
+ {
83
+ "call": "stable-2",
84
+ "input_tokens": 6,
85
+ "cache_read_input_tokens": 841,
86
+ "cache_write_input_tokens": 0,
87
+ "output_tokens": 3,
88
+ "usd": "0.00018260",
89
+ "uncached_baseline_usd": "0.00068720"
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ "model": "us.moonshotai.kimi-k3",
95
+ "cache_checkpoint": false,
96
+ "note": "This model rejects cachePoint. maxTokens is 16 because the model rejects a lower cap. The first call costs more than its uncached baseline because the price row charges a cache write at 1.25x.",
97
+ "calls": [
98
+ {
99
+ "call": "stable-1",
100
+ "input_tokens": 7,
101
+ "cache_read_input_tokens": 0,
102
+ "cache_write_input_tokens": 937,
103
+ "output_tokens": 16,
104
+ "usd": "0.00415223",
105
+ "uncached_baseline_usd": "0.00337920"
106
+ },
107
+ {
108
+ "call": "stable-2",
109
+ "input_tokens": 7,
110
+ "cache_read_input_tokens": 937,
111
+ "cache_write_input_tokens": 0,
112
+ "output_tokens": 16,
113
+ "usd": "0.00059631",
114
+ "uncached_baseline_usd": "0.00337920"
115
+ }
116
+ ]
117
+ },
118
+ {
119
+ "model": "openai.gpt-oss-120b-1:0",
120
+ "cache_checkpoint": false,
121
+ "note": "A request with cachePoint was refused. These two calls omit it. The response usage has no cache-read field and no cache-write field.",
122
+ "calls": [
123
+ {
124
+ "call": "stable-1",
125
+ "input_tokens": 919,
126
+ "cache_read_input_tokens": null,
127
+ "cache_write_input_tokens": null,
128
+ "output_tokens": 8,
129
+ "usd": "0.00014265",
130
+ "uncached_baseline_usd": "0.00014265"
131
+ },
132
+ {
133
+ "call": "stable-2",
134
+ "input_tokens": 919,
135
+ "cache_read_input_tokens": null,
136
+ "cache_write_input_tokens": null,
137
+ "output_tokens": 8,
138
+ "usd": "0.00014265",
139
+ "uncached_baseline_usd": "0.00014265"
140
+ }
141
+ ]
142
+ }
143
+ ],
144
+ "blocked": [
145
+ {
146
+ "model": "us.anthropic.claude-haiku-4-5-20251001-v1:0",
147
+ "result": "ResourceNotFoundException: Anthropic use-case details have not been submitted for this account."
148
+ },
149
+ {
150
+ "model": "us.xai.grok-4.7",
151
+ "result": "AccessDeniedException: model is not available for this account."
152
+ }
153
+ ]
154
+ }