Add venv support for custom evals#65
Merged
krisztianfekete merged 4 commits intomainfrom Mar 27, 2026
Merged
Conversation
777a927 to
61c7f12
Compare
There was a problem hiding this comment.
Pull request overview
Adds optional virtualenv creation/caching for Python custom evaluators that ship a requirements.txt, so evaluator subprocesses can run with isolated dependencies.
Changes:
- Introduce venv management utilities (
ensure_venv/ensure_venv_async) that create cached environments and install deps (+ evaluator SDK). - Extend custom evaluator subprocess execution to optionally run Python evaluators using a venv interpreter.
- Enhance evaluator sources to also fetch/copy
requirements.txtalongside evaluator code; update example config to include a deps-heavy evaluator.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/agentevals/evaluator/venv.py |
New venv creation/install + caching logic for Python evaluators. |
src/agentevals/evaluator/sources.py |
Fetch/copy requirements.txt alongside evaluator entrypoints. |
src/agentevals/custom_evaluators.py |
Thread venv interpreter path through runtime command construction and executor factory. |
examples/custom_evaluators/eval_config.yaml |
Add example evaluator entry intended to exercise dependency installation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
peterj
reviewed
Mar 27, 2026
peterj
reviewed
Mar 27, 2026
peterj
reviewed
Mar 27, 2026
peterj
requested changes
Mar 27, 2026
peterj
reviewed
Mar 27, 2026
peterj
reviewed
Mar 27, 2026
peterj
reviewed
Mar 27, 2026
peterj
approved these changes
Mar 27, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds automatic venv management for evaluators that ship their own dependencies.
requirements.txtalongside its entrypoint, agentevals now creates an isolated cached venv under~/.cache/agentevals/venvs/, installs the evaluator SDK and the declared dependencies, and runs the evaluator subprocess using that venv's Python interpreter.requirements.txtchanges. It prefersuvwhen available, falling back to venv +pip.Companion PR: agentevals-dev/evaluators#5 as the first custom evaluator that contains third party dependencies.
Fixes #58