spendlint v0.1
a linter for your LLM bill

spendlint reads every merge request and projects the cost delta before it ships.

Observability tells you after the bill arrives. spendlint catches the change at code review time, joins it to your team's real historical traffic from a labeled ledger, and posts a verdict on the MR. PASS, WARN, or BLOCK.

What it catches

example · model swap
− before $0.2520 / day
# spendlint:label summary_endpoint
def summarize(text):
    resp = client.messages.create(
        model="claude-3-haiku",
        max_tokens=320,
    )
    return resp.content
+ after $12.6600 / day
# spendlint:label summary_endpoint
def summarize(text):
    resp = client.messages.create(
        model="claude-3-5-sonnet",
        max_tokens=320,
    )
    return resp.content
baseline600 calls/day × (1,400 in × $0.25/M + 320 out × $1.25/M)$0.2520/day
projected600 calls/day × (1,400 in × $3.00/M + 320 out × $15.00/M)$12.6600/day
deltaprojected − baseline+$12.4080/day

How it works

webhook → agent → verdict
01 · fetch

Pull the diff

GitLab webhook fires on every MR open or update. The agent pulls diff and metadata via MCP locally, REST in production.

GitLab MCP / REST
02 · classify

Read the hunks

Gemini tags each change: model swap, retry loop added, max_tokens bumped, new or removed call site.

Vertex Gemini 2.5
03 · project

Join to traffic

The novel core. Matches changed call sites to labeled history in the ledger, applies the pricing delta, returns a $/day projection.

SQLite ledger
04 · comment

Post the verdict

Writes the verdict, the formula, and the assumptions back to the MR. Numbers are transparent. No magic.

GitLab notes API

Live ledger

this deployment · real data
MRs reviewed
6
0 blocked · 0 warned
Flagged spend
$0.0000
$/day caught pre-merge
Saved spend
$0.0000
$/day from reductions
Ledger volume
$0.0031
$/day observed

Recent reviews

latest 20
UNKNOWN
perf: switch agent model from gemini-2.5-pro to gemini-2.5-flash
redlotusthepotus-group/spendlint · Jun 11, 10:59
+$0.0000/day
!7 →
PASS
fix: add retry loop to recorder for transient write failures
redlotusthepotus-group/spendlint · Jun 11, 09:54
+$0.0000/day
!4 →
PASS
fix: add retry loop to recorder for transient write failures
redlotusthepotus-group/spendlint · Jun 11, 09:49
+$0.0000/day
!4 →
UNKNOWN
perf: downgrade agent to gemini-2.5-flash for cost saving
redlotusthepotus-group/spendlint · Jun 11, 09:27
+$0.0000/day
!3 →
UNKNOWN
perf: downgrade agent to gemini-2.5-flash for cost saving
redlotusthepotus-group/spendlint · Jun 11, 09:23
+$0.0000/day
!2 →
UNKNOWN
perf: downgrade agent to gemini-2.5-flash for cost saving
redlotusthepotus-group/spendlint · Jun 11, 07:22
+$0.0000/day
!2 →

Call-site traffic

labeled in source
Label Model Calls/day Avg in Avg out $/day
evalc_compile gemini-2.5-pro 0.5 219 314 $0.0018
evalc_synthesize_tests gemini-2.5-pro 0.3 596 304 $0.0013
_probe gemini-2.5-pro 0.2 1 1 $0.0000