feat(evaluator): add derived evaluators (reuse a base metric on your own model) - #2015
Open
jariy17 wants to merge 2 commits into
Open
feat(evaluator): add derived evaluators (reuse a base metric on your own model)#2015jariy17 wants to merge 2 commits into
jariy17 wants to merge 2 commits into
Conversation
…own model)
Add a 'derived' evaluator config: point at a managed base metric — a 3P
library metric (ThirdParty.<Provider>.<Metric>) or a built-in (Builtin.<Metric>)
— and run its prompt/scoring on your own model.
- schema: new EvaluatorConfig.derived arm { baseEvaluatorId, model };
EvaluatorConfig is now exactly-one-of llmAsAJudge | codeBased | derived.
level is required for every evaluator (must match the base for derived).
- CLI: 'agentcore add evaluator --type derived --base-evaluator-id <id> --model <m>'.
level is auto-resolved from the base via GetEvaluator at add time (--level
overrides/offline). --instructions/--rating-scale rejected for derived.
- telemetry: EvaluatorType gains 'derived'.
jariy17
force-pushed
the
Dervived_evaluators
branch
from
August 17, 2026 21:06
5e1fa1a to
bf0cc80
Compare
…-context (#2027) * fix(evaluator): derived --config handling, region fallback, base-id regex, llm-context Follow-up fixes from the derived bug bash: - Reject --config with --type derived instead of silently ignoring it (the derived arm ran before the config loader). - Resolve the base metric's region via ConfigIO.resolveRegionFallback so a profile-only region works on a fresh project with no saved deploy targets (the old path mapped over an empty targets array and dropped the fallback). - Tighten BASE_EVALUATOR_ID_PATTERN to Builtin.<Metric> / ThirdParty.<Provider>.<Metric>; rejects malformed ids (ThirdParty.DeepEval, ThirdParty..ToolUse, trailing dot) that --level previously let through. - Sync llm-compacted schema so generated project guidance includes the derived arm. * refactor: drop redundant try/catch in region resolution resolveRegionFallback already checks env vars first and returns undefined rather than throwing (it's called bare in resolveAWSDeploymentTargets), so the catch that re-read the env vars was dead. --------- Co-authored-by: jariy17 <tjariy+jariy17@users.noreply.github.com>
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.
What this does — 1 line
agentcore add evaluator --type derived --base-evaluator-id <id> --model <m>— create an evaluator that reuses a managed base metric's prompt/scoring on your own model. The base is a 3P library metric (ThirdParty.<Provider>.<Metric>) or a built-in (Builtin.<Metric>).Try it
Output:
add evaluator --help(new options)--instructions/--rating-scale/--model-providerare rejected for--type derived(the base owns the prompt + scale).Additions to
agentcore.json{ "name": "my_tool_use", "level": "SESSION", "config": { "derived": { "baseEvaluatorId": "ThirdParty.DeepEval.ToolUse", "model": "us.anthropic.claude-sonnet-4-6" } } }How level is set
The API requires the derived evaluator's
levelto match the base metric's level. The CLI resolves it for you at add time viaGetEvaluator(baseEvaluatorId)and bakes it intoagentcore.json— you never type it.--levelstays available as an offline override.Changes
EvaluatorConfig.derivedarm{ baseEvaluatorId, model }; config is exactly-one-ofllmAsAJudge | codeBased | derived;levelrequired for every evaluator.--type derived+--base-evaluator-id; auto-level viaGetEvaluator; derived success message.EvaluatorTypegainsderived.Verification
ThirdParty.DeepEval.ToolUse→ SESSION) and built-in (Builtin.Helpfulness→ TRACE) auto-resolve their level and write the rightconfig.derived.add online-evalTUI evaluator picker lists the managedThirdParty.*evaluators alongsideBuiltin.*.