Skip to main content

Quality Score

Understand how EvalGate computes the 0-100 quality score for every evaluation run, what each component measures, and how to interpret flags and evidence levels.
The quality score is EvalGate’s flagship metric — a single 0-100 number computed for every evaluation run. It captures pass rate, safety, judge quality, schema compliance, latency, and cost into one comparable score so you can track quality trends and gate releases.

How the score is computed

The score is a weighted average of six sub-scores, each normalized to 0-1 before blending: Weights are normalized so they always sum to 100%. Organizations can override weights via system policy — see ScoringPolicyConfig.

Formula

Default values

Latency scoring

Latency is scored linearly between the good and bad bands:
  • Score 1.0 when avgLatencyMs <= 1500ms
  • Score 0.0 when avgLatencyMs >= 8000ms
  • Linear interpolation between the two thresholds
If no latency data is available, the latency sub-score defaults to 1.0 (no penalty).

Cost scoring

Cost is scored relative to the budget:
  • Score 1.0 when avgCostUsd <= budgetUsd
  • Linear decay when cost exceeds budget
  • Score 0.0 when cost reaches 2x budget
If no cost or budget data is available, the cost sub-score defaults to 1.0 (no penalty).

Custom metrics

You can add custom metrics to the score by providing customMetrics in the score inputs. Each custom metric has a value (0-1) and a weight (positive number). Custom metrics are blended with the base score proportionally to their total weight.

Fallback behavior

When a data source is missing, the score uses conservative fallbacks: This means a run with only pass/fail data still gets a meaningful score, but the flags will indicate which dimensions are missing.

Flags

Flags are warning indicators surfaced alongside the score. They don’t change the score but alert you to data quality issues or risks:

Evidence levels

The evidence level indicates how trustworthy the score is based on data completeness: Use the evidence level to decide whether to trust a score for gating decisions. A “weak” score may still be useful for trend tracking but should not block a release on its own.

Scoring spec versioning

Every quality score is persisted with:
  • scoringVersion — the spec version used (currently v1)
  • inputsJson — the exact inputs that produced the score
  • scoringSpecJson — the full scoring spec at computation time
  • inputsHash — SHA-256 hash of canonicalized inputs
  • scoringSpecHash — SHA-256 hash of canonicalized scoring spec
  • scoringCommit — Git commit SHA when the score was computed
This ensures scores are reproducible and auditable. You can verify the scoring formula by fetching /api/quality/spec, which returns the current scoring spec.

API access

  • GET /api/quality/spec — Returns the current scoring spec (weights, thresholds, version)
  • GET /api/quality/{evaluationId} — Returns quality scores for an evaluation
  • POST /api/quality/recompute/{runId} — Recomputes the quality score for a specific run