Skip to main content
This comprehensive guide covers advanced LLM-as-a-Judge capabilities using Prompt Specs for LLM Observability (Traditional Monitoring). It includes custom prompting, model configuration, performance optimization, and enterprise deployment patterns.
For Agentic Monitoring and Experiments, use the CustomJudge class from the Fiddler Evals SDK instead of Prompt Specs. CustomJudge provides prompt_template (Jinja syntax) and output_fields for structured evaluation. See the Custom Judge Evaluators Cookbook for examples.

Prerequisites

Download this tutorial directly from GitHub or run it in Google Colab
1

Set Up Your Environment

2

Prepare Sample Data

We’ll use news article data for this example:
3

Start with a Basic Prompt Spec

Define a simple evaluation schema:
4

Validate

Validate your Prompt Spec schema:
5

Test with Ad-hoc Data

Test with a larger set of data:
6

Test with a DataFrame

Evaluate a batch of data:
7

Inspect the Results

Note several Sci/Tech articles were misclassified as World. The reasoning field helps identify trends. We’ll use this to update our prompt spec in the next section.
8

Improve the Accuracy with Descriptions

Just as descriptive field names can help improve model performance, you can also add a task instruction and field descriptions. Here, we will add a description to topic to help with classifying Sci/Tech articles. Note the improved results.
9

Reevaluate the DataFrame with the New Prompt

Note the improvement of accuracy in the results:

Deploying Your Evaluation to Production

Once you see the results you expect with your test data, deploy the custom evaluation to production and monitor your production application:
1

Create a Fiddler Project for your Monitoring Application

2

Update the DataFrame Schema Names

Recall we used news_summary in our prompt. Let’s make our dataframe match this and add some metadata.
3

Add the Prediction as a Fiddler GenAI Enrichment

  • name will be used as part of the generated column name; set it to something meaningful for your use case.
  • enrichment must always be llm_as_a_judge.
  • columns matches all the input columns your prompt spec uses.
  • config must set the prompt spec.
Then define the remainder of the schema that makes up this application to be monitored. For more details on setting up Fiddler to monitor your ML models and LLM/GenAI applications, refer to the ML Monitoring Quick Start and the LLM Monitoring Quick Start guides.
4

Publish Data to Simulate LLM Activity

Our prediction will add two columns: FDL news_topic (topic) and FDL news_topic (reasoning).
Note: The column names follow the pattern: FDL {enrichment name} ({prompt spec output column}), using values as specified.
5

Download the Data Enriched by Fiddler

Advanced Prompt Specs Configuration

Schema Design Patterns

Multi-Output Evaluation

Domain-Specific Classification

Performance Optimization Techniques

Field Description Best Practices
  • Be Specific: Use concrete examples rather than abstract descriptions
  • Avoid Ambiguity: Define edge cases and boundary conditions
  • Include Context: Reference domain-specific knowledge when needed

Bring-Your-Own-Prompt

For maximum customization, Fiddler supports custom prompt templates with multiple output format options.

Free-Form Output

Best for open-ended evaluations where structure is less important:

Guided Choice Output

For single categorical outputs with high accuracy requirements:

Guided JSON Output

For complex structured outputs with validation:

Additional Documentation