LibreChat icon indicating copy to clipboard operation
LibreChat copied to clipboard

[Enhancement]: Track Tool Costs as Transactions

Open leondape opened this issue 1 year ago • 3 comments

What features would you like to see added?

Currently, image generation can not be tracked and does not effect the credits. I propose changing this and adding an image transaction collection like discussed in #6147.

Alongside with that I propose to have separate image credits, equivalent to the chat credits (though dollar-cents make a lot of sense there).

Image generation is quite costly. That way, a reasonable consumption can be easily enforced when deployed within organisations.

More details

Noting more

Which components are impacted by your request?

No response

Pictures

No response

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

leondape avatar Mar 10 '25 15:03 leondape

@danny-avila, I've been poking around to see how this is set up. From what I can tell, the balance tracking is based on tokens × rate, which makes a lot of sense for standard input/output tokens. I was thinking, though — maybe it would be cleaner to track everything in dollars instead of handling image credits separately. That way, we could consolidate balance tracking across all usage — tools and chats included. Let me know what you think! More than happy to help out with this if we want to move in that direction.

lurkerCha avatar Apr 11 '25 08:04 lurkerCha

I've made a simple modification to my UI by calculation balance / 1_000_000. Users find that more helpful but I did not find that useful to contribute.

leondape avatar Apr 11 '25 08:04 leondape

Yep, that's right. That's a quick and easy fix if we're just looking to track the current usage in monetary credits. What I had in mind though was going a bit further: converting the current token tracking into a monetary limit, along with including tool usage costs in that same credit system. That way, it gives a more complete picture of what's being spent. What do you think?

lurkerCha avatar Apr 14 '25 11:04 lurkerCha