Prerequisites
- Fiddler account with API access
- LLM credential configured in Settings > LLM Gateway
pip install fiddler-evals pandas- Familiarity with RAG Evaluation Fundamentals recommended
1
Set Up the Experiment Infrastructure
Experiments are organized as: Project > Application > Dataset > Experiment
Replace
URL, TOKEN, and credential names with your Fiddler account details. Find your credentials in Settings > Access Tokens and Settings > LLM Gateway.2
Create Test Cases with Golden Labels
Include
expected_quality labels so you can validate whether evaluators correctly identify good and bad responses:3
Insert Data into the Dataset
The idempotency check (
if not list(dataset.get_items())) prevents duplicate inserts if you re-run the notebook. Remove this check if you want to refresh the dataset.4
Run the Experiment
Define a task function that returns the RAG response, then run the experiment with all three RAG Health evaluators:Expected output:
Understanding
score_fn_kwargs_mapping: This dict maps evaluator parameter names to data sources. Use a lambda to extract values from dataset inputs (x['inputs']['...']), or a string to reference a key from the task function’s return dict.5
Validate Against Golden Labels
Check whether the evaluators correctly identified quality issues by comparing their scores against your expected labels:Expected output:
6
View Results
Comparing Pipeline Configurations
To compare different RAG configurations, run multiple experiments against the same dataset:Next Steps
- RAG Evaluation Fundamentals — Direct
.score()API for quick iteration - Building Custom Judge Evaluators — Add domain-specific evaluation criteria
- RAG Health Metrics Tutorial — Step-by-step tutorial
Source notebook: Fiddler Cookbook: RAG Experiments at Scale