Deterministic LLM/RAG evals as a PR check
Project description
AOTP Ventures EvalGate
EvalGate runs deterministic LLM/RAG evals as a PR check. It compares your repo's generated outputs against fixtures, validates formatting, label accuracy, latency/cost budgets, and can use LLMs as judges for complex criteria. It posts a readable summary on the PR. Default is local-only (no telemetry).
- ✅ Deterministic checks (schema/labels/latency/cost)
- 🧠 LLM-based evaluation for complex criteria
- 🧪 Regression vs
mainbaseline - 🔒 Local-only by default; optional “metrics-only” later
- 🧰 Zero infra — a composite GitHub Action + tiny CLI
Quick Start
1. Install and Initialize
# Initialize EvalGate in your project
uvx --from evalgate evalgate init
# This creates:
# - .github/evalgate.yml (configuration)
# - eval/fixtures/ (test data with expected outputs)
# - eval/schemas/ (JSON schemas for validation)
2. Generate Your Model's Outputs
# Run your model/system to generate outputs for the fixtures
# (Replace with your actual prediction script)
python scripts/predict.py --in eval/fixtures --out .evalgate/outputs
3. Run Evaluation
# Run the evaluation suite
uvx --from evalgate evalgate run --config .github/evalgate.yml
# View results summary
uvx --from evalgate evalgate report --summary --artifact .evalgate/results.json
LLM as Judge
EvalGate can use LLMs to evaluate outputs for complex criteria beyond simple schema validation.
1. Install with LLM support
# Install with LLM dependencies
pip install evalgate[llm]
# Or with uv
uvx --from evalgate[llm] evalgate
2. Create a prompt template
Create an evaluation prompt in eval/prompts/quality_judge.txt:
You are evaluating the quality of customer support responses.
INPUT:
{input}
EXPECTED:
{expected}
OUTPUT:
{output}
Rate from 0.0 to 1.0 based on accuracy, helpfulness, and tone.
Score: [your score]
3. Configure your evaluator
In .github/evalgate.yml:
evaluators:
# Your existing evaluators...
- name: content_quality
type: llm
provider: openai # or anthropic, azure, local
model: gpt-4 # or other models
prompt_path: eval/prompts/quality_judge.txt
api_key_env_var: OPENAI_API_KEY
weight: 0.3
4. Set your API key
export OPENAI_API_KEY=your_api_key_here
5. Run evaluation
evalgate run --config .github/evalgate.yml
GitHub Actions Integration with API Keys
Add your API keys as repository secrets in GitHub, then use them in your workflow:
# Optional: Validate API key is set (fail fast with clear message)
- name: Validate OpenAI API Key
run: |
if [ -z "${{ secrets.OPENAI_API_KEY }}" ]; then
echo "❌ OPENAI_API_KEY secret is not set"
echo "Please add your OpenAI API key as a repository secret named 'OPENAI_API_KEY'"
echo "Go to: Settings > Secrets and variables > Actions > New repository secret"
exit 1
fi
- name: Run EvalGate with LLM judge
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: uvx --from evalgate[llm] evalgate run --config .github/evalgate.yml
Or with the composite action:
- uses: aotp-ventures/evalgate@main
with:
config: .github/evalgate.yml
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
GitHub Actions Integration
Option 1: Use the Composite Action
Add this to your .github/workflows/ directory:
name: EvalGate
on: [pull_request]
jobs:
evalgate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
# Generate your model outputs
- name: Generate outputs
run: python scripts/predict.py --in eval/fixtures --out .evalgate/outputs
# Run EvalGate
- uses: aotp-ventures/evalgate@main
with:
config: .github/evalgate.yml
Option 2: Direct Integration
Or integrate directly in your existing workflow:
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Run EvalGate
run: uvx --from evalgate evalgate run --config .github/evalgate.yml
- name: EvalGate Summary
if: always()
run: uvx --from evalgate evalgate report --summary --artifact ./.evalgate/results.json
# Optional: Upload detailed results for debugging
- name: Upload EvalGate Results
if: always()
uses: actions/upload-artifact@v4
with:
name: evalgate-results
path: .evalgate/results.json
retention-days: 30
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file evalgate-0.2.0.tar.gz.
File metadata
- Download URL: evalgate-0.2.0.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfc2b4a33427ac9856d3b36a1205034d3eac53c6ffac60a0c7a8d2408efe9cfc
|
|
| MD5 |
04be06f57d0db2307ffc793cbdd396d5
|
|
| BLAKE2b-256 |
19503adca9169a50309548ded918de54d2aea4ebc70bf2da2af04c15e016777a
|
File details
Details for the file evalgate-0.2.0-py3-none-any.whl.
File metadata
- Download URL: evalgate-0.2.0-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd087669349873a839bb235f5d3a77b90e838a000421a54fcc862bc3e10bde09
|
|
| MD5 |
45077eec8fe08a2dd6ca0f0919227b41
|
|
| BLAKE2b-256 |
2a9f15515dad98a0cc19e230a68332c56af5fcfdc6f25b4707c5161d323efbbc
|