[GH-ISSUE #76] feat: context window info #32

Open
opened 2026-10-18 14:02:13 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @naqerl on GitHub (Jun 21, 2026).
Original GitHub issue: https://github.com/open-webui/computer/issues/76

Problem

Version: v0.6.1

Cptr uses hardcoded openai models info (except anthropic) and compaction threshold as a fixed amount of tokens (configurable).

Reasoning

Resource like https://models.dev/api.json provides a complete info about popular models (utilized by opencode). Using it will eliminate wrong context size in the UI (e.g. 216%) and make it much easier to use a fraction of the context for compaction over configurable tokens amount e.g. 0.6 instead of 80K, as almost any model would have a context window info.

Proposed solution

For portability, it could be fetched on startup and stored in the app.db with TTL, which will be used by the background task for refreshing.

Requested deliverables

  1. Valid context window for the popular modules, not onlyopenai & antropic
  2. Using context fraction as a threshold for compaction with fixed amount as a fallback or ability to choose from these 2 option (yet the fraction is a more generic version of the fixed amount, so for me this replacement is straightforward)
Originally created by @naqerl on GitHub (Jun 21, 2026). Original GitHub issue: https://github.com/open-webui/computer/issues/76 ## Problem Version: `v0.6.1` Cptr uses hardcoded openai models info (except anthropic) and compaction threshold as a fixed amount of tokens (configurable). ## Reasoning Resource like https://models.dev/api.json provides a complete info about popular models (utilized by opencode). Using it will eliminate wrong context size in the UI (e.g. 216%) and make it much easier to use a fraction of the context for compaction over configurable tokens amount e.g. 0.6 instead of 80K, as almost any model would have a context window info. ## Proposed solution For portability, it could be fetched on startup and stored in the `app.db` with TTL, which will be used by the background task for refreshing. ## Requested deliverables 1. Valid context window for the popular modules, not onlyopenai & antropic 2. Using context fraction as a threshold for compaction with fixed amount as a fallback or ability to choose from these 2 option (yet the fraction is a more generic version of the fixed amount, so for me this replacement is straightforward)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/computer#32
No description provided.