Judge-Tuner: LLM Program Evaluation Suite Builder
Describes an app that builds and iteratively refines evaluation suites for LLM programs using AI parsing and EvalForge integration.
What this file does
Describes an app that builds and iteratively refines evaluation suites for LLM programs using AI parsing and EvalForge integration.
When to use it
- Building automated test suites for LLM-based applications
- Iteratively improving evaluation criteria with user feedback
- Generating synthetic test cases and assertions for LLM outputs
- Implementing a FastAPI backend for LLM evaluation workflows
Assumes this stack
Judge-Tuner: LLM Program Evaluation Suite Builder
Judge-Tuner is an application designed to create and improve evaluation suites for LLM (Large Language Model) programs. It leverages the EvalForge library to enhance its evaluation capabilities.
LLM Program Structure
An LLM program consists of:
- A system prompt
- A set of examples (input and output)
App Workflow
-
Initial Setup: The developer provides:
- A system prompt
- A set of examples (input and output)
-
Parsed Setup: The app uses an AI-powered system to parse the initial setup and generate:
- A suite description
- Evaluation criteria
- Data generation scenarios
-
Evaluation Suite Creation: The app generates an evaluation suite using EvalForge, consisting of: a. LLM Program details b. A detailed requirements document (suite description) c. A list of evaluations, including LLM-based and code-based assertions d. A list of verified test cases
-
Suite Validation and Refinement: After the initial suite creation, the user goes through the following steps: a. Validate the suite setup b. Generate a new synthetic example (with or without feedback) c. Optionally edit the generated example to their preference d. Run all evaluations on the new example e. Provide feedback on the evaluation results f. Update the evaluation suite based on the feedback:
- Refine evaluation prompts or code
- Update data generation scenarios to include new scenarios if necessary
- Ensure the suite can generate data for the new scenario
Key Components
-
EvaluationSuiteSetupConfig:
- system_prompt: str
- examples: List[SetupExample]
-
ParsedSetup:
- suite_description: str
- evaluation_criteria: List[Criterion]
- data_generation_scenarios: List[DataGenerationScenarios]
-
EvaluationSuite:
- setup: EvaluationSuiteSetupConfig
- suite_description: str
- verified_testcases: List[Testcase]
- evaluation_criteria: List[Criterion]
- data_generation_scenarios: List[DataGenerationScenarios]
- assertions: Dict[str, AssertionWrapper]
-
AssertionResult:
- assertion: str
- assertion_name: str
- type: str
- score: int
- result: str
- explanation: Optional[str]
-
EvaluationRunResult:
- testcase: Testcase
- criterion_to_assertion_results: Dict[str, AssertionResult]
EvalForge Integration
The app incorporates the following components from EvalForge:
- AssertionScorer: Combines LLM and code-based assertions for evaluation
- LLMAssertionScorer: Evaluates outputs using LLM-based assertions
- CodeAssertionScorer: Evaluates outputs using Python code-based assertions
- CodeFormatter: Formats and lints Python code for assertions
Technologies Used
- Pydantic for data validation and settings management
- Instructor and OpenAI for AI-powered parsing and generation
- FastAPI for the web framework
- Weave for data visualization and management
API Endpoints
-
POST /set_up_task
- Input: SetupTaskRequest (system_prompt, examples)
- Output: EvaluationSuite
-
POST /run_evaluations
- Input: RunEvaluationsRequest (testcase, evaluation_suite)
- Output: EvaluationRunResult
-
POST /generate_examples
- Input: GenerateExamplesRequest (evaluation_suite, num_examples, note)
- Output: List[SetupExample]
-
POST /update_evaluation_suite
- Input: UpdateEvaluationSuiteRequest (evaluation_suite, feedback)
- Output: UpdatedEvaluationSuite
Key Features
- AI-powered parsing of initial setup
- Generation of diverse evaluation criteria
- Creation of both LLM-based and code-based assertions
- Integration with EvalForge for advanced evaluation capabilities
- Asynchronous processing for efficient handling of requests
- Generation of new examples based on existing evaluation suite
- Evaluation of test cases against generated assertions
- Iterative refinement of the evaluation suite based on user feedback
- Dynamic updating of data generation scenarios to cover new cases
The app provides a robust framework for creating and refining comprehensive evaluation suites for LLM programs, enabling developers to assess and enhance their models' performance across various scenarios. The iterative feedback loop allows for continuous improvement of the evaluation process, ensuring that the suite remains relevant and effective as new scenarios and edge cases are discovered.
Current Task: Implement update_evaluation_suite API
Our next step is to implement a new API endpoint called update_evaluation_suite. This endpoint will take an existing EvaluationSuite and feedback, and return an updated EvaluationSuite.
Specification:
-
Create a new API endpoint:
- Path:
/update_evaluation_suite - Method: POST
- Path:
-
Input:
- UpdateEvaluationSuiteRequest:
- evaluation_suite: EvaluationSuite
- update_context: Union[UpdateTestcase, UpdateAssertion]
- UpdateEvaluationSuiteRequest:
-
Output:
- UpdatedEvaluationSuite: An updated version of the input EvaluationSuite
-
Implementation steps: a. Create the necessary Pydantic models for the new structures (if not already existing) b. Implement the logic to update the EvaluationSuite based on the provided feedback:
- If UpdateTestcase is provided, add or update the testcase in the suite
- If UpdateAssertion is provided, update the specified assertion c. Use the EvalForge library to regenerate or update assertions if necessary d. Update data generation scenarios if the new testcase introduces a new scenario e. Create the new API endpoint in the FastAPI app f. Implement error handling and input validation
-
Additional considerations:
- Ensure the API can handle both testcase updates and assertion updates
- Implement proper error handling for invalid inputs or update failures
- Consider adding optional parameters for customizing the update process (e.g., regenerate all assertions, update only specific criteria)
This new API endpoint will allow users to iteratively refine their evaluation suites based on new examples or improved assertions, ensuring that the suite remains up-to-date and effective as the LLM application evolves.
What's inside
1 workflow overview, 5 component definitions, 4 API endpoints, 1 implementation task specification
Change this for your project
- Replace
mahanswaray/judge-tunerwith your own repository name - Replace
EvalForgereferences with your own evaluation library if not using EvalForge - Replace
UpdateEvaluationSuiteRequestmodel fields if your feedback structure differs
Where it goes
Keep alongside your test suite. Used to define and score model evaluations.
Worth borrowing
- Separating assertion types into LLM-based and code-based scorers for modular evaluation
- Using a feedback loop to update test cases and assertions dynamically
Related Documents
IATA BCBP Standard Compliance
Documents which IATA BCBP fields and barcode formats a Swift library implements, including Version 8 gender code support.
Evaluating AI Agent Systems: Metrics, Benchmarks, and Quality Assurance (2024-2026)
Surveys 2024-2026 metrics, benchmarks, and monitoring tools for evaluating AI agent systems, with recommendations for a self-improving coding agent.
Voice AI Leaderboards, Benchmarks, and Evaluation Gaps (Jan 2025 -- Feb 2026)
Surveys 20+ voice AI benchmarks from Jan 2025, Feb 2026, identifies evaluation gaps, and provides leaderboard data for STT, TTS, and end-to-end voice agents.
LLM Evaluation — Deep Dive
Covers why LLM evaluation is hard, benchmark taxonomy, LLM-as-judge methodology, contamination, robustness, and designing an eval suite for a product.