{% extends "base.html" %} {% from "macros.html" import cost, pct %} {% block title %}Cache · LLM Admin{% endblock %} {% block content %}

Cache

Window: {{ since }} → {{ until }}

Hit rate by agent

{% if hit_rate %} {% for r in hit_rate %} {% endfor %}
AgentRunsHit rateTotal cost
{{ r.agent_type }} {{ r.total_runs }} {{ pct(r.hit_rate) }} {{ cost(r.total_cost) }}
{% else %}

No runs in the window.

{% endif %}

Cache effectiveness by agent (all time)

{% if stats %} {% for s in stats %} {% endfor %}
AgentEntriesHitsEntries hitLive runsDistinct hashesLast hit
{{ s.agent_type }} {{ s.entries }} {{ s.hits }} {{ s.entries_hit }} {{ s.live_runs }} {{ s.distinct_hashes }} {{ s.last_hit_at or '—' }}
Entries ≈ live runs with ~0 hits means every call minted a fresh key — a cache that structurally cannot hit (e.g. a prompt interpolating the current date).
{% else %}

No cache activity yet.

{% endif %}

Top cache entries by hit count

{% if top_entries %} {% for e in top_entries %} {% endfor %}
IDAgentModelHitsLast hitCreatedSource run
#{{ e.id }} {{ e.agent_type }} {{ e.model }} {{ e.hit_count }} {{ e.last_hit_at or '—' }} {{ e.created_at }} #{{ e.source_run_id }}
{% else %}

No cache entries yet.

{% endif %} {% endblock %}