High severity beginner · Fix: 2-5 min

EvaluationConfigError

promptfoo.errors.EvaluationConfigError

What this error means
Promptfoo throws an EvaluationConfigError when the evaluation configuration is invalid or missing required fields.

Stack trace

traceback
promptfoo.errors.EvaluationConfigError: Invalid evaluation config: missing or malformed fields
  File "/app/eval_runner.py", line 42, in run_evaluation
    evaluation = promptfoo.evaluate(config)
  File "/usr/local/lib/python3.10/site-packages/promptfoo/__init__.py", line 120, in evaluate
    raise EvaluationConfigError("Invalid evaluation config: missing or malformed fields")
QUICK FIX
Validate and correct your evaluation config file syntax and required fields before running promptfoo.evaluate().

Why it happens

Promptfoo requires a well-formed evaluation configuration specifying prompts, metrics, and models. This error occurs when the config file is missing required keys, has syntax errors, or uses unsupported parameter values. The evaluation cannot proceed without a valid config.

Detection

Validate your evaluation config schema before running promptfoo.evaluate(), and log config loading errors to catch issues early.

Causes & fixes

1

Missing required fields like 'prompts' or 'metrics' in the evaluation config

✓ Fix

Add all required fields to the config file according to promptfoo's schema documentation.

2

Syntax errors or invalid YAML/JSON formatting in the config file

✓ Fix

Use a YAML/JSON linter or parser to validate the config file syntax before running evaluations.

3

Using unsupported or misspelled keys in the config

✓ Fix

Check the promptfoo config reference and correct any invalid or misspelled keys.

4

Config references models or metrics not installed or registered

✓ Fix

Ensure all referenced models and metrics are installed and properly registered in your environment.

Code: broken vs fixed

Broken - triggers the error
python
import promptfoo

config = {
    # Missing 'prompts' key
    "metrics": ["accuracy"]
}

# This line triggers EvaluationConfigError
result = promptfoo.evaluate(config)
Fixed - works correctly
python
import os
import promptfoo

config = {
    "prompts": ["What is the capital of France?"],  # Added required 'prompts' key
    "metrics": ["accuracy"]
}

# Now runs without EvaluationConfigError
result = promptfoo.evaluate(config)
print("Evaluation succeeded", result)
Added the required 'prompts' key to the config dictionary to satisfy promptfoo's evaluation config schema.

Workaround

Wrap promptfoo.evaluate() in try/except EvaluationConfigError, log the config contents, and fix errors manually before retrying.

Prevention

Use schema validation tools or promptfoo's config validation utilities to verify your evaluation config before execution to avoid runtime errors.

Python 3.9+ · promptfoo >=0.1.0 · tested on 0.2.x
Verified 2026-04
Verify ↗

Community Notes

No notes yetBe the first to share a version-specific fix or tip.