{# Reusable token-usage-by-model card. Expects a ``token_usage`` dict built by app._token_usage_view(); optional ``token_usage_title`` overrides the heading. #} {% if token_usage and token_usage.has_data %}
| Model | Input | Output | Total | Cached in | Cache hit | Calls | Quality |
|---|---|---|---|---|---|---|---|
| {{ m.model or '—' }} | {{ '{:,}'.format(m.input_tokens or 0) }} | {{ '{:,}'.format(m.output_tokens or 0) }} | {{ '{:,}'.format(m.total_tokens or 0) }} | {# '—' means the provider reported no cache details; 0.0% is a measured miss. #}{% if m.cache_hit_pct is not none %}{{ '{:,}'.format(m.cached_input_tokens or 0) }}{% else %}—{% endif %} | {% if m.cache_hit_pct is not none %}{{ m.cache_hit_pct }}%{% else %}—{% endif %} | {{ m.calls or 0 }} | {% if not m.estimated_usage and not m.missing_usage %} exact {% else %} {% if m.estimated_usage %}{{ m.estimated_usage }} est{% endif %} {% if m.missing_usage %}{{ m.missing_usage }} missing{% endif %} {% endif %} |
⚠ This per-request summary may be incomplete: {{ token_usage.incomplete_reason }}
{% endif %}