{# 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. #}
| In the window now | {% if metrics.context_tokens %} {{ '~' if metrics.estimated }}{{ '{:,}'.format(metrics.context_tokens) }} tokens {% if metrics.percent %} — {{ metrics.percent }}% of {{ '{:,}'.format(metrics.context_limit) }} {% endif %} {% else %} Nothing yet. {% endif %} |
| Window size | Not recorded for {{ model.label if model else "this model" }}, so there is no percentage and this chat will never compact itself. {% if user.is_admin %} Set it under Models. {% endif %} |
| Spent in total | {{ '~' if estimated }}{{ '{:,}'.format(totals.total) }} tokens across {{ replies }} repl{{ 'y' if replies == 1 else 'ies' }} |
| Of which sent | {{ '~' if estimated }}{{ '{:,}'.format(totals.prompt) }} tokens |
| Of which written | {{ '~' if estimated }}{{ '{:,}'.format(totals.completion) }} tokens |
| Last reply | {{ '%.1f'|format(metrics.tokens_per_second) }} tokens/second |
| Compacted | Earlier turns are summarised. They are still in the transcript; they just stop being sent. |