feat: add ModelIntelligence and ContextWindowSize widgets#248
Open
rdeknijf wants to merge 1 commit intosirmalloc:mainfrom
Open
feat: add ModelIntelligence and ContextWindowSize widgets#248rdeknijf wants to merge 1 commit intosirmalloc:mainfrom
rdeknijf wants to merge 1 commit intosirmalloc:mainfrom
Conversation
Add two new context-awareness widgets: - **ContextWindowSize**: Displays the total context window size (e.g. "200k", "1.0M") based on the active model, using the existing model-context and context-window utilities. - **ModelIntelligence**: Shows a Model Intelligence (MI) score from 1.000 to 0.000 that reflects estimated model quality as the context window fills. Uses the formula MI = max(0, 1 - u^β) with per-model β values (Opus=1.8, Sonnet=1.5, Haiku=1.2), calibrated against Anthropic's MRCR v2 retrieval benchmark. MI concept and formula credit: luongnv89/cc-context-stats https://github.com/luongnv89/cc-context-stats Both widgets support raw-value mode and color customization.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
200k,1.0M) based on the active model. Uses existingmodel-contextandcontext-windowutilities.1.000to0.000reflecting estimated model quality as the context fills. Formula:MI = max(0, 1 - u^β)with per-model β (Opus=1.8, Sonnet=1.5, Haiku=1.2), calibrated against Anthropic's MRCR v2 retrieval benchmark.Both widgets support raw-value mode and color customization, and follow the existing widget patterns.
Credit
The MI concept and formula originate from cc-context-stats by @luongnv89.
Test plan
context-window-sizerenders correctly with piped input for different models (with/without[1m]suffix)model-intelligencerenders correct MI scores at various context fill levelsbun run lintandbun test— no regressions🤖 Generated with Claude Code