{"by":"mrciffa","descendants":26,"id":42918237,"kids":[42920656,42924593,42920789,42921012,42927061,42919614,42919201,42918876,42918559],"score":132,"text":"We&#x27;ve open-sourced Klarity - a tool for analyzing uncertainty and decision-making in LLM token generation. It provides structured insights into how models choose tokens and where they show uncertainty.<p>What Klarity does:<p>- Real-time analysis of model uncertainty during generation\n- Dual analysis combining log probabilities and semantic understanding\n- Structured JSON output with actionable insights\n- Fully self-hostable with customizable analysis models<p>The tool works by analyzing each step of text generation and returns a structured JSON:<p>- uncertainty_points: array of {step, entropy, options[], type}\n- high_confidence: array of {step, probability, token, context}\n- risk_areas: array of {type, steps[], motivation}\n- suggestions: array of {issue, improvement}<p>Currently supports hugging face transformers (more frameworks coming), we tested extensively with Qwen2.5 (0.5B-7B) models, but should work with most HF LLMs.<p>Installation is simple:\n`pip install git+<a href=\"https:&#x2F;&#x2F;github.com&#x2F;klara-research&#x2F;klarity.git\">https:&#x2F;&#x2F;github.com&#x2F;klara-research&#x2F;klarity.git</a>`<p>We are building OS interpretability&#x2F;explainability tools to visualize &amp; analyse attention maps, saliency maps etc. and we want to understand your pain points with LLM behaviors. What insights would actually help you debug these black box systems?<p>Links:<p>- Repo: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;klara-research&#x2F;klarity\">https:&#x2F;&#x2F;github.com&#x2F;klara-research&#x2F;klarity</a>\n- Our website: [<a href=\"https:&#x2F;&#x2F;klaralabs.com\" rel=\"nofollow\">https:&#x2F;&#x2F;klaralabs.com</a>](<a href=\"https:&#x2F;&#x2F;klaralabs.com&#x2F;\" rel=\"nofollow\">https:&#x2F;&#x2F;klaralabs.com&#x2F;</a>)","time":1738590828,"title":"Show HN: Klarity – Open-source tool to analyze uncertainty/entropy in LLM output","type":"story","url":"https://github.com/klara-research/klarity"}