Calm motion: animations on this site only fade, with no movement
Context meter
How much of the context window the tokens use
Shows, in a small ring, how full the context window of a model is. The context window is the number of tokens that a model can read at one time. A click on the ring opens a breakdown of the parts. Put it next to the prompt input.
Basic
Context window
- System prompt
- 3.2K
- Show notes (files)
- 41.5K
- Chat
- 96K
- Tool results
- 18.3K
- Free
- 41K
159K / 200K
partsis a list of the parts that use tokens. Each part has alabel, a number oftokens, and an optionalcolor.maxis the size of the window in tokens.- The ring and the share show the sum of the parts. At the
warnshare (default 0.8), the ring turns to the warning color. At 95%, it turns to the danger color. - The breakdown shows a bar with the parts, the tokens of each part, the free tokens, and the sum. Numbers show in short form, such as 41.5K.
- The ring is a button. Its name says the use in words, for example "80% of the context used: 160K of 200K tokens". Change the words with
labelsor a label pack:title,free, andused(a function of the used tokens, the window, and the share).
Usage
ts
import { BlessContextMeter } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
parts* | BlessContextPart[] | — | the parts of the context that use tokens |
max* | number | — | the size of the context window, in tokens |
warn | number | 0.8 | the share at which the ring turns to the warning color |
labels | Partial<{ title: string; free: string; used: (used: string, max: string, share: string) => string; }> | — |