Skip to content
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

Adds LLM cost view in insights #376

Merged
merged 6 commits into from
Sep 29, 2024
Merged

Adds LLM cost view in insights #376

merged 6 commits into from
Sep 29, 2024

Conversation

elijahbenizzy
Copy link
Contributor

@elijahbenizzy elijahbenizzy commented Sep 29, 2024

This is left with a placeholder for unhardcoding the values. Otherwise it's fixed at 5.00/1m tokens, just to illustrate.

Changes

How I tested this

Notes

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

Important

Adds Total LLM Cost insight to InsightsView.tsx to calculate and display LLM usage cost based on token usage.

  • Behavior:
    • Adds Total LLM Cost insight in InsightsView.tsx to calculate and display LLM usage cost.
    • Uses gatherCostAttributes() to aggregate cost-related attributes.
    • Formats cost using Cost component with dynamic decimal places.
  • Functions:
    • getCostPerTokenModelDollars() retrieves cost per token for models.
    • gatherCostAttributes() aggregates token usage and calculates total cost.
    • Cost component formats and displays cost values.
  • Misc:
    • Adds placeholder for unhardcoding cost values in getCostPerTokenModelDollars().

This description was created by Ellipsis for 0ee6618. It will automatically update as commits are pushed.

This is left with a placeholder for unhardcoding the values. Otherwise
it's fixed at 5.00/1m tokens, just to illustrate.
Copy link

github-actions bot commented Sep 29, 2024

A preview of 0ee6618 is uploaded and can be seen here:

https://burr.dagworks.io/pull/376

Changes may take a few minutes to propagate. Since this is a preview of production, content with draft: true will not be rendered. The source is here: https://github.com/DAGWorks-Inc/burr/tree/gh-pages/pull/376/

skrawcz and others added 5 commits September 28, 2024 20:40
Adds raw data to be included in the UI for calculating
model costs.
This file is something we will need
to periodically update.
They are different, the code now reflects that (still a placeholder
though)
@elijahbenizzy elijahbenizzy marked this pull request as ready for review September 29, 2024 05:03
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 0ee6618 in 1 minute and 9 seconds

More details
  • Looked at 4010 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_IFFNHGP3MQfHumgA


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

telemetry/ui/scripts/token_costs.py Show resolved Hide resolved
@elijahbenizzy elijahbenizzy merged commit e4fde23 into main Sep 29, 2024
12 checks passed
@elijahbenizzy elijahbenizzy deleted the llm-cost branch September 29, 2024 21:34
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