{% if compare and date_labels %}
{% endif %}
{% set kpis = [
('total_cost', 'Total Cost', '$', '', 'lower'),
('total_tokens', 'Total Tokens', '', '', 'lower'),
('total_savings', 'Total Savings', '$', '', 'higher'),
('savings_pct', 'Savings Rate', '', '%','higher'),
('request_count', 'Requests', '', '', 'neutral'),
('avg_latency_ms','Avg Latency', '', 'ms','lower'),
] %}
{% for key, label, prefix, suffix, direction in kpis %}
{{ label }}
{{ prefix }}{{ current[key] | default(0) | round(2) }}{{ suffix }}
{% if compare and previous %}
{% set cur_val = current[key] | default(0) | float %}
{% set prev_val = previous[key] | default(0) | float %}
{% set delta = cur_val - prev_val %}
{% set delta_pct = ((delta / prev_val * 100) if prev_val != 0 else 0) | round(1) %}
{% set is_better = (direction == 'higher' and delta > 0) or (direction == 'lower' and delta < 0) %}
{% set is_worse = (direction == 'higher' and delta < 0) or (direction == 'lower' and delta > 0) %}
vs {{ prefix }}{{ prev_val | round(2) }}{{ suffix }}
{{ '+' if delta >= 0 else '' }}{{ prefix }}{{ delta | round(2) }}{{ suffix }}
({{ '+' if delta_pct >= 0 else '' }}{{ delta_pct }}%)
{{ 'โ' if direction == 'lower' and delta < 0 else 'โ' if delta > 0 else '' }}
{% endif %}
{% endfor %}
{% if compare and previous %}
No provider data for this range.
{% endif %}
No model data for this range.
{% endif %}