Are you sure you want to delete this access key?
This example demonstrates the max-score
assertion type for objective output selection based on aggregated scores from other assertions.
The max-score
assertion provides a deterministic way to select the best output from multiple providers by:
select-best
- type: max-score
value:
method: average # 'average' (default) or 'sum'
weights:
python: 3 # Weight for Python code correctness tests
llm-rubric: 1 # Weight for LLM-evaluated quality rubrics
javascript: 2 # Weight for JavaScript tests
contains: 0.5 # Weight for simple string matching
threshold: 0.7 # Optional minimum score threshold
average
(default): Weighted average of assertion scoressum
: Weighted sum of assertion scores# Run the main example (requires API keys for OpenAI/Anthropic)
npx promptfoo@latest eval
Given three outputs with these assertion results:
With weights: python=3, llm-rubric=1
Use max-score
when:
Use select-best
when:
Press p or to see the previous file or, n or to see the next file
Browsing data directories saved to S3 is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with AWS S3!
Are you sure you want to delete this access key?
Browsing data directories saved to Google Cloud Storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with Google Cloud Storage!
Are you sure you want to delete this access key?
Browsing data directories saved to Azure Cloud Storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with Azure Cloud Storage!
Are you sure you want to delete this access key?
Browsing data directories saved to S3 compatible storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with your S3 compatible storage!
Are you sure you want to delete this access key?