Show HN: A tool to properly observe your LLM's context window (blog.nilenso.com)

🤖 AI Summary
A developer released context-viewer, an open-source, browser-only tool that makes an LLM conversation’s context window inspectable and measurable. You drag-and-drop JSON chat logs and the app segments text, counts tokens, classifies messages into meaningful components, and visualizes how those components grow and interact over time with a time-slider and stacked bars. The goal is to give engineers actionable observability for “context engineering” — exposing redundancy, irrelevant prompts, or toxic snippets that quietly consume tokens and steer model behavior. Technically, context-viewer parses OpenAI-style conversation logs, uses dqbd/tiktoken’s WASM bindings to count tokens in parallel, breaks long messages (threshold ~500 tokens) into semantic chunks via an LLM, and runs additional AI calls to discover and label components. Prompts are editable in the UI so you can tailor segmentation and taxonomy; the author uses gpt-4o-mini for speed (13k tokens ≈15s, 35k ≈40s). Trade-offs include extra token usage for analysis, browser scaling limits, and the need to engineer a non-LLM pipeline for high-volume workloads. By revealing things like duplicated docs that consumed ~13% of context or iterative story regeneration that ballooned to 41%, the tool demonstrates practical ways to reduce “garbage in” and informs how teams should design scalable context-management and observability pipelines.
Loading comments...
loading comments...