Replies: 1 comment
-
|
You're partially correct. In Langfuse v3, cost data is stored in the database, but the storage location changed during the migration from v2 to v3(1). According to the migration documentation, a cost backfill background migration runs as part of the v3 upgrade(1). This migration "calculate[s] costs for all events and store[s] them in the Postgres database"(1). The documentation specifically notes that "before, those were calculated on read which had a negative impact on read performance"(1). So in Langfuse v3:
The cost information you see in traces comes from the PostgreSQL database where it's been pre-computed and stored. If you're not finding the cost data in your PostgreSQL tables, it's possible the background migration hasn't completed yet, or you may need to check the specific tables where cost details are stored alongside the usage data. 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe your question
In each Langfuse trace, I can see that there is information about LLM calling cost.
I attempted to search the Langfuse PostgreSQL for the cost data but I couldn't discover them. Also I don't see them in clickhouse data.
I guess that the Langfuse PostgreSQL only store the unit price of the LLM calls, and those price data are actually caulculated by Langfuse rather than retrieved from database records.
Please correct me if I am wrong. Thank you very much.
Langfuse Cloud or Self-Hosted?
Self-Hosted
If Self-Hosted
No response
If Langfuse Cloud
No response
SDK and integration versions
No response
Pre-Submission Checklist
Beta Was this translation helpful? Give feedback.
All reactions