This project is not covered by Drupal’s security advisory policy.

A UI for running AI Provider tests with customised prompts. This allows for trialling changes to prompts etc. The module allows you to run multiple iterations to get a success rate, which is useful for more complex prompts and scenarios against non-deterministic LLMs.

Set up

This requires having drupal/core-dev installed.

You will also need to set up the phpunit.ai.xml.dist provided by the AI module in your project root, with the credentials of any models you want to test against.

The UI

The UI will automatically detect any tests from any packages installed via composer. The containing test modules do not need to be enabled.
UI of the list of tests

Viewing a particular test will give you information about that test, a list of previous local test runs, any other prompts/configuration that are set up in the test case definition.
List of previous runs and configured cases.

You can then use one of these config sets to run a test via the UI:
Modifying the configuration for a run

You will be able to select any model configured in the host Drupal instance. Note, you will need to provide the relevant configuration for the test in the phpunit.ai.xml phpunit configuration.

Adding test cases

Any test implementing \Drupal\Tests\ai\AiLlm\AiTestUiInterface will be included in the UI. It is recommended to also use the \Drupal\Tests\ai\Attributes\AiTestUi attribute to provide UI friendly names and descriptions.

Supporting organizations: 
Main development

Project information

Releases