Skip to main content
Create domain-specific evaluators using CustomJudge to encode business rules, quality criteria, or classification tasks that built-in evaluators don’t cover. Use this cookbook when: You need evaluation criteria specific to your domain, such as topic classification, brand voice matching, compliance checking, or custom quality rubrics. Time to complete: ~20 minutes
Prerequisites
  • Fiddler account with API access
  • LLM credential configured in Settings > LLM Gateway
  • pip install fiddler-evals pandas

1

Connect to Fiddler

Replace URL, TOKEN, and credential names with your Fiddler account details. Find your credentials in Settings > Access Tokens and Settings > LLM Gateway.
2

Prepare Test Data

This example classifies news summaries into topics — Sci/Tech, Sports, Business, or World:
3

Create a CustomJudge

Define your evaluation criteria using a prompt_template with {{ placeholder }} markers and output_fields that define the structured response:
How It Works
  • prompt_template: Your evaluation prompt with {{ placeholder }} markers (Jinja syntax). Placeholders are filled from the inputs dict passed to .score().
  • output_fields: Schema defining the expected outputs. Each field specifies a type (string, boolean, integer, number) and optional choices or description.
4

Run Evaluator

Expected output:
The simple prompt often confuses tech company acquisitions (like the Microsoft-Activision deal) with Business news. The next step shows how to fix this with clearer topic guidelines.
5

Improve the Prompt

Add clearer topic guidelines and constrain outputs with choices:
Key improvements:
  • Explicit guidelines for each topic eliminate ambiguity
  • choices constrains the LLM output to valid categories only
Compare Results
Expected output:

Output Field Types

CustomJudge supports four output field types:

Using choices for Categorical Output

Using description to Guide the LLM


Real-World Examples

Brand Voice Match

Evaluate whether generated content adheres to brand guidelines:
Expected output:

Compliance Checking

Verify responses meet regulatory requirements:

Next Steps


Source notebook: Fiddler Cookbook: Custom Judge Evaluators