Skip to content

feat(ui): add cost optimization feedback banner to models page - #32174

Merged
krrish-berri-2 merged 3 commits into
litellm_internal_stagingfrom
litellm_cost_optimization_banner
Jul 6, 2026
Merged

feat(ui): add cost optimization feedback banner to models page#32174
krrish-berri-2 merged 3 commits into
litellm_internal_stagingfrom
litellm_cost_optimization_banner

Conversation

@krrish-berri-2

@krrish-berri-2 krrish-berri-2 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Relevant issues

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

To verify: start the proxy on localhost:4000 with any config, and the dashboard dev server (npm run dev in ui/litellm-dashboard). Log into the UI, go to Models + Endpoints. A dismissible banner titled "Help shape cost optimization" appears at the top of the page with a "Share Feedback" button linking to #32172. It stays visible across the All Models / Add Model / Add Auto Router tabs (single instance, not duplicated), and dismissing it persists via localStorage across reloads.

Type

🆕 New Feature

Changes

Adds a dismissible banner on the Models + Endpoints page asking users for feedback on cost optimization improvements (routing, budgets, and more), linking out to a new GitHub discussion. Previously this lived only behind an Auto Router-specific banner that showed up twice when an auto-router model was configured while on the Add Auto Router tab; this replaces it with a single, always-present banner with broader scope. The prior "Missing a provider?" banner and its Request Provider fallback link are intentionally removed as part of this change.

Surfaces a dismissible banner on Models + Endpoints prompting users to
share cost optimization feedback (routing, budgets, etc) via a GitHub
discussion.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces the inline "Missing a provider?" banner in the Models + Endpoints page with a new, reusable CostOptimizationFeedbackBanner component that links to a GitHub discussion for user feedback. The banner is placed once at the page level (not per-tab), uses a new localStorage key (hideCostOptimizationFeedbackBanner) for persistence, and comes with full unit test coverage.

  • New component (cost_optimization_feedback_banner.tsx): Self-contained dismissible banner with constants for the storage key and discussion URL, an SSR guard in the useState initializer matching existing codebase patterns, and three unit tests covering render, dismiss, and remount persistence.
  • ModelsAndEndpointsView cleanup: Removes ~70 lines of inline banner JSX plus the showMissingProviderBanner state, the compact fallback "Request Provider" link, and the now-unused PlusCircleOutlined import; replaces all of it with a single <CostOptimizationFeedbackBanner /> call.
  • Test updates: Both test files are updated to reflect the new banner text, the new localStorage key, and the removal of the compact provider-request link; no test coverage is weakened.

Confidence Score: 5/5

Safe to merge — the change is additive UI work with no backend impact, no auth touches, and no regressions introduced.

The change is a straightforward UI refactor: inline banner logic is extracted into a small, well-tested component. The localStorage guard, dismissal flow, and test coverage are all correct. No existing functionality other than the previously discussed "Request Provider" compact link is removed, and that removal is intentional and documented.

No files require special attention.

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/components/molecules/cost_optimization_feedback_banner.tsx New self-contained dismissible banner component with localStorage persistence; clean extraction with constants and SSR guard matching existing codebase patterns
ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/ModelsAndEndpointsView.tsx Replaces inline "Missing a provider?" banner and its state/compact-link logic with the new CostOptimizationFeedbackBanner component; removes unused PlusCircleOutlined import
ui/litellm-dashboard/src/components/molecules/cost_optimization_feedback_banner.test.tsx New unit tests covering render, dismiss interaction with localStorage write, and remount persistence; uses beforeEach cleanup to isolate tests
ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/ModelsAndEndpointsView.test.tsx Tests updated to reflect new banner text, new localStorage key, and removal of the compact "Request Provider" link; replaces the removed test case with an equivalent remount-persistence check

Reviews (2): Last reviewed commit: "test(ui): update Models+Endpoints banner..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f55abf0000

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

</div>
)}
{/* Cost Optimization Feedback Banner */}
<CostOptimizationFeedbackBanner />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the provider request CTA

This replacement removes both the Missing provider banner and its compact Request Provider fallback; repo-wide rg "models\\.litellm\\.ai/\\?request=true|Request Provider" ui/litellm-dashboard now finds only tests, so the Models + Endpoints page no longer gives users a path to request an unsupported provider. If the intent is just to add cost-optimization feedback, keep the provider-request CTA somewhere instead of replacing it entirely.

Useful? React with 👍 / 👎.

</button>
</div>
)}
{/* Cost Optimization Feedback Banner */}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the new JSX comment

CLAUDE.md says "Do not write any comments" unless explicitly requested, but this change adds a new JSX comment that only repeats the component name. Please remove it to keep the patch within the repo-level coding guideline.

Useful? React with 👍 / 👎.

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…banner

Missing Provider banner tests are replaced since that banner was removed
in favor of the new always-on cost optimization feedback banner.
@krrish-berri-2

Copy link
Copy Markdown
Contributor Author

@greptileai review

@krrish-berri-2
krrish-berri-2 enabled auto-merge (squash) July 5, 2026 03:55
@krrish-berri-2

Copy link
Copy Markdown
Contributor Author

@yuneng-berri 🙏

@krrish-berri-2
krrish-berri-2 merged commit 6cecb6e into litellm_internal_staging Jul 6, 2026
124 checks passed
@krrish-berri-2
krrish-berri-2 deleted the litellm_cost_optimization_banner branch July 6, 2026 16:10
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.

3 participants