Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/troubleshooting/context-window.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ This is the summarize-and-replace strategy (option 4 below), built in. If you ne

It is `null` when compaction is disabled or the chat has no messages. `source` is always `estimated`, even when the count was built from provider-reported usage, so it does not tell the two apart. Open WebUI prefers the token counts the provider itself reported: it walks back to the most recent message carrying a usage record, takes its prompt and completion totals, and only estimates the messages after that point. When no message carries usage, the whole figure is estimated, and an estimate is not a tokenizer-exact figure, so treat it as a gauge rather than a billing number.

The context usage shown in the chat measures against the same threshold compaction uses.
In chat, open **Context usage** with `/status`. When a positive compaction threshold is available, the row shows token usage as a percentage of that threshold and displays a progress bar. When a token estimate is available without a positive threshold, the row shows only the count. A **Context compacted** marker in the conversation shows that compaction ran.

Provider vocabularies differ, and all the common ones are read: `prompt_tokens` / `completion_tokens` (OpenAI-style), `input_tokens` / `output_tokens`, `prompt_eval_count` / `eval_count` (Ollama), and `prompt_n` / `predicted_n` plus `cache_n` (llama.cpp). Local backends therefore compact on reported numbers instead of estimates. The stored usage travels with the chat history, so the reported count is available on later turns too, not only on the request that produced it.

Expand Down
Loading