AI Eval measures and improves the quality of your AI integrations in Drupal. Define test datasets in YAML, run them against your agents or any AI provider, and get scored results with pass/fail quality gates.

Two evaluation modes

Agent mode invokes ai_agents plugins end-to-end, testing the full loop: tool calls, reasoning, and response quality.

Chat mode sends prompts directly to any AI provider (Anthropic, OpenAI, Ollama). No agent framework needed. Useful for evaluating system prompts, RAG pipelines, Q&A bots, or classification tasks.

Results dashboard

The results dashboard shows status cards with run summaries and week-over-week trends, plus a target health table with score meters, sparkline trends, and error counts.

Result detail page with run summary, weakest grader callout, and per-question scores with collapsible inputs

Each result detail page shows collapsible per-question breakdowns with grader scores, tooltips with judge reasoning, and a weakest grader callout.

Prompt optimization

When a target fails its gate, the optimizer analyzes the failure patterns and proposes an improved system prompt. Review proposals with a side-by-side prompt comparison before applying.

Optimization detail showing failure analysis and current vs candidate prompt comparison with apply and reject buttons

LLM judges are noisy, so the optimizer runs each candidate prompt multiple times and compares the average against an equally-repeated baseline. You can tune the number of runs per candidate, require a minimum dataset size before the optimizer will run, and set an improvement margin that stays above the judge's own variance floor.

Pluggable graders

Ships with seven graders. Five are LLM-based judges that score responses on a 0-5 scale:

Two graders are deterministic and run locally with no API cost:

You can add your own graders as plugins in any module.

Judge validation

An LLM judge that disagrees with humans is an unvalidated ruler. If you gate deployments or optimize prompts based on judge scores, you need to know how much to trust those scores in the first place.

Two Drush commands close that loop:

Run this before you trust judge scores for gating or optimization decisions.

Quality gates

Each target defines a threshold and a gate type. Hard gates fail the run when the score is below threshold, which is what you want in CI pipelines. Soft gates log a warning instead. Use hard gates to block deployments when AI quality drops.

Response char limit

Long agent responses can silently blow out judge prompts and cost. A global response_char_limit caps the length of the response text the judge sees, with a per-target override for targets that need more headroom. The cap is explicit rather than hidden inside grader code.

Admin UI

Target form in agent mode with agent select, dataset, graders, and quality gate fields

Drush commands

Requirements

Drupal 11.2+, PHP 8.3+, AI module. Optional: AI Agents for agent mode.

Documentation

Full documentation is in the git repository: