Replies: 1 comment 1 reply
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: Support for accessing cache-related token counts from LiteLLM, including cache write tokens, was added in ADK v1.18.0. Please ensure you are using this version or newer. Hi @jimkont, Thank you for your detailed question. I can provide some information based on the ADK documentation and source code. 1. Is there a supported way in ADK to access cache write token counts?Yes, support for this was added in ADK version 1.18.0. [1] The release notes indicate that support was added to extract cache-related token counts from LiteLLM usage. This means that fields like These token counts are exposed through the 2. If not, is the recommended approach to extend the LiteLLM adapter?Given that the feature should be supported as of v1.18.0, extending the adapter should not be necessary. However, if you are unable to upgrade or find that the fields are not being populated as expected, your suggestion of extending the 3. Are there plans to expose cache write tokens in
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I’m using ADK’s
LiteLlmwith context caching (via LiteLLM + Anthropic/Bedrock) and collecting usage metrics.From
LlmResponseI can get:cached_content_token_count(cache read) fromusage_metadatacache_metadataBut I can’t find any way to get cache write / cache creation tokens.
On the LiteLLM / Anthropic side there are fields like:
cache_creation_input_tokenscache_read_input_tokensHowever, these don’t seem to be exposed in:
usage_metadatacache_metadatacustom_metadataQuestions
LlmResponse.custom_metadata?usage_metadata?My goal is accurate cost and caching-efficiency metrics.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions