Guides / track llm cost ollama

How to track LLM cost for Ollama and local models

A local model running under Ollama produces no invoice, so its spend is invisible rather than zero. The useful number is what the same token volume would have cost on a hosted model, because that's what running it yourself is worth. Culpa, a local-first LLM cost, margin, and forecast ledger, counts local calls through the same route as any provider and prices that comparison.

Why this happens

Self-hosting moves cost from a line item to a fixed asset, and fixed costs get forgotten. The tokens still exist, the machine still runs, and the electricity and the hardware are still real, but no invoice arrives to make any of it visible. That's fine until somebody asks whether the local deployment is worth keeping, at which point nobody can answer, because the comparison needs a token count nobody was recording and a hosted rate nobody applied to it.

What this usually looks like

  • Local model traffic is uncounted because no invoice ever prompted anyone to count it.
  • Nobody can say whether self-hosting is cheaper than the hosted equivalent for your actual volume.
  • The decision to self-host was made once, at a different volume, and never revisited.
  • Hosted and local traffic sit in separate mental buckets and never get compared.

Free, no card, no account

Run the free Cost Leak Scan

It shows your most expensive conversation before you install anything.

Run a free scan

Mistakes that cost the most

MistakeWhy it hurtsDo instead
Treating a local model as free because it sends no bill.The hardware, the power and the operational time are real, and none of them are on a rate card.Count the tokens anyway, then price them against a hosted equivalent to get a comparable number.
Leaving local traffic out of your ledger entirely.Your call volume and your feature attribution both go wrong, not just your spend.Route local models through the same capture path as everything else and label them as local.
Deciding self-hosting once and never re-testing it.The answer is a function of volume, and volume moves while the decision stays put.Recompute the comparison quarterly, or whenever your local volume changes materially.

Run this check tonight

  1. Count input and output tokens through your local model for a full month.
  2. Pick the closest hosted equivalent and price the same volume at its published rates.
  3. That figure is what self-hosting saved you in provider spend this month.
  4. Put your real hardware, power and operational costs beside it and compare honestly.
  5. Re-run the comparison whenever local volume changes by a large factor.

What a month of local inference would have cost hosted

Illustrative example

A local Llama 3.3 70B under Ollama handling 60 million input and 12 million output tokens a month, priced against the hosted equivalent on Groq at real rates of $0.59 per million input and $0.79 output. Volumes are modelled.

Provider invoice for the local model: $0.00, because nobody sends one
The same volume hosted: (60 x $0.59) + (12 x $0.79) = $35.40 + $9.48 = $44.88
So self-hosting avoided $44.88 of provider spend this month
At ten times the volume it would avoid $448.80, and the hardware cost wouldn't necessarily change
Below roughly this volume the hosted route is cheaper than almost any dedicated machine

Forty-five dollars a month is the honest value of this deployment, and it's a number worth knowing before anyone defends the machine it runs on. The comparison only exists if somebody counted the tokens.

Every number, with its confidence and source

FigureWhat it meansConfidenceSource
$44.88modelled monthly hosted-equivalent value of a local Llama 3.3 70B deploymentcalculated(60 x $0.59) + (12 x $0.79) per million, using real Groq Llama 3.3 70B rates from the price book, effective 2026-07-02 and re-verified 2026-08-01. Token volumes are modelled.
$0.00provider invoice for local inference, which is why the counterfactual is the only comparable numbercalculatedNo provider bills a model running on your own hardware, so the invoice line is zero by construction.

What a generic answer can’t know

There's no provider to ask, because that's the point of running locally. The token counts exist only on your own machine, and the hosted comparison needs them joined to a rate book. Culpa keeps both on your infrastructure, where your prompts and responses stay, and counts the calls to run your plan.

Questions founders ask next

Can Culpa track a local model like Ollama?

Yes. Local models expose an OpenAI-compatible endpoint, so they route through the same capture path as a hosted provider, with the local server as the upstream. The calls land in the same ledger and carry the same labels.

What does cost mean for a model with no invoice?

The most useful definition is the counterfactual: what the same tokens would have cost on the closest hosted model. That converts an invisible fixed cost into a number you can compare against your hardware and your power bill.

Is self-hosting cheaper?

It depends entirely on volume, and the answer moves as volume does. Price your real monthly tokens against a hosted equivalent and put that beside your actual hardware and operational costs. At low volume the hosted route usually wins.

On your infrastructure

Culpa runs on your infrastructure. Your prompts and responses never leave it. Culpa counts calls to run your plan, and it fails open, so if it ever breaks your app keeps running.


How Culpa works

Find the culprit. Not just the total.

Your dashboard shows what you spent. It stops short of who spent it. Culpa shows the conversation, the user and the feature behind it.

Your prompts stay local.

Culpa runs on your own infrastructure. What you send to a model reaches us at no point.

Every dollar has a name.

Follow any charge to the conversation, the user, the feature and the customer behind it.

See the bill before it lands.

Cost your next feature before you ship it. You get the likely bill and the worst case, at best, median, p90 and p99.

Three steps to your first answer.

1

Change one base URL.

Or drop in the Python or TypeScript library.

2

Find your most expensive conversation.

In the first session, not the first week.

3

Cost your next feature before you ship it.

Base URLhttp://localhost:4545/v1Your traffic keeps flowing if Culpa ever stops.

Why the bill went up

Example dashboard

Calls traced

418,209

across 3 projects

Spend this week

$378.41

+ $182 vs last week

Failed calls

312

74% retried, and you paid for all of them

+ $182 this week traced to one culprit

Spend over 14 days

$0$20$40$60$8024262830020406
user_384report_generatorconv_91fprompt_v1894,220 tokens3 retries$6.81

Most expensive users

user_384$38.42
user_119$21.07
user_562$14.90
user_204$8.30
user_871$5.10

Next week forecast

Best$180
Median$240
p90$310
p99$395

Graded against reality. Accuracy shown as results land.

Free, no card, no account

Run the free Cost Leak Scan

It shows your most expensive conversation before you install anything.

Run a free scan

Keep reading


Sources: Groq pricing. Last reviewed 2026-08-02. Plain text version.