npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@reaatech/llm-judge-calibration

v0.1.1

Published

Calibration metrics, runner, datasets, and drift detection for LLM Judge Toolkit

Readme

@reaatech/llm-judge-calibration

npm version License: MIT CI

Status: Pre-1.0 — APIs may change in minor versions. Pin to a specific version in production.

Calibration suite for measuring LLM judge accuracy against human-labeled gold-standard datasets. Computes Cohen's kappa, confusion matrices, F1 scores, and detects calibration drift over time.

Installation

npm install @reaatech/llm-judge-calibration
# or
pnpm add @reaatech/llm-judge-calibration

Feature Overview

  • Cohen's kappa inter-rater reliability coefficient
  • Confusion matrix with precision/recall/F1 computation
  • Bundled gold-standard datasets for 5 evaluation criteria
  • CalibrationRunner for automated batch evaluation
  • DriftDetector to detect performance regression
  • Concurrency-controlled parallel execution

Quick Start

import { CalibrationRunner } from '@reaatech/llm-judge-calibration';
import { DatasetManager } from '@reaatech/llm-judge-calibration';

const runner = new CalibrationRunner({
  engine: judgmentEngine,
  criteria: 'faithfulness',
  concurrency: 5,
  onProgress: (done, total) => console.log(`${done}/${total}`),
});

const { report, judgments } = await runner.run();
console.log(report.cohensKappa, report.accuracy);
import { CalibrationMetrics } from '@reaatech/llm-judge-calibration';

const report = CalibrationMetrics.generateReport(judgments, humanLabels);
console.log(report);
// { cohensKappa: 0.78, accuracy: 0.91, precision: 0.88, recall: 0.85, f1Score: 0.86, ... }

API Reference

CalibrationMetrics

Static class for computing calibration statistics.

| Method | Description | |--------|-------------| | cohensKappa(judgments, humanLabels) | Cohen's kappa inter-rater reliability coefficient | | confusionMatrix(judgments, humanLabels, thresholds?) | 3-class confusion matrix | | accuracy(confusionMatrix) | Overall accuracy from confusion matrix | | precisionRecallF1(confusionMatrix, positiveClass?) | Precision, recall, and F1 score | | generateReport(judgments, humanLabels) | Full CalibrationReport with all metrics |

CalibrationRunner

| Constructor Option | Type | Description | |-------------------|------|-------------| | engine | JudgmentEngine | Engine to evaluate examples | | criteria | EvaluationCriteria | Criteria to calibrate against | | concurrency | number | Parallel evaluations (default 3) | | onProgress | (completed, total) => void | Progress callback |

| Method | Description | |--------|-------------| | run() | Execute calibration and return CalibrationRunnerResult |

DatasetManager

| Constructor | Description | |-------------|-------------| | new DatasetManager(datasetsDir?) | Optional custom directory for calibration JSON files |

| Method | Description | |--------|-------------| | load(criteria) | Load dataset JSON (faithfulness.json, etc.) | | loadAll() | Load all criteria datasets as a Map | | getStats(dataset) | Summary stats (total, good/bad/borderline, average label) |

DriftDetector

| Constructor | Description | |-------------|-------------| | new DriftDetector(kappaThreshold?, accuracyThreshold?) | Thresholds for drift detection (default 0.1 each) |

| Method | Description | |--------|-------------| | detect(baseline, current) | Compare two reports, return DriftReport |

Key Types

CalibrationReport

| Field | Type | Description | |-------|------|-------------| | cohensKappa | number | Inter-rater reliability coefficient | | accuracy | number | Overall accuracy | | precision | number | Positive class precision | | recall | number | Positive class recall | | f1Score | number | Harmonic mean of precision and recall | | confusionMatrix | ConfusionMatrix | 3-class confusion matrix |

CalibrationDataset

| Field | Type | Description | |-------|------|-------------| | criteria | EvaluationCriteria | Evaluation criteria this dataset targets | | version | string | Dataset version | | examples | CalibrationExample[] | Array of labeled examples |

DriftReport

| Field | Type | Description | |-------|------|-------------| | hasDrift | boolean | Whether significant drift was detected | | kappaDelta | number | Change in Cohen's kappa | | accuracyDelta | number | Change in accuracy | | recommendation | string | Actionable recommendation |

Related Packages

License

MIT