haystack-core-integrations icon indicating copy to clipboard operation
haystack-core-integrations copied to clipboard

Feature Request: Track Embedding Request Costs in Haystack-Langfuse

Open kluhan opened this issue 1 year ago • 0 comments

Feature Request: Track Embedding Request Costs in Haystack-Langfuse

Is your feature request related to a problem?

Haystack-Langfuse currently lacks the ability to track the costs associated with embedding requests, making it difficult to manage budgets effectively.

Describe the solution you'd like

Integrate a feature that tracks and displays the cost of embedding requests based on the pricing of the service provider. This should function similarly to the existing cost-tracking for other LLM requests.

Describe alternatives you've considered

  • Manual Tracking: Manually logging and calculating costs, which is cumbersome and prone to error.

Additional context

I attempted to implement this myself by modifying the following code:
Link to Code

However, I encountered an issue where the cost calculation always overwrites the provided usage data, consistently calculating the cost based on the token count of the input and output. This method is inaccurate for embedding requests, where cost calculations should not be based on the output token counts.

kluhan avatar Sep 01 '24 21:09 kluhan