Files

27 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 06: AI cost page: tokens, cost, monthly spend, model choice
Part of: ../spec.md
**What to build:** The AI dashboard gets a cost/ROI page. It shows:
- input, output and thinking tokens and cost per run;
- total spend and this month's spend, with a month-by-month breakdown;
- a coverage pill ("N of M documents priced");
- an "against doing it by hand" panel with editable assumptions, clearly labelled as assumptions.
Cost comes from a pricing table that records its source and its as-of date. Optionally, the skill also adds a model picker for each batch and retry-on-another-model for failed runs.
**Blocked by:** 05
**Status:** resolved
- [ ] Cost per call = input tokens × input rate + (output + thinking tokens) × output rate, per million tokens. Long-context rates apply above the threshold.
- [ ] An unknown model raises an error that names the known models. Cost never silently defaults to zero.
- [ ] A Python self-check covers normal, long-context, thinking-token and unknown-model cases.
- [ ] Contract: `RoiRun{model,input_tokens,output_tokens,thinking_tokens,total_cost}` and a fetch-ROI action. (Shape from the Superbill prototype.)
- [ ] The page check asserts that the spend tiles sum the runs, the coverage pill counts priced vs. total documents, and the month breakdown groups runs correctly.
- [ ] The model picker and retry-on-other-model are offered as optional sections and built only when chosen.
## Comments
Resolved on branch `integration/rpa-dashboard-skills` (Oct 16, 2026). Tests: `uv run --with pytest --with playwright pytest tests` all green; skill eval results in `tests/evals/results/`.