Skip to content

Enhance chart readability with short-form notation for large numbers #11571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

NANDINI-star
Copy link
Collaborator

@NANDINI-star NANDINI-star commented Jun 10, 2025

Title

Enhance chart readability with short-form notation for large numbers

Relevant issues

The chart uses metrics.XXX labels on the legend and tooltip, these should be converted to plain texts e.g. if we have metrics.prompt_tokens it should be modified to “Prompt Tokens”

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
  • I have added a screenshot of my new test passing locally
  • 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

Type

🐛 Bug Fix
🧹 Refactoring

Changes

  • Implemented short-form notation for y-axis values (e.g. 1k, 100k, 1M)
  • Applied changes across Usage charts (cost, model activity, key activity)
  • Maintained full number display in tooltips on hover
  • Improved legend labels and tooltips to use plain English instead of programmatic metrics names (e.g. "Prompt Tokens" instead of "metrics.prompt_tokens")
Screenshot 2025-06-10 at 1 33 52 PM Screenshot 2025-06-10 at 1 34 24 PM

Copy link

vercel bot commented Jun 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 4:39am

@NANDINI-star NANDINI-star changed the base branch from main to develop/usage-charts-improvements June 10, 2025 04:42
Copy link
Contributor

@ishaan-jaff ishaan-jaff left a comment

Choose a reason for hiding this comment

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

LGTM

@ishaan-jaff ishaan-jaff merged commit 2c587c1 into develop/usage-charts-improvements Jun 10, 2025
11 checks passed
krrishdholakia pushed a commit that referenced this pull request Jul 8, 2025
* Enhance chart readability with short-form notation for large numbers (#11571)

* format y-axis value for total tokens

* format y-axis for the rest of the charts on model-activity

* revert changes for requests per day

* labels modified to plain text

* added plain text label for api_requests and spend

* minor

* improve keyname display (#11573)

* fix tags overlap

- no need to fix decimal points for valueFormatterSpend() bcz we're only going to use it for values on the x and y axis of a chart
- show only top 5 values of tags
- format the values on the x-axis

* format spend values to short form

* format spend to short form

* showing top 5 tags data more perceptively

* remove mock data

* remove console.log

* prettier

* prettier + remove unused functions
satendrakumar pushed a commit to satendrakumar/litellm that referenced this pull request Jul 24, 2025
* Enhance chart readability with short-form notation for large numbers (BerriAI#11571)

* format y-axis value for total tokens

* format y-axis for the rest of the charts on model-activity

* revert changes for requests per day

* labels modified to plain text

* added plain text label for api_requests and spend

* minor

* improve keyname display (BerriAI#11573)

* fix tags overlap

- no need to fix decimal points for valueFormatterSpend() bcz we're only going to use it for values on the x and y axis of a chart
- show only top 5 values of tags
- format the values on the x-axis

* format spend values to short form

* format spend to short form

* showing top 5 tags data more perceptively

* remove mock data

* remove console.log

* prettier

* prettier + remove unused functions
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.

2 participants