Repository navigation
feat(agentic_if_realworld): accept medium and high effort, hosted APIs and an output-token limit - #7279
feat(agentic_if_realworld): accept medium and high effort, hosted APIs and an output-token limit#7279jialeiwang wants to merge 1 commit into
Conversation
…s and an output-token limit The adaptive driver accepted a policy reasoning effort of null or max only, read it only from chat_template_kwargs, and always asked for up to 131072 output tokens. - Efforts: medium, high and max are accepted, each with its own profile name (adaptive_first_complete_<effort>_effort_v1). For an effort unset or max in chat_template_kwargs the profile name, the schedule and every run setting but the runtime identity are unchanged. The runtime identity covers the source files, so a run started on an earlier revision needs a new run directory, as after any change. - Hosted APIs: an endpoint that refuses chat_template_kwargs reads the request's own reasoning_effort. With vllm_model the driver now also reads the effort from extra_body.reasoning_effort, names the profile from it, and refuses an effort set in both places. - Output-token limit: the Resources Server setting policy_output_token_limit keeps every scheduled attempt at or below a model's own limit. It is recorded in the run settings only when set, and only the adaptive driver of the config.yaml profile reads it. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: Jialei Wang <[email protected]>
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
LGTM, but please take a look at the following findings:
- The new effort cases bypass configuration validation (finding).
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
|
|
||
| @pytest.mark.parametrize("reported", [None, {"prompt_tokens": 10, "completion_tokens": 2, "total_tokens": 12}]) | ||
| @pytest.mark.parametrize("reasoning_effort", [None, "max"]) | ||
| @pytest.mark.parametrize("reasoning_effort", [None, "medium", "high", "max"]) |
There was a problem hiding this comment.
NOTE (low risk)
What I tested
I ran the updated adapter tests against head and base. I also constructed TextModelConfig with medium and high.
What I found
Both test runs report 9 passed, although base rejects both efforts through the real config. SimpleNamespace bypasses validation, so removing the newly supported values would leave these cases green.
What I recommend
As a suggestion, construct a real TextModelConfig in these parameterized cases. Assert both efforts are accepted before checking the outgoing request and usage.
What changed
The adaptive driver of
agentic_if_realworldaccepted a policy reasoning effort of null ormaxonly, read it only from
chat_template_kwargs, and always asked for up to 131072 output tokens.Three things could therefore not run: a model at
mediumorhigheffort, a hosted API thatrefuses
chat_template_kwargs, and a model whose own output-token limit is below 131072.medium,highandmaxare accepted, each with its own profile name:adaptive_first_complete_<effort>_effort_v1. Any other effort is refused before any work, asbefore.
agentic_if_text(theraw_receipt.yamlprofile) accepts the same three.vllm_modelthe driver also reads the effort fromextra_body.reasoning_effort, which the model server sends as the request's ownreasoning_effort, and names the profile from it. An effort set in bothchat_template_kwargsandextra_bodyis refused.policy_output_token_limitkeeps everyscheduled attempt at or below a model's own limit: at 128000 the schedule is
(17,32768), (17,65536), (17,128000), (29,128000), (43,128000). Seeds and the number of attempts do notchange, so a limit at or below 65536 repeats one request in consecutive attempts. The limit is
part of the run settings and of each task's fingerprint, so a resume across a different limit
is rejected. Only the adaptive driver of the
config.yamlprofile reads it; the driver refusesit with
agentic_if_text, whose server checks each attempt against the fixed schedule, andnative.yamldoes not use it.Temperature 0.7, the seeds, the wrapper, the criteria and the judge settings are unchanged.
Why
The benchmark is run for model comparisons at each reasoning effort a model offers, and against
models reached through an OpenAI-compatible gateway. One such model refuses
chat_template_kwargs("Extra inputs are not permitted") and refusesmax_tokensabove 128000,so the last three scheduled attempts could never be sent. No issue is linked: the limits are in
the driver's own checks, shown in the diff.
Compatibility and benchmark-result impact
maxinchat_template_kwargs, the profile name, theschedule and every run setting but the runtime identity are unchanged, and no score changes.
The runtime identity covers the source files, so a run started on an earlier revision needs a
new run directory, as after any change.
vllm_modelrun that already setextra_body.reasoning_effortwas recorded underadaptive_first_complete_v1although it sent an effort. It now gets the effort's profile name,so a resume of such a run is rejected (new run directory), and values other than
medium,highormaxare refused.policy_output_token_limitis recorded only when set.mediumorhigh, or at an output-token limit, is a different profile from thefrozen
maxand unset ones: compare like with like.Validation
pytest resources_servers/agentic_if_realworld/tests responses_api_models/agentic_if_text/tests:414 passed.
highon theraw_receipt.yamlprofile and atmedium,highand unset on
config.yaml; the effort reaching the engine aschat_template_kwargs.reasoning_effortor as the request'sreasoning_effort, never both; thesecond attempt asking for the limit instead of 65536; the run record keeping the limit; a
resume at another limit rejected; eight refusals before any work (unknown efforts, both
places, a non-positive or non-integer limit, the limit with
agentic_if_text);schedule()at no limit, at 131072 and at 128000.
ruff check,ruff format --checkandpre-commit run --files <the 11 changed files>pass.Rollout evidence
Eight-task smoke on this commit,
config.yamlprofile, a hosted model behind an OpenAI-compatiblegateway that refuses
chat_template_kwargsand more than 128000 output tokens, withextra_body.reasoning_effort: maxandpolicy_output_token_limit: 128000:adaptive_first_complete_max_effort_v1andpolicy_output_token_limit: 128000.reasoning_effortwas accepted andreasoning was on. Five tasks completed on the first attempt (cap 32768) and three on the
second (cap 65536).
Rollouts hold private input traces and are not attached; the numbers above are aggregates.