What this thread does
Do first: Set strict_mode=True in GEval.
When you need it
Use strict mode when subjective criteria still need a binary score. G-Eval uses an LLM judge to assess output against custom criteria.
The setting
strict_mode is a boolean with values True and False, defaulting to False. Setting it to True also overrides threshold to 1; the ordinary threshold default is 0.5.
Trade-off
The metric gives 1 only for perfection and 0 otherwise. You lose intermediate scores, and the passing threshold becomes 1. Strict mode does not make the LLM judge deterministic.
Steps
1. Use the page's correctness criterion and parameter names, adding its documented strict_mode option:
from deepeval.test_case import SingleTurnParams
from deepeval.metrics import GEval
correctness_metric = GEval(
name="Correctness",
criteria="Determine whether the actual output is factually correct based on the expected output.",
evaluation_params=[SingleTurnParams.ACTUAL_OUTPUT, SingleTurnParams.EXPECTED_OUTPUT],
strict_mode=True,
)
2. Define the page's single-turn example:
from deepeval.test_case import LLMTestCase
test_case = LLMTestCase(
input="The dog chased the cat up the tree, who ran up the tree?",
actual_output="It depends, some might consider the cat, while others might argue the dog.",
expected_output="The cat."
)
3. Use its standalone measurement and inspection calls:
correctness_metric.measure(test_case)
print(correctness_metric.score, correctness_metric.reason)
Check it worked
Read correctness_metric.score and correctness_metric.reason. With strict mode the documented score choices are 1 and 0, with the threshold set to 1.
Limits
Include only test-case parameters referenced by the criterion or evaluation steps. Supply either criteria or evaluation_steps, never both. G-Eval is not deterministic; the page points to DAGMetric for deterministic control. The page displays Python v4.3.5 but gives no introduction version for strict_mode.
Not for: loading CSV goldens into an EvaluationDataset.
Sources
- G-Eval, DeepEval documentation, read 2026-11-24: "1 for perfection, 0 otherwise."
Checked
2026-11-24; read <https://deepeval.com/docs/metrics-llm-evals>; no command was run.
Started from a post by @Confident AI Inc., packaged by the editor. Original post