Skip to content

Conversation

@XiaoBoAI
Copy link
Collaborator

@XiaoBoAI XiaoBoAI commented Jan 4, 2026

No description provided.

- Add query generator for generating evaluation queries
- Add response collector for collecting model responses
- Add rubric generator for creating evaluation rubrics
- Add evaluator for running evaluations
- Add checkpoint support for resumable evaluations
- Add example configurations
- Add comprehensive documentation for zero-shot evaluation feature
- Include usage guide, configuration, and best practices
- Add to mkdocs navigation under Applications section
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @XiaoBoAI, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a powerful Zero-Shot Evaluation framework, enabling users to efficiently benchmark and compare various AI models and agent configurations. By automating the entire evaluation lifecycle from query generation to result analysis, it removes the dependency on pre-labeled datasets, significantly accelerating the assessment of new models or pipelines. The framework is designed for flexibility, offering both command-line and programmatic interfaces, and incorporates advanced techniques to ensure the quality and diversity of generated test cases.

Highlights

  • New Feature: Zero-Shot Evaluation: Introduces a comprehensive module for automatically evaluating and comparing multiple models or AI agent pipelines without requiring pre-existing test data.
  • Automated Pipeline: The evaluation process is fully automated, covering query generation, response collection from target endpoints, dynamic rubric generation, pairwise comparison using a judge model, and final model ranking.
  • Advanced Query Generation: Includes sophisticated query generation strategies such as iterative batch generation, deduplication, Evol-Instruct style complexity evolution, and asynchronous parallel processing to create diverse and challenging test cases.
  • Checkpointing and Resumption: The evaluation pipeline supports checkpointing, allowing users to save progress and resume evaluations from the last completed stage, enhancing robustness for long-running tasks.
  • Flexible Configuration: Evaluations are configured via YAML files, supporting environment variable resolution for sensitive information like API keys, and can be run via CLI or directly through Python.
  • Comprehensive Documentation: A new documentation page has been added, detailing the feature's usage, configuration, step-by-step guide, result interpretation, advanced options, and best practices.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive zero-shot evaluation cookbook, which is a significant new feature. The implementation is well-structured, with clear separation of concerns into components for configuration, query generation, response collection, evaluation, and checkpointing. The code is generally of high quality, with good use of modern Python features like asyncio and pydantic. I've identified a couple of high-severity race conditions in the parallel query generation logic that could lead to duplicate queries. I've also left some medium-severity comments regarding maintainability, such as removing hardcoded filenames and improving import style. Overall, this is a great addition, and with these fixes, it will be even more robust.

Comment on lines +501 to +511
# Validate and deduplicate
is_valid, reason = QueryValidator.validate(query_obj)
if not is_valid:
logger.debug(f"Batch {batch_id}: Skipping invalid query: {reason}")
continue

if self.deduplicator.add(query_obj.query):
queries.append(query_obj)
else:
logger.debug(f"Batch {batch_id}: Skipping duplicate query")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The use of self.deduplicator.add() inside this method, which is called in parallel, creates a race condition. The stateful deduplicator is not safe for concurrent writes. Multiple coroutines can check for duplicates before any of them has updated the deduplicator's state, leading to duplicate queries being added.

Deduplication should be performed after all parallel generation is complete. Please remove the deduplication logic from this method and move it to the generate method, after _parallel_generate returns.

            # Validate query
            is_valid, reason = QueryValidator.validate(query_obj)
            if not is_valid:
                logger.debug(f"Batch {batch_id}: Skipping invalid query: {reason}")
                continue

            queries.append(query_obj)

Comment on lines +630 to +633
# Validate and deduplicate
is_valid, _ = QueryValidator.validate(evolved_query)
if is_valid and self.deduplicator.add(evolved_query.query):
evolved.append(evolved_query)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Similar to _generate_batch, this method has a race condition when using self.deduplicator.add() because _evolve_single is called concurrently. This can lead to duplicate queries being added. Deduplication should be performed after all parallel evolution tasks are complete.

                # Validate and add evolved query
                is_valid, _ = QueryValidator.validate(evolved_query)
                if is_valid:
                    evolved.append(evolved_query)

Comment on lines 372 to 376
self._checkpoint_mgr.update_stage(
EvaluationStage.QUERIES_GENERATED,
total_queries=len(self._queries),
queries_file=str(self._checkpoint_mgr.output_dir / "queries.json"),
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The filename queries.json is hardcoded here. To improve maintainability and reduce coupling, it's better to use the QUERIES_FILE constant defined in the CheckpointManager class. This ensures that if the filename ever changes, it only needs to be updated in one place. This same issue applies to responses.json and rubrics.json in the subsequent checkpoint updates in this file.

Suggested change
self._checkpoint_mgr.update_stage(
EvaluationStage.QUERIES_GENERATED,
total_queries=len(self._queries),
queries_file=str(self._checkpoint_mgr.output_dir / "queries.json"),
)
self._checkpoint_mgr.update_stage(
EvaluationStage.QUERIES_GENERATED,
total_queries=len(self._queries),
queries_file=str(self._checkpoint_mgr.output_dir / self._checkpoint_mgr.QUERIES_FILE),
)

# =============================================================================


from pydantic import BaseModel, Field
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This import should be moved to the top of the file with the other imports, as per PEP 8 guidelines. Placing all imports at the beginning of a module makes it easier to see its dependencies and improves code readability.

… components

- Move core modules to top-level directory (checkpoint, schema, query_generator, response_collector, zero_shot_pipeline)
- Add pairwise_analyzer to openjudge/analyzer
- Add rubric_generator to openjudge/generator
- Update imports and exports in __init__.py files
- Simplify core/__init__.py to re-export from parent module
- Remove RubricGenerationConfig class, pass parameters directly to constructor
- Add DEFAULT_RUBRICS constant for fallback rubrics
- Update zero_shot_evaluation docs with pre-defined queries usage guide
- Simplify related tests
- Fix line too long in pairwise_analyzer.py (C0301)
- Remove unnecessary lambda in generator.py (W0108)
- Fix parameter renaming issue in _generate_rubrics method (W0237)
- Remove unused DEFAULT_RUBRICS import
- Apply isort and black formatting fixes
Copy link
Collaborator

@XieLipeng0830 XieLipeng0830 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation in the simple_rubric module, including generator.py and rubric_generator.py, successfully supports the intended functionality as specified.

@helloml0326 helloml0326 merged commit cb230fe into main Jan 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants