promptcost

A cost heatmap over a prompt is flat at the grain everyone draws it at. The bill is how often you send it.

The map

Grain
Document

 

Colour is characters per token, the rate at which a region turns money into words on a screen. Low is expensive: a hot line bought fewer characters for the tokens it cost.

The extremes at this grain
regioncharstokenschars/token

This is the prompt that built this repository, measured with the tokenizer the models use. Switch the grain and watch the map appear: the structure is below the level a heatmap is usually pointed at, and what makes a line expensive is its punctuation, not its subject.

section grain
—
spread across the map
line grain
—
same document, same scale
30 days of this prompt
—
between the dearest and cheapest model

The thing the map cannot show

Every region above is a share of one send. The bill is that share multiplied by a number that appears nowhere on the map: how often the prompt goes out, and to which model.

—

Every model in the committed table, at the dials above
modelinputper sendover the window

Method

Both inputs are committed in data/ and hashed into the measurement, because the contract is edited every few ticks and a price list is stale the day after it is written. npm run check:density recomputes every region from those files and refuses any disagreement; npm run check:grain fails if the section grain stops being flat or the control stops lighting up, which are claims about the world rather than about this code.

The second document is the first with this repository's own price table pasted in, composed by the builder rather than written by hand. It is here because a flat map has two readings, a uniform document and a blind instrument, and only one of them is a finding.

Source, measurement and gates on GitHub