feat: allow grouping models in report output via flag/toggle - #117
feat: allow grouping models in report output via flag/toggle#117cantalupo555 wants to merge 1 commit into
Conversation
Remove provider_id from model aggregation key to prevent duplicate entries when the same model appears with different provider names (e.g., zai-coding-plan vs zhipuai-coding-plan for GLM-4.7).
|
@cantalupo555 is attempting to deploy a commit to the Inevitable Team on Vercel. A member of the Team first needs to authorize it. |
|
Same model ( After |
|
Hey @cantalupo555, thanks for taking the time to dig into this and submit a PR! I appreciate the effort. After thinking about this more carefully, I don't think I can merge this change. Here's why: The provider dimension is intentionally part of the aggregation key. The same model accessed through different providers can have significantly different pricing. For example:
If we remove Users with multiple providers need per-provider breakdowns. Some power users intentionally route the same model through different providers (for redundancy, rate limits, or cost optimization). They rely on the per-provider breakdown to understand their usage patterns and costs across each provider. Merging these would remove valuable insights they depend on. Thanks again for the contribution! π |
|
Hey @junhoyeo, thanks for the review! After updating OpenCode and logging back into my subscription (Z.AI Coding Plan), I noticed that it had a different name, even though it was the same provider. I agree we should keep So the βdifferent pricing per providerβ argument is less applicable here; The cost of OpenCode is recalculated only by Or the example you mentioned above, those providers currently show the same pricing (screenshot below). Iβm not claiming pricing is always identical across providers β just that in this OpenCode case, pricing variance isnβt the issue. The issue that motivated the PR is that OpenCode is now showing different IDs for the same provider ( So Iβd propose reopening the PR as draft with a safer approach: add a βgroup by modelβ view option (without changing the internal key). This could be:
References (OpenCode repo):
Catalog IDs:
If this makes sense, could you reopen the PR as draft so I can update it with the grouping option (flag + TUI toggle) purely at the presentation layer? |
|
Makes sense! @cantalupo555 |
|
Hi @cantalupo555 β closing this one, because the feature landed in generalized form. Context: Main now has a first-class The PR's target file ( Thanks for surfacing the provider-rename duplication that motivated this; it's exactly the case the default grouping now handles. |


Summary
provider_idfrom model aggregation key to prevent duplicate entries when the same model appears with different provider namesProblem
When a provider changes its name (e.g.,
zai-coding-planβzhipuai-coding-planfor Zhipu AI), the same model (GLM-4.7) appears as two separate entries in the report because the aggregation key included the provider_id.Before (duplicated):
After (consolidated):
Changes
Changed aggregation key from
source:provider_id:model_idtosource:model_idin 3 locations:get_model_report()finalize_report()finalize_report_and_graph()This is safe because:
providerfield is retained inModelUsagestruct for reference