-
Notifications
You must be signed in to change notification settings - Fork 615
Open
Description
Cache Usage Monitoring Enhancement
Overview
Previously, a TODO was marked to add a property showing how much of the cache is used. This is useful for debugging and monitoring cache usage during multi-turn conversations.
Previous State
- No easy way to check cache usage without accessing internal
last_statedirectly - Users had to manually compute
state.used_cache_length / cache_length
Changes
Added Cache Usage Monitoring
Cache usage monitoring was added to both sampler classes:
-
ChatSampler.cache_usageproperty- Returns a
(used, total)tuple - Returns
Noneif no sampling has been performed yet
- Returns a
-
Sampler.get_cache_usage()static method — For stateless usage with the low-level API- Takes a SamplingState and cache_length as parameters
Metadata
Metadata
Assignees
Labels
No labels