Skip to content

[Fix] UI - Model Info Page: Fix Input and Output Labels#20462

Merged
yuneng-jiang merged 1 commit intomainfrom
litellm_model_info_cost
Feb 6, 2026
Merged

[Fix] UI - Model Info Page: Fix Input and Output Labels#20462
yuneng-jiang merged 1 commit intomainfrom
litellm_model_info_cost

Conversation

@yuneng-jiang
Copy link
Collaborator

Relevant issues

Pre-Submission checklist

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

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

🐛 Bug Fix
✅ Test

Changes

Fixes display issue where input and output cost labels showed null when cost values were not set. Now displays "Not Set" instead. Removes console.log statements. Refactors and expands test coverage for ModelInfoView component with improved mocking and additional test cases.

Screenshots

image image

@vercel
Copy link

vercel bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Feb 5, 2026 4:18am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Greptile Overview

Greptile Summary

Fixed UI bug where input and output cost labels displayed null when cost values were not set. Now shows "Not Set" instead, improving user experience. Also removed debug console.log statements from production code.

Changes:

  • Fixed null display issue on model_info_view.tsx:649-652 and model_info_view.tsx:665-669
  • Removed 8 console.log statements for cleaner production code
  • Significantly improved test coverage with comprehensive test suite refactoring
  • Tests now use better mocking patterns with vi.mocked() and proper mock setup
  • Added 25+ new test cases covering UI interactions, edge cases, and user flows

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Simple, focused bug fix with proper test coverage. Changes are isolated to UI display logic with no impact on backend or data flow. Test improvements follow best practices.
  • No files require special attention

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/components/model_info_view.tsx Fixes null display for input/output costs, removes console.log statements
ui/litellm-dashboard/src/components/model_info_view.test.tsx Refactors tests with improved mocking and expands coverage with 25+ new test cases

Sequence Diagram

sequenceDiagram
    participant User
    participant ModelInfoView
    participant Component as Model Component
    participant Display as Cost Display

    User->>ModelInfoView: View model info page
    ModelInfoView->>Component: Load model data
    Component->>Display: Render input cost
    
    alt Cost value exists
        Display->>User: Show (cost * 1M).toFixed(4)
    else Cost value is null/undefined
        Display->>User: Show "Not Set"
    end
    
    Component->>Display: Render output cost
    
    alt Cost value exists
        Display->>User: Show (cost * 1M).toFixed(4)
    else Cost value is null/undefined
        Display->>User: Show "Not Set"
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@yuneng-jiang yuneng-jiang merged commit ac8f380 into main Feb 6, 2026
56 of 66 checks passed
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