LLM as a judge

A judgement set is only as good as its grades, and nobody has time to grade everything. judy puts a language model to work on that problem and on two related ones. It keeps the jobs apart, so you always know what the model touched.

The central one is the judge: judy judge has a model grade the documents your search returned that no human ever rated. That turns a half-judged set into one you can trust for semantic and hybrid search, where unjudged documents are the norm. The other commands use the same model for three more jobs. synthesize writes a first set from your documents. diagnose explains why a query ranks badly. suggest proposes a fix that judy then measures.

Use the model you already have: Anthropic, any OpenAI-compatible endpoint, or the Elastic Inference Service on the cluster you search. EIS needs no key of its own.

They answer different questions, and the model sees different things, on purpose.

Mermaid diagram

The judge sees less on purpose. It never sees the request, the scores or the ranks.

Command The question What the model sees What it produces What it changes
judy judge Is this document relevant to this query? the query, its intent, the document's title and text. Never the request, the scores or the ranks a grade for each unjudged document the scores, when LLM labels count; it never edits your set
judy synthesize What would someone type to find this document? a document queries, as a new judgement set creates a new set
judy diagnose Why does this query rank its relevant documents badly? the query, the request judy sent, the results with their grades, the relevant documents that were missing, the index mapping and settings a written diagnosis nothing
judy suggest What request would do better? the same as diagnose variant request templates, each run against the whole set nothing: variants are files next to the set

The short version:

  • The judge works on the data. It improves the measurement, so a score means something. It never sees how the engine ranked a document. The question is only "is this relevant", and an answer that knew the rank could be flattered by it.
  • The advisors work on the search. They help you improve it, so they see the request and the mapping. The question is how the engine read the query. Their answers are hypotheses, and suggest tests each one.

You can run any of them alone. The usual order is judge first, so the scores are fair, then diagnose the worst queries, then ask for a fix.

  • Nothing is sent without you asking. --dry-run on judge, diagnose and suggest says what would be sent and sends nothing. --max-calls and --max-queries cap spending.
  • LLM labels never overwrite human ones. They live in {set}.llm.yaml, and --labels human ignores them. judy review turns the ones you agree with into human ratings.
  • Proposals are measured, not trusted. suggest holds queries back from the model and reports whether a gain carries over.
  • Your configuration never changes. Advice is text and files next to the set.

See what the model sees, and what it costs for the details.

Page What is in it
Providers Anthropic, OpenAI-compatible endpoints and the Elastic Inference Service
Judging unjudged results judy judge and judy review
Writing a first set judy synthesize
Diagnose judy diagnose
Suggest judy suggest
What the model sees, and what it costs privacy, caching and spending limits