Skip to content

feat(usagereport): utilization-aware status message framing (closes #41)#68

Merged
Defilan merged 1 commit into
mainfrom
feat/utilization-aware-status
Jun 4, 2026
Merged

feat(usagereport): utilization-aware status message framing (closes #41)#68
Defilan merged 1 commit into
mainfrom
feat/utilization-aware-status

Conversation

@Defilan

@Defilan Defilan commented Jun 4, 2026

Copy link
Copy Markdown
Member

What

Rewrites the UsageReport Ready-condition message (and adds a matching section to infercost status) so the headline cost is never shown without utilization context.

Why

Fixes #41

Period 2026-04-23: $0.0660 across 3,993 tokens is correct but misleading — readers divide and conclude "$16/MTok, worse than every cloud." The launch runbook says InferCost's differentiator is honest framing, including when cloud is cheaper; the bare string doesn't live up to that. The new framing puts the amortized number next to the utilization that explains it, plus the marginal rate and the break-even comparison:

Period 2026-04-23: $0.0660 across 3,993 tokens.
Amortized: $16.52/MTok at 4% utilization.
Marginal: $0.0040/MTok.
Break-even with Anthropic/claude-opus-4-6: 142K tokens/day (you served 6K).

How

  • internal/report.StatusMessage(UsageReportStatus) — a pure, table-tested formatter, shared by the controller and CLI so their framing is identical. Marginal line is omitted when 0 (no energy sampled → "$0.0000" would be misleading); break-even line omitted when there are no targets.
  • ControllerapplyStatusIfChanged sets the Ready message via the formatter.
  • CLIinfercost status gains a "USAGE REPORTS" section printing the same framing per report.
  • Tests — formatter table tests (humanize, commas, conditional lines) + a controller assertion that the message carries the new framing.
  • Grafana — the utilization %, $/MTok panels and the new break-even gauge (Break-even tokens-per-day calculator per cloud provider #39) already carry this visually; a Prometheus dashboard can't render a CRD condition string, so no message panel is added.

Note on stacking

Builds on #39 / PR #67 (the break-even line reads status.breakEvenAnalysis). This PR is based on feat/break-even-calculator; merge #67 first (GitHub will retarget this to main).

Checklist

  • Status condition message updated in applyStatusIfChanged
  • CLI infercost status output matches
  • Unit tests assert the new phrasing
  • make test + make lint pass locally
  • Signed off (DCO); conventional commit
  • Grafana: covered by existing panels + break-even gauge (documented above)

@Defilan
Defilan force-pushed the feat/break-even-calculator branch from 08855c0 to 9f654b0 Compare June 4, 2026 06:54
Base automatically changed from feat/break-even-calculator to main June 4, 2026 06:57
@Defilan
Defilan force-pushed the feat/utilization-aware-status branch from 0eee282 to a99f842 Compare June 4, 2026 07:01
Rewrites the UsageReport Ready-condition message (and adds a matching section to
`infercost status`) so the headline number is never shown without context. A flat
"Period: $0.0660 across 3,993 tokens" reads as "$16/MTok, worse than every cloud";
the new framing surfaces the amortized rate WITH utilization, the marginal rate,
and the break-even comparison:

  Period 2026-04-23: $0.0660 across 3,993 tokens.
  Amortized: $16.52/MTok at 4% utilization.
  Marginal: $0.0040/MTok.
  Break-even with Anthropic/claude-opus-4-6: 142K tokens/day (you served 6K).

- internal/report.StatusMessage is a pure, table-tested formatter shared by the
  controller and CLI so their framing stays identical. Marginal line is omitted
  when 0 (no energy sampled); break-even line omitted when no targets.
- Builds on the break-even work (#39); the break-even line uses status.breakEvenAnalysis.

Closes #41

Signed-off-by: Christopher Maher <chris@mahercode.io>
@Defilan
Defilan force-pushed the feat/utilization-aware-status branch from a99f842 to c3974e8 Compare June 4, 2026 07:06
@Defilan
Defilan merged commit 6e89290 into main Jun 4, 2026
5 checks passed
@Defilan
Defilan deleted the feat/utilization-aware-status branch June 4, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite UsageReport status message with utilization-aware framing

1 participant