Skip to main content

Module cache_diagnostics

Module cache_diagnostics 

Source
Expand description

Provider cache diagnostics integration (#1311).

Monitor provider-side prompt cache hit rates and alert on regressions. Anthropic offers 90% cost reduction on cache hits; a drop in hit rate is a cost incident. This module provides the monitoring infrastructure.

Structs§

CacheDiagnostics
Cache diagnostic snapshot.

Enums§

CacheAlertSeverity
Alert severity for cache regressions.

Functions§

check_alert
Generate a cache alert if hit rate is below thresholds.
hit_rate
Current cache hit rate (0.0–1.0), or None if no samples yet.
record_hit
Record a cache hit from provider response headers.
record_miss
Record a cache miss.
reset
Reset counters (for testing).