MLflow Helper¶
High-level MLflow entry point that chains the three layers of the ragpill pipeline. For direct access to individual layers, see Execution, Evaluation, and Upload.
Recommendation
Create dedicated MLflow experiments for evaluations. Don't mix with production traces.
evaluate_testset_with_mlflow¶
ragpill.evaluate_testset_with_mlflow
async
¶
evaluate_testset_with_mlflow(testset, task=None, task_factory=None, mlflow_settings=None, model_params=None)
Run the full evaluation pipeline against an MLflow server.
Chains the three layers of the refactored architecture:
- :func:
~ragpill.execution.execute_datasetruns the task against every case and captures traces directly to the configured MLflow server. - :func:
~ragpill.evaluation.evaluate_resultsruns every evaluator against the captured outputs. - :func:
~ragpill.upload.upload_to_mlflowpersists aggregated results (tables, metrics, assessments) to the MLflow run created by step 1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
testset
|
Dataset[Any, Any, CaseMetadataT]
|
The dataset to evaluate. |
required |
task
|
TaskType | None
|
The task callable. Mutually exclusive with |
None
|
task_factory
|
Callable[[], TaskType] | None
|
A zero-arg callable returning a fresh task instance per
run. Mutually exclusive with |
None
|
mlflow_settings
|
MLFlowSettings | None
|
MLflow configuration. Falls back to environment vars. |
None
|
model_params
|
dict[str, str] | None
|
Optional model parameters to log for reproducibility. |
None
|
Returns:
| Type | Description |
|---|---|
EvaluationOutput
|
class: |
EvaluationOutput
|
DataFrames and |
Raises:
| Type | Description |
|---|---|
ValueError
|
If both or neither of |
Example
Source code in src/ragpill/mlflow_helper.py
See Also¶
- Layered Architecture Guide - When to use the combined entry point vs. the individual layers.
- Execution Layer -
execute_dataset - Evaluation Layer -
evaluate_results - Upload Layer -
upload_to_mlflow - Result Types -
EvaluationOutput,CaseResult,RunResult,AggregatedResult - MLflow Documentation
- Repeated Runs Guide - Multi-run evaluation with aggregation
- Task Factory How-To - Stateful tasks with repeat