You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add runtime pricing overrides via ccusage.json, and make the Pi adapter respect CostMode when calculating cost.
Today Pi logs always write usage.cost.total = 0, and the Pi parser takes that value verbatim. That means Pi usage shows $0.00 in Auto mode even when token usage is present.
I'd like to:
make Pi use calculate_cost_for_usage(...) instead of trusting usage.cost.total
add a pricingOverrides config section so users can override per-model pricing and context limits at runtime
Why?
Fuzzy model matching already covers most naming differences, so the built-in pricing works well in many cases.
But there are still real cases where users need local overrides:
Pi logs do not include usable cost data
private deployments / internal proxies may use non-public pricing
LiteLLM pricing can be stale
custom models may need maxInputTokens
some models may not be in LiteLLM yet
How? (optional)
Add pricingOverrides to config, keyed by model name
Extend PricingMap to apply overrides after embedded / LiteLLM pricing is loaded
Allow overrides for token pricing fields, cache pricing, fastMultiplier, and maxInputTokens
Pass the resolved pricing map into Pi parsing so Pi cost follows normal Display / Auto / Calculate behavior
This issue was auto-closed. Issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.
Keep the issue short, concrete, and written in your own voice.
If a maintainer replies lgtmi, your future issues will stay open. If a maintainer replies lgtm, your future issues and PRs will stay open.
Opened the PR: #1204 — auto-closed by the contributor gate. Let me know
if you'd like to take a look or want me to revise anything before reopening.
Heads-up: PR description has a "Known limitations" section flagging a ~28s
slowdown in --mode calculate when the models in use aren't covered by
either built-in pricing or overrides. Looks like a pre-existing
characteristic of PricingMap::find for unknown models, surfaced now that
Pi goes through the pricing path on my local setup — once overrides privices are
filled in, runtime returns to ~0.2s.
Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.
Audit result: resolved. A later merged change or the current main implementation covers this request. This item is kept for history and does not need to be reopened.
Activity
github-actions commentedon Jun 1, 2026
This issue was auto-closed. Issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.
Keep the issue short, concrete, and written in your own voice.
If a maintainer replies
lgtmi, your future issues will stay open. If a maintainer replieslgtm, your future issues and PRs will stay open.See CONTRIBUTING.md.
xiaoMaJia707 commentedon Jun 2, 2026
Check commit in my forked repository for code changes if you feel it is needed:
xiaoMaJia707@4497d22
Best Regards.
ryoppippi commentedon Jun 4, 2026
thanks! lmc
xiaoMaJia707 commentedon Jun 5, 2026
Thank you, I will try to formally create a PR for your review.
xiaoMaJia707 commentedon Jun 5, 2026
Opened the PR: #1204 — auto-closed by the contributor gate. Let me know
if you'd like to take a look or want me to revise anything before reopening.
Heads-up: PR description has a "Known limitations" section flagging a ~28s
slowdown in
--mode calculatewhen the models in use aren't covered byeither built-in pricing or overrides. Looks like a pre-existing
characteristic of
PricingMap::findfor unknown models, surfaced now thatPi goes through the pricing path on my local setup — once overrides privices are
filled in, runtime returns to ~0.2s.
xiaoMaJia707 commentedon Jun 9, 2026
Thank you @ryoppippi for taking the time to finish this PR. I’m sorry I couldn't get around to it yesterday, your improvements look great!
ryoppippi commentedon Aug 31, 2026
Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.
Audit result: resolved. A later merged change or the current
mainimplementation covers this request. This item is kept for history and does not need to be reopened.