klarity  by klara-research

AI toolkit for model explainability, error mitigation, and multi-modal support

created 6 months ago
398 stars

Top 73.7% on sourcepulse

GitHubView on GitHub
Project Summary

Klarity is a generative AI toolkit designed for inspecting and debugging AI decision-making processes. It targets AI developers and researchers seeking to understand model behavior, mitigate errors, and improve model reliability through automated explainability, uncertainty analysis, and multi-modal support. The toolkit offers structured insights into model confidence, reasoning patterns, and visual attention, enabling more robust AI systems.

How It Works

Klarity employs a multi-faceted approach to AI explainability. It quantifies model confidence using raw entropy and semantic similarity metrics, analyzes step-by-step reasoning patterns extracted from model outputs, and visualizes visual attention in Vision-Language Models (VLMs). These analyses are synthesized into structured JSON outputs and AI-powered reports, providing actionable insights for debugging and improvement. The core advantage lies in its integrated approach, combining uncertainty, reasoning, and visual attention for a holistic view of model decision-making.

Quick Start & Requirements

  • Install via pip: pip install git+https://github.com/klara-research/klarity.git
  • Requires Hugging Face Transformers, vLLM, or Together AI API for analysis.
  • Specific models require GPU acceleration (e.g., LlavaOnevisionForConditionalGeneration, DeepSeek-R1-Distill-Qwen-7B).
  • API keys are needed for certain insight models (e.g., Together AI).
  • Official documentation and examples are available on GitHub.

Highlighted Details

  • Achieves 80%+ accuracy in hallucination detection using entropy + judge LLM metrics.
  • Supports integration for VLM and visual attention monitoring.
  • Enables analysis of reasoning model CoTs, entropy, and RL dataset improvement.
  • Provides detailed JSON outputs for VLM, Reasoning, and Entropy analyses.

Maintenance & Community

  • Active development with recent updates noted in the README.
  • Community support available via Discord.
  • Bug reporting and feature requests via GitHub Issues.

Licensing & Compatibility

  • Licensed under the Apache 2.0 License.
  • Permissive license suitable for commercial use and integration into closed-source projects.

Limitations & Caveats

Some analysis models, like Qwen2.5-0.5B-Instruct, have low JSON reliability and may require structured prompting. Other models offer moderate reliability. The effectiveness of the "insight_model" for generating structured analysis is dependent on the chosen model's capabilities.

Health Check
Last commit

3 weeks ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
9 stars in the last 90 days

Explore Similar Projects

Starred by Anastasios Angelopoulos Anastasios Angelopoulos(Cofounder of LMArena), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
3 more.

transformer-debugger by openai

0.1%
4k
Tool for language model behavior investigation
created 1 year ago
updated 1 year ago
Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind), and
1 more.

alibi by SeldonIO

0.1%
3k
Python library for ML model inspection and interpretation
created 6 years ago
updated 1 month ago
Feedback? Help us improve.