feat: support cached token usage #54

Open
opened 2026-02-15 21:15:28 -05:00 by yindo · 2 comments
Owner

Originally created by @wellenzheng on GitHub (Aug 7, 2025).

support cached token usage

while glm-4.5 series models are supporting, we have the new usage strategy cached_token, we are hoping to add the cached_token support in the LLMUsage.

glm-4.5 usage sample

"usage": {
"completion_tokens": 139,
"prompt_tokens": 15427,
"prompt_tokens_details": {
"cached_tokens": 170
},
"total_tokens": 15566
}

Originally created by @wellenzheng on GitHub (Aug 7, 2025). ### support cached token usage while glm-4.5 series models are supporting, we have the new usage strategy cached_token, we are hoping to add the cached_token support in the LLMUsage. ### glm-4.5 usage sample "usage": { "completion_tokens": 139, "prompt_tokens": 15427, "prompt_tokens_details": { "cached_tokens": 170 }, "total_tokens": 15566 }
yindo added the enhancement label 2026-02-15 21:15:28 -05:00
Author
Owner

@OPSTime commented on GitHub (Dec 23, 2025):

huaweicloud DeepSeek-V3 models are supporting, we are hoping to add the cached_token support in the LLMUsage.

DeepSeek-V3 usage sample

"usage": {
"completion_tokens": 46,
"prompt_tokens": 4282,
"total_tokens": 4328,
"completion_tokens_details": null,
"prompt_tokens_details": {
"audio_tokens": null,
"cached_tokens": 1024
}
}

@OPSTime commented on GitHub (Dec 23, 2025): huaweicloud DeepSeek-V3 models are supporting, we are hoping to add the cached_token support in the LLMUsage. DeepSeek-V3 usage sample "usage": { "completion_tokens": 46, "prompt_tokens": 4282, "total_tokens": 4328, "completion_tokens_details": null, "prompt_tokens_details": { "audio_tokens": null, "cached_tokens": 1024 } }
Author
Owner

@OPSTime commented on GitHub (Dec 25, 2025):

@Mairuis
Could you please implement this feature as soon as possible?
What is the approximate timeline?
Additionally, once this feature is implemented, will dify be able to support it immediately?

@OPSTime commented on GitHub (Dec 25, 2025): @Mairuis Could you please implement this feature as soon as possible? What is the approximate timeline? Additionally, once this feature is implemented, will dify be able to support it immediately?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-sdks#54