Skip to content

King0James0/context_indicator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Context Window Indicator Plugin

Shows real-time context window usage percentage in the Agent Zero chat UI bar.

Support

If this plugin is useful to you, you can support the developer.

Buy Me a Coffee Solana Ethereum Bitcoin

Features

  • Displays current token usage as a percentage of the model's context window
  • Color-coded indicator: green (ok), yellow (warning), orange (danger), red (critical)
  • Visual progress bar alongside the percentage
  • Tooltip with detailed token count, context length, model name, and percentage
  • Auto-polls every 5 seconds to keep stats current
  • Responsive design: hides progress bar on mobile, keeps percentage visible

Configuration

Edit default_config.yaml to customize thresholds:

Setting Default Description
warning_threshold 50 Percentage to show yellow warning
danger_threshold 75 Percentage to show orange danger
critical_threshold 90 Percentage to show red critical
show_bar true Show/hide the progress bar
poll_interval_seconds 5 How often to refresh stats

How It Works

  1. Extension Hook: response_stream_end hook computes token stats after each agent response and caches them
  2. API Endpoint: /plugins/context_indicator/context_stats serves cached or fresh stats per context
  3. Alpine Store: Frontend store polls the API and provides reactive data
  4. UI Badge: Rendered in chat-input-bottom-actions-end slot with color-coded display

About

Agent Zero plugin: Real-time context window usage percentage indicator in the chat UI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 45.2%
  • HTML 33.3%
  • JavaScript 21.5%