{# What `/usage` shows. Two different numbers, deliberately kept apart. **Used** is how full the window is right now -- one reply's prompt plus its completion, which is what decides when compaction fires. **Spent** is everything this conversation has cost end to end, which is larger and grows forever: a three-round reply pays for its prompt three times but only ever occupies the window once. Anything derived from an estimate wears a `~`, because `services/tokens.py` counts four characters to a token when an endpoint reports nothing, and a precise-looking figure that is a guess is worse than an obvious guess. #}
| {{ t("In the window now") }} | {% if metrics.context_tokens %} {% set used = ('~' if metrics.estimated else '') ~ '{:,}'.format(metrics.context_tokens) %} {% if metrics.percent %} {{ t("%(n)s tokens — %(percent)s%% of %(limit)s", n=used, percent=metrics.percent, limit='{:,}'.format(metrics.context_limit)) }} {% else %} {{ t("%(n)s tokens", n=used) }} {% endif %} {% else %} {{ t("Nothing yet.") }} {% endif %} |
| {{ t("Window size") }} | {% if model %} {{ t("Not recorded for %(model)s, so there is no percentage and this chat will never compact itself.", model=model.label) }} {% else %} {{ t("Not recorded for this model, so there is no percentage and this chat will never compact itself.") }} {% endif %} {% if user.is_admin %} {{ tm('Set it under Models.') }} {% endif %} |
| {{ t("Spent in total") }} | {% set spent = ('~' if estimated else '') ~ '{:,}'.format(totals.total) %} {{ t("%(n)s tokens across %(replies)s reply", n=spent, replies=replies) if replies == 1 else t("%(n)s tokens across %(replies)s replies", n=spent, replies=replies) }} |
| {{ t("Of which sent") }} | {{ t("%(n)s tokens", n=('~' if estimated else '') ~ '{:,}'.format(totals.prompt)) }} |
| {{ t("Of which written") }} | {{ t("%(n)s tokens", n=('~' if estimated else '') ~ '{:,}'.format(totals.completion)) }} |
| {{ t("Cost") }} | {{ cost.money }} |
| {{ t("Last reply") }} | {{ t("%(n)s tokens/second", n='%.1f'|format(metrics.tokens_per_second)) }} |
| {{ t("Compacted") }} | {{ t("Earlier turns are summarised. They are still in the transcript; they just stop being sent.") }} |