Skip to content

cost: log the gateway's pricing headers per call, warn on an unpriced model at startup - #205

Merged
trick77 merged 2 commits into
masterfrom
worktree-cost-logging
Sep 15, 2026
Merged

trick77 merged 2 commits into
masterfrom
worktree-cost-logging

Conversation

@trick77

@trick77 trick77 commented Sep 15, 2026

Copy link
Copy Markdown
Owner

An unpriced run left no trace: the None sentinel was swallowed, the Review complete line omitted the cost, the ping discarded the header and the key total was hidden behind the run cost. A gateway worker that never loaded its catalog priced every review at nothing and noergler showed nothing, in the log or on the summary, that said so.

Every call now logs the raw x-litellm-response-cost and x-litellm-key-spend values plus the gateway's call id (a warning listing the x-litellm-* headers seen when unpriced), the Review complete and Mention Q&A lines carry the cost, and the startup ping warns once when the model is not priced. The key total stays on the summary when a single run is unpriced.

… model at startup

An unpriced run left no trace: the None sentinel was swallowed, the
Review complete line omitted the cost, the ping discarded the header and
the key total was hidden behind the run cost. A gateway worker that never
loaded its catalog priced every review at nothing and noergler showed
nothing, in the log or on the summary, that said so.

Every call now logs the raw x-litellm-response-cost and x-litellm-key-spend
values plus the gateway's call id (a warning listing the x-litellm-* headers
seen when unpriced), the Review complete and Mention Q&A lines carry the
cost, and the startup ping warns once when the model is not priced. The
key total stays on the summary when a single run is unpriced.
@trick77
trick77 merged commit 9e2d5d3 into master Sep 15, 2026
2 checks passed
@trick77
trick77 deleted the worktree-cost-logging branch September 15, 2026 18:30
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.

1 participant