Skip to content

fix(ui): use categorical colors for tier donut, trim redundant turn count - #36300

Closed
tin-berri wants to merge 3 commits into
mainfrom
feat/tier-models-in-legend
Closed

fix(ui): use categorical colors for tier donut, trim redundant turn count#36300
tin-berri wants to merge 3 commits into
mainfrom
feat/tier-models-in-legend

Conversation

@tin-berri

@tin-berri tin-berri commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

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).

image

tin-berri and others added 2 commits August 8, 2026 12:40
- 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-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The 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.

  • Adds tier-turn visualization and tests for complexity and quality router data.
  • Loads auto-router deployment metadata to resolve custom labels and assigned models.
  • Updates generated benchmark API typing and clarifies canonical complexity-tier casing.
  • Reworks the savings hero card to emphasize average savings across sessions.

Confidence Score: 4/5

The 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

Important Files Changed

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

Comment on lines +141 to +148
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();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
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>
@tin-berri

Copy link
Copy Markdown
Contributor Author

Duplicate of #36291 (same branch, correct base: litellm_internal_staging). Consolidating there.

@tin-berri tin-berri closed this Aug 8, 2026
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