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 intojunhoyeo:mainfrom
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 |


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