Langfuse overwriting ingested usage for gpt-4o-mini models & incorrect inferred usage for low-detail image data #4231
Replies: 2 comments 6 replies
-
Langfuse is designed to prioritize user-provided usage data over inferred data. If you're experiencing issues where Langfuse is overwriting your ingested usage data for the Regarding the incorrect usage data for low-detail image settings, there isn't specific information available about how Langfuse handles 'low' detail image data or any related configurations in the self-hosted version 2.81.0 OSS [1]. This might require further investigation or a potential update to the Langfuse system to handle such cases correctly. To address these issues, you might want to:
If the problem persists, it might be beneficial to look into the Langfuse codebase or reach out to the maintainers for more detailed troubleshooting. |
Beta Was this translation helpful? Give feedback.
-
How do you integrate with Langfuse, do you use the latest openai integration? Please provide more details, happy to have a look For context, Langfuse uses tiktoken to infer token counts when none are set. This currently does not work correctly for multi-modal traces, but when using openai token counts should be captured at the source when using one of the Langfuse integrations. |
Beta Was this translation helpful? Give feedback.
-
I am using Langfuse low-level Python SDK to track my gpt-4o-models usage. I use a generation to track model i/o, TTFT and usage information. I found two issues here:
Langfuse returns incorrect usage if I set "detail": "low" according to OpenAI vision guide. The model returns
'usage': {'completion_tokens': 120, 'prompt_tokens': 5683, 'total_tokens': 5803}
, but I got15,631 → 120 (∑ 15,751)
from Langfuse.Even if I send the usage to Langfuse client, Langfuse still prefers its inferred usage, which is not intended according to Langfuse documentation. I tried to update the model (in the generation) to something else, and it tracked the usage data correctly. I am attaching a screenshot of my experiments below:
I am using a self-hosted Langfuse (v2.81.0 OSS) for these experiments. I hope it helps.
Beta Was this translation helpful? Give feedback.
All reactions