Evaluate your LLM app's outputs on the AI Evaluation Platform on every build, and fail the build when quality drops below your thresholds.
The run appears in the app with the commit as its version label, so you can compare it with the previous build on the same dataset.
name: LLM quality gate
on: [pull_request]
jobs:
eval:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Run your app over the dataset's prompts and write {"case_id": "output", ...}
- run: python scripts/generate_outputs.py > outputs.json
- uses: assertthat/ai-eval-action@v1
with:
api-key: ${{ secrets.AI_EVAL_API_KEY }}
project: ${{ vars.AI_EVAL_PROJECT }}
dataset: ${{ vars.AI_EVAL_DATASET }}
outputs: outputs.json
fail-under: pass_rate=0.9
metric-thresholds: factual_accuracy=0.8Create the API key in the app under Settings > API keys and store it as the
AI_EVAL_API_KEY repository secret.
To evaluate a file of cases instead of a dataset, use file: cases.jsonl (or .json, .csv,
.xlsx) and leave out dataset and outputs.
| Input | Required | Default | Description |
|---|---|---|---|
api-key |
yes | API key. Store it as a secret. | |
api-url |
no | https://api.ai-evaluation-platform.com |
API base URL |
project |
no | Project id. Its metrics and thresholds apply. | |
dataset |
no | Dataset id to evaluate (use with outputs) |
|
dataset-version |
no | latest | Dataset version |
outputs |
no | Your app's outputs for the dataset rows: JSON {case_id: output}, JSONL or CSV |
|
file |
no | Cases (.json, .jsonl, .csv, .xlsx) instead of a dataset |
|
metrics |
no | the project's | Comma-separated metric keys |
fail-under |
no | pass_rate=0.9 |
Gates, comma-separated: pass_rate, good_rate, overall, safety, truth, quality |
metric-thresholds |
no | Per-metric minimum averages, e.g. factual_accuracy=0.8,hallucination=0.85 |
|
run-name |
no | owner/repo@branch |
Run name shown in the app |
sdk-version |
no | this release's SDK | pip requirement for the ai-eval-platform package |
python-version |
no | 3.12 |
Python for the CLI; '' uses the runner's Python |
| Output | Description |
|---|---|
report |
Path to the JSON gate report (ai-eval-report.json) |
The step fails when the gate fails. To upload the report anyway, add if: always() to the next step:
- uses: actions/upload-artifact@v4
if: always()
with:
name: ai-eval-report
path: ai-eval-report.json