Skip to content

Add cache analytics dashboard #11

Description

@TheKrush

Summary

Add a cache analytics dashboard that makes prompt/input cache utilization easy to understand.

The dashboard should show cache hit rate, cached vs uncached input tokens, token breakdowns, and evidence labels without pretending provider cache internals are more precise than the available data supports.

Current behavior

PromptFuel tracks usage, but cache utilization is not surfaced as a first-class analytics view with clear cache-hit-rate and cached-vs-uncached input breakdowns.

Desired behavior

PromptFuel should provide an activity-style cache analytics view that helps users see how well cache is being utilized over a selected time window.

Requirements

  • Add a top-level cache hit rate card when provider fields support it.
  • Add a prompt/input token caching chart split into cached vs uncached input tokens.
  • Add a token breakdown chart that can distinguish:
    • uncached input
    • cache-read input
    • cache-write/cache-creation input
    • output
    • reasoning output, when available
  • Use normalized token accounting rather than provider-specific raw math directly in the UI.
  • Show evidence labels for cache-related metrics.
  • Clearly mark unavailable provider metrics as unavailable, not zero.
  • Avoid double-counting cached tokens.
  • Avoid a universal cache formula unless provider mappings support it.
  • Include brief explanatory UI text for provider-specific cache semantics.
  • Keep any cache-friendly/cache-hostile trend labels clearly marked as heuristic if implemented.

Non-goals / constraints

  • Do not present estimated cache savings as measured savings.
  • Do not infer billing or rate-limit impact without supporting provider/pricing evidence.
  • Do not block token-accounting correctness fixes on this larger UI work.
  • Do not remove existing usage views.

Suggested implementation

Build the dashboard on top of normalized token accounting fields. Use historical buckets to render cached/uncached/output trends over time, and use provider-specific labels where a metric is unsupported.

Acceptance criteria

  • Cache hit rate is visible when supportable.
  • Cached vs uncached input token visualization is available.
  • Token breakdown separates disjoint token components.
  • Cache-related cards/charts include evidence labels.
  • Unsupported provider metrics render as unavailable rather than zero.
  • Tests or UI smoke validation cover the cache analytics view.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions