Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

diffscore

Latest version: v0.2.0

Overview

Last scanned
1 Dec 2026
Published
1 Dec 2026
PyPI package Publisher: tejhagargi9
2 Versions

Scan summary

diffscore was last scanned on 1 Dec 2026 at version 0.2.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 2 versions, all published on 1 Dec 2026.
  • Findings: No rules fired in version 0.2.0.

Versions

2 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.2.0 LATEST 1 Dec 2026 No rules fired
0.1.0 1 Dec 2026 No rules fired

No rules fired in 0.2.0

Findings

Findings for v0.2.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.2.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Pre-deploy regression tests for LLM prompts, with scoring you can verify.

diffscore.space · Python 3.12 · FastAPI · Next.js 15

Status: pre-alpha. Phases 0–5 are built: the landing page, a CLI that runs a suite with cached model calls, a diff with a p-value that gates CI, an LLM judge with calibration tooling, and an HTTP API, queue worker and web screens. Not deployed yet, and the judge's kappa is not published: it needs a hand-labelled gold set first. See the roadmap.


The problem

You ship an LLM feature. You tweak the system prompt, swap a model, change the chunk size — and you verify it by eyeballing three examples in a playground. You have no idea what broke everywhere else.

Diffscore answers one question: did my prompt change make this better or worse?

The workflow

  1. Define a suite — inputs plus what good looks like, as a CSV upload or a YAML file.
  2. Run it against a prompt version and a model.
  3. Read the diff against the previous run — which cases improved, which regressed, and why.

If you can do those three steps in under five minutes with your own API key, the product works.

Not in v1: no prompt playground, no production request tracing, no fine-tuning, no team accounts.

Quick start

Python 3.12 or newer, and an API key for any model provider (Gemini has a free tier).

pip install diffscore
diffscore init                     # writes evals/example.yaml, its prompt, and a .env
# put your key in .env, e.g. GEMINI_API_KEY=...
diffscore run evals/example.yaml   # the first run becomes the baseline

Now edit evals/prompts/example.md the way you'd really change a prompt, and run it again. Diffscore re-asks only what changed (everything else comes from its cache) and tells you whether the change made things better, worse, or made no real difference:

diffscore run evals/example.yaml
diffscore show <run-id> --failed --outputs   # what failed, with the model's answers
diffscore runs                               # history

No database to set up: results and the response cache live in .diffscore/diffscore.db beside your project. Add .diffscore/ and .env to your .gitignore. --rpm 14 (or MODEL_RPM=14) keeps under Gemini's free-tier limit of 15 requests a minute, and --model swaps the model.

Providers. Built in, with nothing extra to install: gemini/…, openai/… (or bare gpt-…), anthropic/… (or bare claude-…), groq/…, openrouter/… (which reaches most other models) and ollama/… for local models. Set the matching key in .env, e.g. OPENAI_API_KEY. For the 100+ other providers LiteLLM supports, install pip install "diffscore[litellm]". Costs come from LiteLLM's public price list, fetched once a week into .diffscore/.

The install is small on purpose (about 7 MB): no numpy, scipy or LiteLLM by default. The statistics (McNemar, bootstrap, Cohen's kappa) are plain Python, tested against statsmodels and scikit-learn.

A suite is a YAML file: a prompt, a model, and cases with graders. diffscore validate <file> checks one without running it. Graders: equals, contains, not_contains, regex, json_schema, max_latency_ms, max_cost, and judge (an LLM with a rubric; see below).

How it's put together

Grading is a separate stage from generation, so fixing a rubric costs no model calls.

  Web UI  ──►  API (FastAPI)  ──►  Workers (Redis/RQ)  ◄──►  Model providers
                    │                     │                (built-in client)
                    │                     ▼
                    │                 Graders — deterministic, then LLM judge
                    │                     │
                    ▼                     ▼
               Postgres  ◄──  Aggregator — diff vs baseline, p-value

Four decisions carry the design:

  • One job per case, not per run. A 500-case suite that dies at case 400 resumes from 400 — and you get a real progress bar.
  • Generation and grading are separate rows. Model calls are expensive, grader calls are cheap, so stored outputs can be re-graded with a new rubric for free.
  • Cache keyed on content hash — hash(prompt + input + model + params). Reruns cost nothing.
  • Graders are plugins. A uniform score / verdict / reason interface means adding one is a single file.

The interesting work is the judge layer: measuring the judge against your own labels (Cohen's kappa against a gold set), controlling for position, verbosity, self-preference and version-leak bias, and never calling a two-case difference a regression without a p-value.

Stack

Layer Pick
API FastAPI + Pydantic v2, Python 3.12
Database PostgreSQL 16 (JSONB), SQLAlchemy 2.0 + Alembic
Queue Redis + RQ
Model calls Built-in HTTPS client (6 providers); LiteLLM optional for the rest
Statistics Plain Python, cross-checked against statsmodels and scikit-learn in tests
Web Next.js 15 App Router, TypeScript, Tailwind + shadcn/ui, TanStack Query
Local dev Docker Compose — api, worker, postgres, redis
Hosting Vercel (web) + Fly.io or a Hetzner VPS (api, worker)

Deliberately absent: Kafka, Kubernetes, GraphQL, a microservice split, a separate vector database.

Roadmap

~71 hours across seven phases, each with a gate to pass.

Phase Hours
0 The face 8
1 Foundations 3
2 Core loop 15
3 The verdict 12
4 Judge and calibration ✦ 14
5 Make it visible 11
6 Ship it 8

Phase 4 is the one that matters.

Docs

Using it

Did my change make it better or worse?

The first completed run of a suite becomes its baseline. Every later diffscore run is diffed against it, and the verdict comes first:

 regression on 7 cases (p = 0.02)
run #7 (baseline) -> run #10  |  prompt changed  |  support
7 regressed, 0 improved, 43 unchanged  |  McNemar exact, alpha 0.05
mean score change -0.047 (95% CI -0.080 to -0.020)

That is a real run: the shipping section was deleted from the example prompt. A tweak that fixes one case and breaks another reports no significant change (p = 1.00) instead — two flipped cases are noise, not a regression. The p-value is McNemar's test on the paired pass/fail flips (exact below 25 flips); the interval is a paired bootstrap of the mean score.

uv run diffscore diff 10            # run 10 vs its suite's baseline
uv run diffscore diff 7 10 --all    # any two runs, including unchanged cases
uv run diffscore baseline 10        # promote a run to baseline
uv run diffscore run suite.yaml --baseline previous   # diff vs the last run instead

diffscore run and diffscore diff exit 1 only on a statistically significant regression, so they can gate a pull request.

Grading what string checks can't: the judge

For faithfulness, helpfulness or tone, add an LLM judge with a rubric. It grades each answer against every criterion and must quote the answer as evidence. It sees the customer's input, the answer and your reference material, never the prompt under test or which model wrote the answer.

graders:
  - judge:
      context_file: reference/policy.md   # ground truth the judge may consult
      rubric:
        - name: accurate
          description: Every fact agrees with the reference policy.
        - name: tone
          description: Polite and calm; acknowledges an upset customer.

The judge runs on JUDGE_MODEL (default gemini/gemini-3.1-flash-lite, which fits Gemini's free tier; a stronger judge is better) and refuses to grade answers from its own model. A judge that can't produce a verdict marks the case as an error, not a failure, so it never shows up as a regression.

Can I trust the judge?

Not until you've measured it. Label some outputs yourself, then compare:

uv run diffscore label 15          # pass/fail in the terminal; the judge's verdict stays hidden
uv run diffscore calibrate examples/support.yaml
uv run diffscore calibrate examples/support.yaml --disagreements   # which answers you and the judge disagree on
judge (version 1-<rubric hash>, judged by <judge model>)
 kappa <κ>  trustworthy | below 0.6: rewrite the rubric   (raw agreement <%>)
bias checks
  verbosity        r = <r> (score vs length, flag > 0.3)
  self-preference  judge <model> vs outputs from <models>
  position         <k>/<n> pairwise verdicts survive swapping the order
  variance         <k>/<n> verdicts flipped across 3 repeats
  evidence         <k>/<n> quotes found verbatim in the output

Cohen's kappa below 0.6 means the judge is close to guessing: rewrite the rubric and calibrate again. Calibration re-judges your labelled outputs with the rubric as the file defines it now, so that loop never regenerates an answer. Labels belong to outputs, not runs, so a label made once covers every later run that reuses that answer. Around 50–100 labels make kappa stable.

The web app

Everything the CLI does is also an HTTP API, and the site has screens for it: a runs list with live progress, a run page with every case, the judge's evidence and its trust status, and a diff page that leads with the verdict.

docker compose --profile app up -d     # + API on :8000 and the queue worker
cd web && npm install && npm run dev   # http://localhost:3000/runs

A run started from the web is queued as one job per case, so a crashed worker resumes where it stopped and the progress bar is real. Without the API_KEY, visitors can read public projects, run a sample suite, or run their own suite with their own provider key. That key is encrypted with FERNET_KEY, used for that run only and wiped when it finishes. Visitor runs are rate limited per IP, capped at MAX_CASES_ANONYMOUS cases and limited to safe model params. Owner keys for a project are stored encrypted and never returned. Everything key-shaped is scrubbed from logs and Sentry events.

API docs are served at http://localhost:8000/docs.

In CI

Run the suite on the base branch's prompt, then on the pull request's, and diff the two. The job fails only when the regression is significant.

# .github/workflows/prompt-regression.yml
name: prompt regression
on:
  pull_request:
    paths: ["prompts/**", "evals/**"]

jobs:
  diffscore:
    runs-on: ubuntu-latest
    env:
      GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
      MODEL_RPM: "14"
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }
      - uses: actions/setup-python@v5
        with: { python-version: "3.12" }
      - run: pip install diffscore
      - name: Baseline = the base branch's prompt
        run: |
          git worktree add /tmp/base "origin/${{ github.base_ref }}"
          diffscore run /tmp/base/evals/support.yaml --no-diff --quiet
      - name: Diff the pull request against it
        run: diffscore run evals/support.yaml --baseline previous

The runner's SQLite file starts empty, so both runs make real model calls; cache .diffscore/ between jobs with actions/cache to make repeats free.

Developing Diffscore

Needs uv and Docker.

uv sync --all-extras
uv run pytest && uv run ruff check . && uv run mypy
docker compose --profile app up -d     # Postgres, Redis, the API and the worker
uv run alembic revision --autogenerate -m "..."   # after changing a model

The CLI defaults to SQLite; set DATABASE_URL to use Postgres (pip install "diffscore[postgres]"). The API and worker need pip install "diffscore[server]". Example suites live in examples/, and the website in web/.

License

MIT. Use it, fork it, ship it in a closed product — no conditions beyond keeping the copyright notice.

The name and the brand assets are not covered by that licence; see TRADEMARK.md. Short version: use the mark to refer to this project freely, give a fork its own name.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases diffscore

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229