fix(ui): use categorical colors for tier donut, trim redundant turn count - #36300
fix(ui): use categorical colors for tier donut, trim redundant turn count#36300tin-berri wants to merge 3 commits into
Conversation
- Add TierTurnsChart: donut chart showing turns per complexity tier with tier-assigned models listed below each tier name in the legend - Only complexity routers show models; quality routers show tier name + % (quality tiers don't pin specific models) - Change 'Estimated spend at highest-cost model' wording to 'highest-tier' to clarify it's the most capable tier's estimated cost, not just the single-highest model Closes LIT-5302
…ount - Tier donut chart now uses a dedicated categorical palette instead of SEQUENTIAL_COLOR_RAMP, which is a blue monochrome gradient meant for magnitude series, not distinct categories. - Space out the tier legend rows (gap-3 -> gap-6) for readability. - Drop the turn count from "avg saved per session" since Routing by tier already shows the total turns. Co-Authored-By: Claude <noreply@anthropic.com>
Greptile SummaryThe PR adds a per-router tier-routing donut with categorical colors and configured tier/model labels, while simplifying the savings summary by removing redundant turn totals.
Confidence Score: 4/5The PR appears safe to merge after the non-blocking repository-convention issue in the new test is cleaned up. The tier visualization preserves router-group identity, safely handles absent configuration, and is well covered; the only accepted concern is prohibited explanatory commentary in the new test. Files Needing Attention: ui/litellm-dashboard/src/app/(dashboard)/cost-optimization/_components/TierTurnsChart.test.tsx
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/app/(dashboard)/cost-optimization/_components/TierTurnsChart.tsx | Adds the tier donut, deployment-aware labels, and model annotations with safe fallbacks for missing configuration. |
| ui/litellm-dashboard/src/app/(dashboard)/cost-optimization/_components/TierTurnsChart.test.tsx | Thoroughly exercises chart labeling and configuration variants, but adds comments prohibited by repository convention. |
| ui/litellm-dashboard/src/app/(dashboard)/cost-optimization/_components/AutoRouterBenchmarksTab.tsx | Integrates router metadata and the tier chart while simplifying the savings and session summary layout. |
| ui/litellm-dashboard/src/app/(dashboard)/cost-optimization/_components/autoRouterBenchmarks.ts | Extends benchmark views to preserve group identity for group-specific tier visualization. |
| litellm/types/management_endpoints/auto_router_endpoints.py | Corrects the documented casing of canonical complexity-router tier keys. |
| ui/litellm-dashboard/src/lib/http/schema.d.ts | Regenerates the API schema to expose optional per-tier turn counts to typed UI consumers. |
Reviews (1): Last reviewed commit: "fix(ui): use categorical colors for tier..." | Re-trigger Greptile
| view={groupView()} // complexity router | ||
| autoRouters={[qualityDeployment] as AutoRouterDeployment[]} | ||
| />, | ||
| ); | ||
|
|
||
| // No complexity_router_config on the quality deployment, so no tier labels are read, | ||
| // falling back to canonical names. No models are shown (quality config doesn't have tiers). | ||
| expect(screen.getByText("Simple 75%")).toBeInTheDocument(); |
There was a problem hiding this comment.
Remove prohibited test comments
These newly added comments violate the repository convention against adding source-code comments; the test name and assertions already communicate the scenario without them.
| view={groupView()} // complexity router | |
| autoRouters={[qualityDeployment] as AutoRouterDeployment[]} | |
| />, | |
| ); | |
| // No complexity_router_config on the quality deployment, so no tier labels are read, | |
| // falling back to canonical names. No models are shown (quality config doesn't have tiers). | |
| expect(screen.getByText("Simple 75%")).toBeInTheDocument(); | |
| view={groupView()} | |
| autoRouters={[qualityDeployment] as AutoRouterDeployment[]} | |
| />, | |
| ); | |
| expect(screen.getByText("Simple 75%")).toBeInTheDocument(); |
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Per repo convention against source comments; the test name and assertions already communicate the scenario. Addresses Greptile review. Co-Authored-By: Claude <noreply@anthropic.com>
|
Duplicate of #36291 (same branch, correct base: litellm_internal_staging). Consolidating there. |
Replaces SEQUENTIAL_COLOR_RAMP (blue monochrome gradient) with a categorical palette for the tier donut, increasing legend spacing for readability and removing the redundant turn count from the avg-saved-per-session metric (already shown in Routing by tier).