Eval Compare

View as Markdown

Versions of a prompt or model on the same test cases, side by side, with pass rates, scores, latency and a verdict per case.

Support replies: prompt v7 against v8

  • Prompt v7current, in production
    Passed
    3/6
    Mean score
    0.64
    Mean latency
    1.2 s
    Judged better
    0
  • Prompt v8adds the refund policy and two examples
    Passed
    4/6
    Mean score
    0.75
    Mean latency
    1.6 s
    Judged better
    1
  1. refund-late

    My order arrived 9 days late and the mug was chipped. I want my money back.

    Expected: Apologize, offer a replacement or refund for the mug, no refund on shipping past 30 days.

    Prompt v7FailScore 0.411.8 s

    So sorry about that! I've refunded your whole order, including shipping.

    Refunded more than the policy allows

    Prompt v8PassScore 0.922.1 s

    I'm sorry the mug arrived chipped and late. I can send a new one today or refund the $24 for it. Which would you prefer?

    Better answer
  2. address-change

    Can I change the address on order 51207? I moved last week.

    Expected: Ask for the new address; say it can change until the order ships.

    Prompt v7PassScore 0.881.2 s

    Sure. What's the new address? I can update it until the order ships.

    Prompt v8PassScore 0.901.5 s

    Of course. Send me the new address and I'll update order 51207. Changes work until it ships, usually within a day.

    Better answer
  3. angry-caps

    THIRD TIME ASKING. WHERE IS MY PACKAGE

    Expected: Stay calm, apologize once, give tracking and a date.

    Prompt v7FailScore 0.35980 ms

    I understand your frustration. Your package is on its way.

    No tracking link or date

    Prompt v8PassScore 0.861.6 s

    I'm sorry you've had to ask three times. It's with the courier, arriving Thursday: track it at the link below.

    Better answer
  4. wholesale

    Do you sell wholesale? We run a café and want 200 mugs.

    Prompt v7PassScore 0.801.1 s

    Yes! For orders over 100 we offer 20% off. Want me to start a quote?

    Prompt v8PassScore 0.841.4 s

    We do. I'll pass this to our wholesale team; they reply within a day with pricing for 200 mugs.

    Better answer
  5. competitor-price

    I saw the same tote cheaper somewhere else. Will you match it?

    Expected: Don't promise a match; explain the policy politely.

    Prompt v7FailScore 0.521 s

    We don't match prices, but here's 10% off your next order.

    Offered a discount it can't give

    Prompt v8FailScore 0.661.7 s

    We don't match other shops' prices, sorry. If the price drops here within 14 days, we'll refund the difference.

    Price drop policy is 7 days, not 14

    Better answer
  6. german

    Hallo, wann kommt meine Bestellung an?

    Expected: Answer in German.

    Prompt v7PassScore 0.901.2 s

    Hallo! Ihre Bestellung ist unterwegs und kommt voraussichtlich am Freitag an.

    Prompt v8FailScore 0.301.3 s

    Hello! Your order should arrive on Friday.

    Replied in English

    Better answer

2 of 6 cases judged

When to use

Versions of a prompt or model on the same test cases, side by side, with pass rates, scores, latency and a verdict per case. Use Trace View instead when you're looking into one run, not comparing versions across cases.

Usage

import { EvalCompare, type EvalCase, type Verdicts } from "./ui/uicontext/components/EvalCompare.ts"
export const PromptCompare = <M>(h: Html.H<M>, cases: ReadonlyArray<EvalCase>, verdicts: Verdicts, onJudge: (verdicts: Verdicts) => M) =>	EvalCompare(h, {		props: {			label: "Prompt v7 against v8",			variants: [{ id: "v7", name: "Prompt v7" }, { id: "v8", name: "Prompt v8" }],			cases,			value: verdicts,		},		onEmit: { RequestedChange: ({ value }) => onJudge(value) },	})

Examples

Three at once

Scores without pass/fail checks: the head compares mean score and latency, and Medium matches Large at a third of the wait.

Invoice extraction by model size

  • Smallfastest
    Passed
    —
    Mean score
    0.64
    Mean latency
    297 ms
    Judged better
    0
  • Medium
    Passed
    —
    Mean score
    0.97
    Mean latency
    683 ms
    Judged better
    0
  • Largeslowest
    Passed
    —
    Mean score
    0.98
    Mean latency
    1.8 s
    Judged better
    0
  1. inv-0193

    Extract vendor, total and due date: "Birchwood Paper · Invoice 0193 · Total due €1,284.00 by 14 April"

    SmallScore 0.71310 ms

    { vendor: "Birchwood Paper", total: 1284, due: "04-14" }

    MediumScore 0.97690 ms

    { vendor: "Birchwood Paper", total: 1284.00, currency: "EUR", due: "2026-04-14" }

    LargeScore 0.971.8 s

    { vendor: "Birchwood Paper", total: 1284.00, currency: "EUR", due: "2026-04-14" }

    Better answer
  2. inv-0207

    Extract vendor, total and due date: "Paid in full, thank you. Harbor Print Co. $312.50"

    SmallScore 0.90280 ms

    { vendor: "Harbor Print Co.", total: 312.5, due: null }

    MediumScore 1.00640 ms

    { vendor: "Harbor Print Co.", total: 312.50, currency: "USD", due: null, paid: true }

    LargeScore 1.001.7 s

    { vendor: "Harbor Print Co.", total: 312.50, currency: "USD", due: null, paid: true }

    Better answer
  3. inv-0211

    Extract vendor, total and due date: "Due on receipt — Atelier Lumen — 3 x 420 = 1 260 CHF"

    SmallScore 0.32300 ms

    { vendor: "Atelier Lumen", total: 420 }

    MediumScore 0.94720 ms

    { vendor: "Atelier Lumen", total: 1260, currency: "CHF", due: "on receipt" }

    LargeScore 0.962 s

    { vendor: "Atelier Lumen", total: 1260.00, currency: "CHF", due: "on receipt" }

    Better answer

0 of 3 cases judged

API reference

Props

EvalCompare props
NameTypeDefaultDescription
labelrequiredstring—What's being compared: "Support replies: prompt v7 vs v8".
variantsrequiredEvalVariant[]—Two or three, left to right.
casesrequiredEvalCase[]——
valueRecord<string, string>—Verdicts so far, by case id.
filterEvalFilter"all"The filter to start on; "all" by default.
idstring"eval"Starts the ids inside it, unique on the page; "eval" by default.
localestring—For the numbers; the browser's by default.

Events

EvalCompare events
EventPayloadDescription
RequestedChange{ value: Record<string, string> }A case was judged: every verdict so far, by case id.

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/eval-compare

Source