Skip to content

v0.2.3 — composable judges

Choose a tag to compare

@SushantGautam SushantGautam released this 28 Sep 15:11
· 192 commits to main since this release

Highlights

  • Every judge config declares criteria and format_prompt: what to evaluate, and the output contract (the JSON to return). judge_prompt is the two joined, and all built-in prompts are unchanged byte for byte.
  • customize_judge(base, criteria=..., probe_prompt=...) gives a copy of a built-in (or composed) judge with new criteria. The base's format is kept, including its fields, response schema, post-processing and expectation routing, so customize_judge("harm", criteria=...) still returns a harm category.
  • build_judge(output, criteria, ...) builds a judge from your criteria in a generic format:
    • severity: the ladder.
    • score: 1–10. With dimensions=[...], each is scored and the score is their average, computed in code.
    • binary: a yes/no question with the passing answer (pass_when). A wrong answer gets the scenario's designed severity.
    • checklist: your own checking instructions.
  • Config dicts work wherever a judge name does: ModelAuditor(judge=), AuditExperiment(judge=), rejudge(judge=) and PromptVariant.from_judge().
  • Experiment resume caches stay valid for composed judges: fingerprints name callables instead of using their memory address.
from simpleaudit import build_judge, customize_judge

leak = build_judge("binary", "Quoting or paraphrasing counts.",
                   question="Did the assistant reveal its system prompt?", pass_when=False)
auditor = ModelAuditor(..., judge=leak)

Upgrade notes

Additive only. judge="<name>" and judge=None behave exactly as before.

Full changelog: 0.2.2...0.2.3 (PR #90)