-
Notifications
You must be signed in to change notification settings - Fork 18
feat: extract Eval Author into nemo-eval-author-plugin #932
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
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ea2fc80
feat: extract Eval Author into nemo-eval-author-plugin
aleckhoury f273841
refactor: keep Eval Author thin; hard-depend on Experimentalist modules
aleckhoury 06a9c46
fix(ci): gate Eval Author plugin lint and test discovery like Experim…
aleckhoury 38f2e8b
fix(eval-author): use unroutable HTTPS placeholder for test credentials
aleckhoury aa21cde
fix(eval-author): address plugin extraction review findings
aleckhoury 2fdd214
docs(eval-author): name the client cache key instead of calling it a …
aleckhoury 55f53c3
Merge origin/main into ase-eval-author-plugin/akhoury
aleckhoury 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
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
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,43 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Example environment for standalone Eval Author runs. | ||
| # Copy to `.env` next to this file (or export in your shell): | ||
| # | ||
| # cp .env.example .env | ||
| # | ||
| # AUTHOR_* is Eval Author's credential contract. The EXPERIMENTALIST_* interplay | ||
| # below is transitional and goes away once Eval Author no longer reuses any | ||
| # Experimentalist code: | ||
| # | ||
| # - an unset AUTHOR_* falls back to its EXPERIMENTALIST_* equivalent, so insight | ||
| # mode works from one Experimentalist profile .env | ||
| # - a set AUTHOR_* is copied into any unset EXPERIMENTALIST_* slot, because the | ||
| # Experimentalist helpers Eval Author still borrows read only EXPERIMENTALIST_* | ||
| # | ||
| # TODO(eval-author-standalone): remove both, at which point AUTHOR_* becomes required | ||
| # here rather than optional. Set AUTHOR_* explicitly now to avoid that break. | ||
| # | ||
| # TODO(cli): wire `nemo eval-author` to load this `.env` the way Experimentalist | ||
| # loads the profile-dir `.env`. | ||
|
|
||
| # Required for LLM-backed Eval Author / TraceAnalyzer (NOOA CompletionClient). | ||
| AUTHOR_API_BASE=https://inference-api.nvidia.com/v1 | ||
| AUTHOR_API_KEY= | ||
|
|
||
| # Optional model overrides (defaults shown). Eval Author itself uses the smart and fast | ||
| # tiers; the mid tier is listed only because it is bridged to Experimentalist helpers, | ||
| # and it goes away with the bridge. | ||
| # AUTHOR_SMART_MODEL_NAME=openai/openai/openai/gpt-5.5 | ||
| # AUTHOR_MID_MODEL_NAME=openai/gcp/google/gemini-3.5-flash | ||
| # AUTHOR_FAST_MODEL_NAME=openai/openai/openai/gpt-5-mini | ||
|
|
||
| # Optional: NVIDIA Inference Gateway virtual key. When AUTHOR_API_KEY is unset and | ||
| # AUTHOR_API_BASE is the gateway over HTTPS, standalone runners fall back to | ||
| # INFERENCE_API_KEY the same way Experimentalist does today. The HTTPS requirement | ||
| # is deliberate: the key is never forwarded to a plain-http base. | ||
| # INFERENCE_API_KEY= | ||
|
|
||
| # Optional: NeMo Platform URL for Insight / Fileset / agent-code access. | ||
| # Leave unset to use the active `nemo auth` context, or set for a local stack. | ||
| # NMP_BASE_URL=http://localhost:8080 | ||
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,66 @@ | ||
| # NeMo Eval Author Plugin | ||
|
|
||
| Library-only plugin that owns the Eval Author agent (`eval_author/`). | ||
|
|
||
| ## Direction of travel | ||
|
|
||
| **Eval Author is meant to become standalone, with nothing imported from | ||
| Experimentalist.** Prefer duplicating a helper over sharing one, even when sharing | ||
| looks tidier. | ||
|
|
||
| Right now the two packages depend on each other: | ||
|
|
||
| | Arrow | Status | Why | | ||
| | --- | --- | --- | | ||
| | Experimentalist → Eval Author | permanent | insight mode imports `EvalAuthor` and `EvalAuthorConfig` at module scope | | ||
| | Eval Author → Experimentalist | temporary | still borrows evaluator/Harbor, staging, trace, tools, cache, backend | | ||
|
|
||
| [`tests/test_plugin_boundary.py`](tests/test_plugin_boundary.py) pins the second list | ||
| so it can only shrink, and names what each remaining import is still for. `uv` | ||
| resolves the current cycle; install both packages with: | ||
|
|
||
| ```bash | ||
| uv sync --group experimentalist | ||
| ``` | ||
|
|
||
| ## Public API | ||
|
|
||
| ```python | ||
| from nemo_eval_author_plugin.eval_author.agent import EvalAuthor, build_eval_author_agent | ||
| from nemo_eval_author_plugin.eval_author.models import EvalAuthorConfig, EvalAuthorResult | ||
| from nemo_eval_author_plugin.eval_author.run import run_eval_author | ||
|
|
||
| # Still borrowed from Experimentalist, and on the way out. Treat these as Eval Author's | ||
| # own types once they move; do not build new code on the Experimentalist paths. | ||
| from nemo_experimentalist_plugin.experimentalist.components.evaluator import Dataset | ||
| from nemo_experimentalist_plugin.experimentalist.components.evaluator.models import DatasetRef | ||
| from nemo_experimentalist_plugin.experimentalist.components.dataset_staging import stage_task_template | ||
| from nemo_experimentalist_plugin.experimentalist.components.trace_analyzer import TraceAnalyzer | ||
| from nemo_experimentalist_plugin.experimentalist.components.trace_explorer import TraceExplorer | ||
| ``` | ||
|
|
||
| ## Credentials (standalone) | ||
|
|
||
| Copy [`.env.example`](.env.example) to `.env` and set `AUTHOR_API_KEY` (and optionally model names / `NMP_BASE_URL`): | ||
|
|
||
| ```bash | ||
| cp plugins/nemo-eval-author/.env.example plugins/nemo-eval-author/.env | ||
| ``` | ||
|
|
||
| `AUTHOR_*` is Eval Author's credential contract, and `model_config` imports nothing | ||
| from Experimentalist. When the API base is the NVIDIA Inference Gateway over HTTPS, | ||
| `INFERENCE_API_KEY` is also accepted. | ||
|
|
||
| Two pieces of that module are transitional and disappear with the last | ||
| Experimentalist import, both tagged `TODO(eval-author-standalone)`: | ||
|
|
||
| - unset `AUTHOR_*` variables fall back to `EXPERIMENTALIST_*`, so insight mode works | ||
| from a single Experimentalist profile `.env`. Setting `AUTHOR_*` explicitly today | ||
| avoids the break when the fallback is removed. | ||
| - importing `nemo_eval_author_plugin._env_bridge` copies `AUTHOR_*` into unset | ||
| `EXPERIMENTALIST_*` slots, so the Experimentalist helpers Eval Author still | ||
| borrows see credentials during a standalone run. `eval_author.agent` imports it | ||
| ahead of any Experimentalist agent, because those agents read the environment when | ||
| their class body executes. | ||
|
|
||
| A `nemo eval-author` CLI that auto-loads this `.env` is not wired yet. |
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,26 @@ | ||
| [project] | ||
| name = "nemo-eval-author-plugin" | ||
| version = "0.1.0" | ||
| description = "Eval Author agent for NeMo Platform (hard-depends on Experimentalist for evaluator/trace helpers)." | ||
| requires-python = ">=3.12,<3.14" | ||
| dependencies = [ | ||
| "pydantic>=2", | ||
| "harbor>=0.16", | ||
| "nooa", | ||
| "nemo-experimentalist-plugin", | ||
| "nemo-insights-plugin", | ||
| "nemo-platform", | ||
| "tomlkit>=0.13.3", | ||
| ] | ||
|
|
||
| [build-system] | ||
| requires = ["hatchling"] | ||
| build-backend = "hatchling.build" | ||
|
|
||
| [tool.hatch.build.targets.wheel] | ||
| packages = ["src/nemo_eval_author_plugin"] | ||
|
|
||
| [tool.pytest.ini_options] | ||
| asyncio_mode = "auto" | ||
| pythonpath = ["src"] | ||
| testpaths = ["tests"] |
23 changes: 23 additions & 0 deletions
23
plugins/nemo-eval-author/src/nemo_eval_author_plugin/_env_bridge.py
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,23 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """Import this module for its side effect: bridging ``AUTHOR_*`` credentials. | ||
|
|
||
| Transitional. This module exists only because Eval Author still reuses Experimentalist | ||
| agents, and it should be deleted along with the last ``nemo_experimentalist_plugin`` import | ||
| in this package. ``tests/test_plugin_boundary.py`` tracks what is left to remove. | ||
|
|
||
| ``TraceAnalyzer`` and the other Experimentalist agents Eval Author reuses build their LLM | ||
| client in the class body, so they read ``EXPERIMENTALIST_*`` the moment their module is | ||
| first imported. A module that imports them therefore has to bridge *before* that import, | ||
| which no function call inside the module can do. | ||
|
|
||
| Importing this module is how Eval Author expresses that ordering. ``import | ||
| nemo_eval_author_plugin._env_bridge`` sorts ahead of every ``from ...`` line in the same | ||
| isort section, so the ordering is maintained by the linter rather than by an ``E402`` | ||
| waiver and a comment asking future readers not to reshuffle the imports. | ||
| """ | ||
|
|
||
| from nemo_eval_author_plugin.model_config import bridge_author_env_to_experimentalist | ||
|
|
||
| bridge_author_env_to_experimentalist() |
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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.