ModelSpend

See what your LLM calls cost — then route to the cheapest model that still fits.

Open-source cost control for private projects and small teams — your OpenAI, Anthropic, Google, and xAI keys. Tag spend, hard budgets before the call, model="auto" routing, and optional shadow evals that learn which cheaper models are safe from your real traffic.

Apache-2.0 · Python 3.10+ · beta v0.7.0b1

What you get

Know the spend. Then spend less.

ModelSpend sits in front of agents and code that already speak OpenAI-compatible APIs. Built because private projects still need a bill with project names on it.

Try shadow

Two minutes to a savings sample

Install editable, turn on a capped shadow sample (default $5 / month ceiling), use your tools as usual, then ask what you would save. Shadow stays off until you enable it.

git clone https://github.com/rmencke2/modelspend.git
cd modelspend
python3 -m venv .venv && source .venv/bin/activate
python -m pip install --upgrade pip && pip install -e .
modelspend shadow set --rate 0.05 --budget 5
modelspend shadow on
# ... use your tools through ModelSpend ...
modelspend savings
Release notes

No keys yet? modelspend preview "Classify this ticket" --catalog synthetic --assume-keys still works for a dry routing preview.