Skip to main content
Build evaluators that analyze images and documents alongside text using CustomJudge with vision-capable models. This cookbook covers common document processing pipeline monitoring scenarios. Use this cookbook when: You need to verify that a GenAI application correctly extracted, summarized, or described content from images or documents. Time to complete: ~25 minutes
Prerequisites
  • Fiddler account with API access
  • Vision-capable model configured in LLM Gateway:
    • Fiddler-hosted: fiddler/ministral3-8b (available by default)
    • Third-party: Configure provider credentials (OpenAI, Anthropic, etc.)
  • pip install fiddler-evals requests
Tip: When using Fiddler-hosted models, use the Test Connection button on the LLM Gateway page to warm up the model before running evaluations. This reduces cold-start latency on your first requests.
This capability is currently in private preview and is not yet available to all customers. Contact your Fiddler Customer Success Manager to request access.

Example 1: Document Extraction Verification

This example verifies that data extracted from a table matches the source document.
1

Connect to Fiddler and Load Helper

Image Input Format — Images and PDFs must be passed as a list containing a structured object with media_type, encoding, and data fields. Passing a data URL string directly will cause errors. The load_document helper returns these components separately so you can construct the correct format.
Base64 Payload Size — Base64 representation adds ~33% to the original file size. A 20KB image becomes ~27KB in the API request. Keep this overhead in mind when working near size limits.
2

Create the Extraction Verification Judge

This evaluator compares extracted fields against the source document:
3

Evaluate the Extraction

Load a sample document and verify the extracted data:Text Statistics metrics table showing Textstat, Evaluate, Sentiment, and Token Count evaluators with their respective output typesSample document: Text Statistics evaluators table

Example 2: Document Summarization Faithfulness

This example verifies that a summary accurately represents the source document. Source document: Fiddler Platform Release 26.7 notes (PDF)
1

Create the Summarization Judge

2

Evaluate the Summary

Example Output:
Scaling Up — For batch evaluation across datasets, see Running RAG Experiments at Scale which demonstrates the evaluate() function for efficient processing.

Tips

Stay Within Size Limits

Optimize Large Documents

  • Compress images before encoding — reduce resolution if full quality isn’t needed
  • Split large PDFs — evaluate sections separately if exceeding page limits
  • Use appropriate DPI — higher DPI means larger file sizes but better text recognition

Use Multiple Images

Fiddler Ministral supports up to 8 images per evaluation. To evaluate content with multiple images, add a separate template variable for each image in your prompt template (e.g., {{ image_1 }}, {{ image_2 }}) and pass each as a structured input list following the same format as Example 1’s document field.

Next Steps