This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Aliquot
Audit your Anthropic API logs and find the money you're wasting on broken prompt caching and tool-definition bloat.
Status: pre-alpha (Phase 0 — setup). Not yet functional.
pip install aliquot # coming soon
aliquot audit ./logs.jsonl
SCANNED: 12,847 requests over 7 days
TOTAL SPEND: $1,247
ESTIMATED WASTE: up to $782 (likely $620-780) [63%]
ISSUE 1: Cache miss on system prompt [saves up to $412/mo, likely $340-410]
...with the math to back it up.
Aliquot (chemistry): a portion taken from a whole for analysis. Your audit logs are the aliquot of your full AI usage.
What it does
Reads raw Anthropic JSON logs and produces a markdown report showing, with the math:
- Broken prompt caching — where
cache_controlbreakpoints are missing, misplaced, or silently invalidated, and what relocating them would save. - MCP / tool-definition bloat — tools loaded on every request but rarely or never called, and the savings from trimming them.
Read-only. Never modifies your code or sends data anywhere.
Getting your logs
Aliquot reads raw Anthropic request+response records (one JSON object per line).
Anthropic doesn't hand you these — the usage cache fields only come back in each
API response at call time, so you capture them yourself. The easiest way is to log
your calls as you make them:
from examples.capture_logs import logged_create # 3-line wrapper around messages.create
logged_create(client, model="claude-opus-4-8", max_tokens=512,
system=SYSTEM, messages=messages) # appends to anthropic_logs.jsonl
Then aliquot audit ./anthropic_logs.jsonl. See examples/capture_logs.py
for the full snippet (model, system, messages, tools, and the response usage).
If you already log your Claude calls, point Aliquot at those — it needs the request
(system/messages/tools) and the response usage. Logs from wrappers like LangChain
aren't supported in v1; you'll get a clear error rather than a wrong answer.
How the cache detector works
(Diagram + write-up coming — Phase 11. Short version: tokenize each request, build a prefix trie across all requests, cluster by structural template shape to find variable slots, classify the cache failure mode, and project savings validated by a replay harness against simulated cache behavior.)
Scope (v1)
- One log format: raw Anthropic JSON.
- One provider: Anthropic. (OpenAI/Gemini are v2 — caching semantics differ.)
- CLI + markdown report. No dashboard, no server, no cloud.
Development
uv pip install -e ".[dev]"
ruff check . && mypy && pytest
All pricing/TTL/cache constants live in src/aliquot/pricing.py with a
LAST_VERIFIED date; CI fails if it's more than 60 days old.
License
MIT
Metadata
Release files for aliquot 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aliquot-0.0.1.tar.gz | 23.3 kB | Without provenance | Details for aliquot-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aliquot-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for aliquot-0.0.1-py3-none-any.whl |
Total release size: 41.7 kB
Release files / aliquot-0.0.1.tar.gz
| Download URL | aliquot-0.0.1.tar.gz |
|---|---|
| Size | 23.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4b2a78d76c04d8779a7a938b01e77e31f2bc1eb5855b179e73004b75ff38a25
|
|
BLAKE2b-256 checksum How to use checksums |
17f528220097065b3e4806ef971f4a8be6532d2d4c88a266bc3206dc47f03661
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / aliquot-0.0.1-py3-none-any.whl
| Download URL | aliquot-0.0.1-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
22aae3606479e9157e297bc07b611a21c48ed396671fe5c60968f80f79a32f00
|
|
BLAKE2b-256 checksum How to use checksums |
7baa525d6586ff61ff7229005135636e1b2925faa61b665c7c54357e95ae4f1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for aliquot 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.