Cost Tracking for Input cache writes #6757
-
|
Does Langfuse detects the cost for input cache write as well? I couldn't find relevant documentation on that. I can see that it tracks separate cost for input cache reads, but not sure whether it track cost for input cache writes. Also, I can see that it detects number of input cache write tokens and read tokens. Can someone clarify on this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
Hello @Agilan3996! I'm Dosu, here to help you with any questions or issues you might have. While you're waiting for a human maintainer, I'll do my best to assist you! Yes, Langfuse does support cost tracking for input cache writes. According to the changelog from December 20, 2024, Langfuse tracks costs for all usage types, including cached tokens [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
Beta Was this translation helpful? Give feedback.
The details regarding the cost calculation for input cache writes are not explicitly documented in the Langfuse documentation. However, you can confirm the calculation in a self-hosted Langfuse setup by examining the codebase. Specifically, the
calculateUsageCostsmethod in theIngestionServiceclass handles the cost calculation for input cache writes. This method uses the input price specified in the database to calculate costs [1].Additionally, the
default-model-prices.jsonfile in the codebase specifies the costs for input cache creation, which you can review to understand the pricing for different models [2].To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feed…