-
Notifications
You must be signed in to change notification settings - Fork 67
feat: Test-based Evaluation with LLM-as-a-judge #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
avinash2692
merged 6 commits into
generative-computing:main
from
keshavramji:test-based-eval
Dec 9, 2025
+587
−6
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c5f3d9f
v1 working
c9bc4b5
Update v1 data format and judge call
6c7ad29
Pre-commit fixes
90b8f49
PR update: jinja, pydantic
0010187
Revert .gitignore to main
keshavramji 7a42b1c
Merge branch 'main' into test-based-eval
avinash2692 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """CLI for test-based evaluation""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| """Use the eval command for LLM-as-a-judge evaluation, given a (set of) test file(s) consisting of prompts, instructions, and optionally, targets. | ||
| Instantiate a generator model to produce candidate responses, and a judge model to determine whether the instructions have been followed.""" | ||
|
|
||
| import typer | ||
|
|
||
| eval_app = typer.Typer(name="eval") | ||
|
|
||
|
|
||
| def eval_run( | ||
| test_files: list[str] = typer.Argument( | ||
| ..., help="List of paths to json/jsonl files containing test cases" | ||
| ), | ||
| backend: str = typer.Option("ollama", "--backend", "-b", help="Generation backend"), | ||
| model: str = typer.Option(None, "--model", help="Generation model name"), | ||
| max_gen_tokens: int = typer.Option( | ||
| 256, "--max-gen-tokens", help="Max tokens to generate for responses" | ||
| ), | ||
| judge_backend: str = typer.Option( | ||
| None, "--judge-backend", "-jb", help="Judge backend" | ||
| ), | ||
| judge_model: str = typer.Option(None, "--judge-model", help="Judge model name"), | ||
| max_judge_tokens: int = typer.Option( | ||
| 256, "--max-judge-tokens", help="Max tokens for the judge model's judgement." | ||
| ), | ||
| output_path: str = typer.Option( | ||
| "eval_results", "--output-path", "-o", help="Output path for results" | ||
| ), | ||
| output_format: str = typer.Option( | ||
| "json", "--output-format", help="Either json or jsonl format for results" | ||
| ), | ||
| continue_on_error: bool = typer.Option(True, "--continue-on-error"), | ||
| ): | ||
| from cli.eval.runner import run_evaluations | ||
|
|
||
| run_evaluations( | ||
| test_files=test_files, | ||
| backend=backend, | ||
| model=model, | ||
| max_gen_tokens=max_gen_tokens, | ||
| judge_backend=judge_backend, | ||
| judge_model=judge_model, | ||
| max_judge_tokens=max_judge_tokens, | ||
| output_path=output_path, | ||
| output_format=output_format, | ||
| continue_on_error=continue_on_error, | ||
| ) | ||
|
|
||
|
|
||
| eval_app.command("run")(eval_run) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.