What shipped
Context Gauge is a self-contained interactive meter for prompt drafting. Type into System, User, and optional Tools JSON fields and watch estimated input tokens fill a selectable context window (8k / 32k / 128k / 200k). Model presets (GPT-4o–class, Claude Sonnet–class, Gemini Flash–class, local/free) show rough illustrative input $/request. Sample load and clear keep the empty state friendly; the layout stacks cleanly on phones.
How to try
- Open the live demo (iframe on the right, or full-page link below).
- Hit Load sample to populate a short HVAC-pilot prompt, or paste your own draft.
- Switch context windows and model presets to see fill % and estimated input cost update live.
- No API keys and no network calls — everything runs in the browser.
Scope trim
No real tiktoken, no provider APIs, no account sync, and no output-token modeling. Token counts use a labeled ~4 characters/token heuristic. Dollar figures are illustrative list-price ballparks for input tokens only.
Limitations
- Estimates will not match provider tokenizers or negotiated pricing.
- Tools JSON is counted as plain text — not schema-validated.
- Does not model completion tokens, cached-input discounts, or batch pricing.
Suggested next steps
- Optional side-by-side tokenizer swap (tiktoken / Anthropic) once a tiny offline wasm path is worth the weight.
- Output-budget slider so headroom accounts for a planned completion size.
- Export a one-line “receipt” of estimated tokens + model class for paste into build notes.