Skip to content

bug: Usage input/output 0 after upgrading from v2.56.2 to v2.57.1 #4974

@jerry-reevo

Description

@jerry-reevo

Describe the bug

Specifically for Langchain traces that make LLM calls to BedRock, we've noticed that input/output usage is reported as 0/0 after upgrading to v2.57.1 of the Python SDK. Total is still there, but because input and output is 0, there is no more cost tracking.

Example:

Screenshot 2025-01-10 at 5 49 15 PM

Simply reverting to v2.56.2 results in intput/output and cost to populate again.

Screenshot 2025-01-10 at 5 52 27 PM

All our other LLM calls going through LiteLLM to OpenAI, Anthropic, and Gemini all appear to have usage tracked as expected.

To reproduce

Simply use version v2.57.1 or newer of the Python SDK and create a LangChain chain with a ChatBedrock LLM. In our case, we were using anthropic.claude-3-5-sonnet-20240620-v1:0.

We also use the Langfuse CallbackHandler attached as a callback to the .invoke(... config={ ... }) call.

SDK and container versions

v2.57.1+
Python 3.12

Additional information

No response

Are you interested to contribute a fix for this bug?

Yes

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions