Back to directory

llm-eval-layer

A pure-Python decision engine that scores LLM responses for attribution, specificity, relevance and context quality to detect hallucinations and output an accept, review or reject verdict.

llm-eval-layer

llm-eval-layer is a decision engine for LLM responses that goes beyond retrieving documents and calling a model: it decides whether an output should be served, retried or regenerated, and explains why. It splits faithfulness into attribution (grounding) and specificity (concreteness) so it can tell a hallucination, which pairs high specificity with low attribution, from a merely weak answer.

Separate modules score relevance through semantic similarity, best-sentence match and token overlap, and context precision and recall against retrieved documents, with an optional paraphrase-stability consistency check. A pipeline module runs an eight-gate decision with a confidence score, a regression module stores baselines and blocks deployment when quality drops, and an optional OpenAI-backed judge only fires for scores in an uncertain 0.45-0.65 zone, at zero API cost in the default mode.

Built with pure Python and PyYAML, with optional sentence-transformers for semantic scoring, falling back to TF-IDF vectors when it is absent. MIT licensed.

More in AI evals

See all 269
  • Provenance gate

    github.com

    A deterministic authorization gateway that sits between an AI agent and its tools, tracing where each parameter of a side-effect call came from, and blocking the call or asking a human when the source does not check out.

  • JevBench

    benchmarkheaven.com

    A reproducible benchmark from Benchmark Heaven that ranks Jev-class typed decision models on intelligence, calibration, speed, and cost, with a published harness, scoring rules, and results.

  • A co-evolutionary adversarial red-teaming tool for AI agents that uses quality-diversity evolutionary search to autonomously breed edge-case scenarios, testing whether an agent with tool access can be made to hallucinate, deadlock or leak funds.