static audit · 2026-10-25T22:34:16.172Z

sweepai/sweep

120 source files scanned · 14 LLM call site(s) · ~7% of LLM spend looks recoverable (static heuristics · repo looks like an app)

badge   ![TokenZero audit](https://tokenzero.sh/v1/badge/audit/aud_-vwQGPNYcNUjYBM_rMtW9A.svg)

repo badge   [![LLM spend audited by TokenZero](https://tokenzero.sh/v1/badge/repo/sweepai/sweep.svg)](https://tokenzero.sh/audit/sweepai/sweep)

Models referenced

claude-3-opus-20240229 ×1

Findings

SeverityWhereFindingEst.
mediumsweepai/core/prompts.py:9954 static prompt template(s), ~1,424 tokens, and no caching directive anywhere in the repo
Most call sites use providers with automatic prefix caching, which only pays off when these templates are sent as a byte-identical prefix: static template first, nothing volatile (dates, ids, user data) interpolated into it.
Fix: Keep templates first and static; TokenZero adds a stable `prompt_cache_key` so related requests land on the same cache.
12%
lowsweepai/utils/openai_proxy.py:262Tool definitions sent without a cache breakpoint
Tool schemas render before the system prompt in the cached prefix. Without a breakpoint on the last tool they are billed in full on every call.
Fix: TokenZero marks the last tool automatically; manually, add `cache_control` to the last tool definition.
8%
infosweepai/utils/openai_proxy.py:262Unrecognised model id "claude-3-opus-20240229"
Not in the current pricing table: it may be retired or renamed. Retired models return errors or are silently remapped by some providers.
Fix: Check the provider model list; TokenZero flags unpriced models in `X-TokenZero-Warning`.
0%

Fix all of it with one line

OPENAI_BASE_URL=https://tokenzero.sh/v1
ANTHROPIC_BASE_URL=https://tokenzero.sh

Keys pass through untouched. Cache formatting and exact caching are on by default; cascade routing stays opt-in. How it works