open-webui / open-webui/computer
feat: context window info
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 569
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Description
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
- Valid context window for the popular modules, not onlyopenai & antropic
- 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)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing where model information and the fixed compaction threshold are defined and used, then inspect the startup, app.db, and background-task paths mentioned in the proposal. Done means popular models have valid context-window data, refreshed data is stored with a TTL, and compaction can use a context fraction with the stated fixed-token fallback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100