Repository navigation
fix(terminus_judge): define the judge server the README launch needs - #4557
Merged
Merged
Conversation
Since #825, configs/terminus_judge.yaml sends LLM-judge calls to a model server named judge_model, but the README launch command still loaded only the resources server and a policy model. Config validation rejected the dangling reference, so the documented command exited before starting. Add configs/judge_model.yaml, which defines judge_model with the openai_model adapter. It reads judge_base_url, judge_api_key, and judge_model_name, and falls back to the policy values when they are unset. The README now loads it with --config and says how to point the judge elsewhere. The shipped terminus_judge.yaml is unchanged, so recipes that supply their own judge_model are unaffected. Add a unit test that replays the README's gym env start block through the CLI and resolves the config offline. Fixes NVBug 6847480. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: qiaochuz <[email protected]>
With the README's judge budget of 512 output tokens, a reasoning model used as the judge spends the whole budget reasoning and returns no verdict, which terminus_judge scores as 0. On the five examples, all four judge calls failed this way; with 4096 tokens all five returned a verdict (1213 to 2346 output tokens). Raise the README override to 4096 and say why. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: qiaochuz <[email protected]>
Contributor
Author
|
/ok to test bffe300 |
@qiaochuz-nv, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
Contributor
Author
|
/ok to test 6614252 |
zyzhou5
approved these changes
Oct 13, 2026
zyzhou5
left a comment
Contributor
There was a problem hiding this comment.
The README launch is fixed, with regression coverage for the documented setup. Looks good to me.
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/38459098325 |
This was referenced Oct 22, 2026
qiaochuz-nv
added a commit
that referenced
this pull request
Nov 7, 2026
…reaches a verdict The README's `gym env start` gave the judge `max_output_tokens=512`. The judge is the policy model (`configs/text_to_sql.yaml` sets `judge_model_server.name: policy_model`), so with a reasoning model as the policy the judge calls stopped `incomplete` on the 512-token budget before they wrote the `[[A=B]]`/`[[A!=B]]` marker: verdict None, reward 0, and the `check_twice_swap` second judge never ran. Following the README on the five shipped examples scored 0 on every row with no verdict. Raise the documented budget to 8192. terminus_judge went to 4096 for the same reason (#4557), but here 2 of 19 rollout judge calls still ran out at exactly 4096 while completed calls reached 3783 tokens; at 8192 every call reached a verdict (largest 3500). Add `tests/unit_tests/test_text_to_sql_readme_config.py`, an offline README-replay test modeled on `test_terminus_judge_readme_config.py`: it runs the README `gym env start` block through the real CLI with dispatch intercepted, resolves the config offline with placeholder endpoints (no env.yaml/dotenv), and asserts the judge is the policy model and the budget is 8192. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: qiaochuz <[email protected]>
RyaliNvidia
pushed a commit
to RyaliNvidia/Gym
that referenced
this pull request
Nov 18, 2026
…reaches a verdict (NVIDIA-NeMo#5102) The README's `gym env start` gave the judge `max_output_tokens=512`. The judge is the policy model (`configs/text_to_sql.yaml` sets `judge_model_server.name: policy_model`), so with a reasoning model as the policy the judge calls stopped `incomplete` on the 512-token budget before they wrote the `[[A=B]]`/`[[A!=B]]` marker: verdict None, reward 0, and the `check_twice_swap` second judge never ran. Following the README on the five shipped examples scored 0 on every row with no verdict. Raise the documented budget to 8192. terminus_judge went to 4096 for the same reason (NVIDIA-NeMo#4557), but here 2 of 19 rollout judge calls still ran out at exactly 4096 while completed calls reached 3783 tokens; at 8192 every call reached a verdict (largest 3500). Add `tests/unit_tests/test_text_to_sql_readme_config.py`, an offline README-replay test modeled on `test_terminus_judge_readme_config.py`: it runs the README `gym env start` block through the real CLI with dispatch intercepted, resolves the config offline with placeholder endpoints (no env.yaml/dotenv), and asserts the judge is the policy model and the budget is 8192. Signed-off-by: qiaochuz <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch was previously deployed
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 does this PR do?
The terminus_judge README launch command works again.
configs/terminus_judge.yamlsends LLM-judge calls to a model server namedjudge_model, but the README command never defined one, sogym env startexited at config validation before any server started. Once the stack started, a second problem showed up: the README's 512-token judge budget left a reasoning judge no room to write a verdict. This PR fixes both.Fixes NVBug 6847480.
Closes #4496.
Cause
resources_servers/terminus_judge/configs/terminus_judge.yaml:5-7setsjudge_model_server.name: judge_model. The README command came in with #597, when this config graded withpolicy_model. #825 switched the config to a separatejudge_model(with therubrics_v4prompt) and moved the policy-as-judge setup toterminus_judge_simple.yaml, but left the README alone; #1630 later rewrote the command fromng_runtogym env startunchanged.--resources-server terminus_judgeloads onlyconfigs/terminus_judge.yaml, and--model-type openai_modeldefines onlypolicy_model, so startup validation raisesServerRefNotFoundError. Nothing in Gym definesjudge_modelfor this config: in-repo benchmarks useterminus_judge_string_only.yaml, and recipes that useterminus_judge.yamlbring their own judge.Fix
Add
resources_servers/terminus_judge/configs/judge_model.yaml. It definesjudge_modelwith theopenai_modeladapter and readsjudge_base_url,judge_api_key, andjudge_model_name, falling back to the matching policy value for each one that is unset. The README command loads it with--config, and a new paragraph says the judge defaults to the policy endpoint and model and how to point it elsewhere. This follows the existing opt-in judge configs (chemeval/configs/judge_model.yaml,sciknoweval/configs/judge_model.yaml,physics_judge/configs/judge_openai.yaml).terminus_judge.yamlis unchanged.The README's judge override goes from
max_output_tokens=512to4096, with a sentence on why. With 512, every judge call from a reasoning model used the whole budget on reasoning and returned no verdict, and terminus_judge scores that as 0. With 4096, every call returned a verdict after 1213 to 2346 output tokens (see Validation).Alternatives not taken, each checked offline with
GlobalConfigDictParser:judge_model: {_copy: policy_model}interminus_judge.yaml(suggested in [NVBug 6847480] Define judge_model so terminus_judge README launch works #4496). A recipe that supplies its ownjudge_modelwith a different adapter then fails to start, because the copy merges the policy's adapter into it:AlmostServerError ... responses_api_models: Dictionary should have at most 1 item after validation, not 2. With--model-type local_vllm_model, the judge becomes a second local vLLM server (gpu_memory_utilization: 0.9).judge_model_serveratpolicy_model. This undoes feat: Upstream Nemotron 3 Super envs #825's separate judge: recipes that definejudge_modelwould silently grade with the policy.Test:
tests/unit_tests/test_terminus_judge_readme_config.pytakes the README'sgym env startblock and runs it through the real CLI withdispatchintercepted. It then resolves the resulting config offline (placeholder endpoints, noenv.yaml, no servers started). It checks that the judge reference is stilljudge_model, that the README'smax_output_tokens=4096override applies, and that the judge resolves to the policy values, or to thejudge_*values when those are set. Both alternatives above fail it:_copyfails the separate-judge case, and the redirect fails both.Before the fix
Gym
bb032ae98(main), the README command from the Gym root, with placeholder policy values:Exit 1; no server starts. The new test on the same commit:
The NVBug's QA case, which runs the README flow (
gym env start, thengym eval run --agent terminus_judge_simple_agenton the five examples) against a hosted model:After the fix
This branch, the README's new command, same placeholder policy values:
The five servers are
policy_modelandjudge_model(bothopenai_model),terminus_judge_resources_server,terminus_judge_simple_agent, andterminus_judge_environment_server. That startup log is frombffe30099; the budget commit after it doesn't change startup, and the QA run below starts the same five servers at661425200. The new test:The same QA case, updated to replay the README's new command (it adds the
--config, uses the 4096 budget, expects five servers, and now also requires every judge call to return a verdict), Gym661425200:Validation
tests/unit_tests/test_cli_resources_servers.py,test_cli_main.py,test_global_config.py,test_review_policy.py,test_model_registry.py,test_cli_agents.py,test_task_data.py::TestSchemaPresence,test_ray_opt_out.py, and the new test: 483 passed.pre-commit run --all-files: passed, no changes.terminus_judge(README stack, five examples, a hosted reasoning model as policy and therefore as judge): before 0/1 (startup), after 1/1 with every judge call returning a verdict. The case change ships separately in the QA suite. It also raises the case's 180 s startup budget, which a fresh checkout's server venv installs exceed, to the 1800 s the other README cases use.judge_modelfix (bffe30099) and the old 512 budget, the QA case passed 1/1, but every judge call failed. Four rows reached the judge through the newjudge_modelserver; each reply used 512/512 output tokens on reasoning and had no verdict (judge_parsing_failed, reward 0.0). The fifth row's policy output was invalid JSON (model_output_invalid).[[A=B]]after 1213 to 2346 output tokens, and all five rewards were 1.0.661425200), the QA case above: all five rows reached the judge, and all five judge calls returned a verdict after 1195 to 2760 output tokens. Two were[[A=B]](reward 1.0) and three[[A!=B]](reward 0.0), all withmask_sample: false.Compatibility
The README command gains
--config resources_servers/terminus_judge/configs/judge_model.yaml. Configs that don't load the new file behave as before, including recipes that bring their ownjudge_model. With only policy values set, the README's judge is the policy endpoint and model (self-judging); setjudge_base_url,judge_api_key, andjudge_model_namefor an independent judge. The README's judge calls may now use up to 4096 output tokens instead of 512. The shipped config sets no judge budget, so recipes are unaffected.Not changed: a judge reply with no verdict still scores an unmasked 0 (
terminus_judge/app.py,judge_parsing_failed). Whether to setmask_samplethere is a separate scoring decision.🤖 Generated with Claude Code