Skip to content

Cost dashboard + price tables ​

What it does ​

The Cost dashboard aggregates inference costs by model (or by day) using actual token counts from completions and configured price rates (price per 1K input tokens, price per 1K output tokens). You configure prices once, and the dashboard automatically rolls up costs from the inference log. Use it to track spending, identify expensive models, and optimize resource allocation.

Prerequisites ​

  • At least one chat completion has been logged (guide 01).
  • Token counts are captured in the inference log (all models should report usage.prompt_tokens and usage.completion_tokens).

Steps ​

1. Open the Cost page ​

Click Cost in the left rail. The page displays two tabs: By Model and By Day.

2. Configure prices (one-time setup) ​

At the top of the page, click Edit Prices. A form appears with a row for each model:

  • Model id — the model name (e.g. qwen2.5:3b).
  • Input price — price per 1,000 input tokens (default $0.00).
  • Output price — price per 1,000 output tokens (default $0.00).

Fill in your pricing (get rates from your provider, e.g. Ollama is free, HF inference has a price card). Click Save. Prices are stored and applied to all future rollups.

3. View cost by model ​

Stay on the By Model tab. The table shows:

  • Model id — the model name.
  • Total input tokens — sum across all inferences.
  • Total output tokens — sum across all inferences.
  • Cost — calculated as (input_tokens / 1000) * input_price + (output_tokens / 1000) * output_price.

Click a row to expand and see # of inferences and avg tokens per inference.

4. View cost by day ​

Click the By Day tab. The table shows:

  • Date — day in YYYY-MM-DD format.
  • Input tokens — sum for that day.
  • Output tokens — sum for that day.
  • Cost — daily total.

Use the time-range selector (top-left) to view:

  • Last 1 hour
  • Last 6 hours
  • Last 24 hours
  • Last 7 days
  • All time

5. (Direct API) Fetch costs by model ​

bash
curl -s -H "Authorization: Bearer $BIGWAVE_TOKEN" \
  "http://localhost:8080/admin/cost/by-model" | jq '.results[0]'

Returns [{ model_id, input_tokens, output_tokens, cost }, ...].

6. (Direct API) Fetch costs by day ​

bash
curl -s -H "Authorization: Bearer $BIGWAVE_TOKEN" \
  "http://localhost:8080/admin/cost/by-day?since=2024-01-01" | jq '.results[0]'

Returns [{ date, input_tokens, output_tokens, cost }, ...].

Verify ​

  • Set prices for your models (or use $0 for free models).
  • Send a few chats; observe token counts in the inference log.
  • Open the Cost page; the By Model tab shows the calculated costs.
  • Switch to By Day; the costs are aggregated by date.
  • Verify a day's total cost matches your manual calculation: (input_tokens / 1000) * input_price + (output_tokens / 1000) * output_price.

Common issues ​

SymptomCauseFix
"Prices not configured"No prices set for any modelsClick Edit Prices and fill in input/output rates for each model
Cost is $0.00 for all rowsPrices are set to $0 (free tier) OR token counts are not being capturedCheck inference log to confirm token counts are present; if missing, the model may not report usage
Cost by day is emptyNo inferences exist in the date rangeSend chats first (guide 01) or expand the time range
Costs look wrong (too high/low)Input and output prices are reversed or an order of magnitude offDouble-check your price configuration; prices are per 1,000 tokens
Price changes don't apply to past rowsPrices are applied at query time; historical costs are recalculatedExpected behavior — changing prices updates all past rows automatically on the next page load

Dual-licensed: MIT OR Apache-2.0