Skip to content

refactor(models): rename ResponsesConverter to ChatCompletionsConverter - #5528

Merged
ananthsub merged 2 commits into
mainfrom
ananthsub/rename-chat-completions-converter
Nov 5, 2026
Merged

ananthsub merged 2 commits into
mainfrom
ananthsub/rename-chat-completions-converter

Conversation

@ananthsub

@ananthsub ananthsub commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

ResponsesConverter in nemo_gym/models/chat_completions_converter.py converts between the Responses API and Chat Completions. Its name only says the Responses side. That was enough when it was the only converter. Now AnthropicConverter also converts to and from the Responses API, so the name no longer says which converter it is. Every converter in nemo_gym.models has the Responses API on one side, so the name now says the API on the other side: ChatCompletionsConverter.

Part of the nemo_gym/ reorganization tracked in #5166.

Renamed

  • ResponsesConverter → ChatCompletionsConverter
  • ResponsesConverterState → ChatCompletionsConverterState (the per-conversion state the class builds; same naming problem)

Every in-repo use is updated: the nemo_gym.models public API, token capture's completion module, the inference provider model server, the Pi, OpenCode sandboxed, Hermes and three conversational tool use agents, the IHEval data preparation and tests, the partner IF judge test, and the core unit tests. The uses of the VLLMConverter and VLLMConverterResponsesToChatCompletionsState aliases also move to the new names: the vLLM, LiteLLM, Azure OpenAI and GenRM model servers, the BrowseComp, SWE, tau2, Terminus 2 and Harbor agents, their tests, the vLLM model server and SWE agent READMEs, two config comments, and the latest vLLM model server docs. Frozen docs under fern/versions/v*/ are untouched.

Left alone

  • The VLLMConverter and VLLMConverterResponsesToChatCompletionsState aliases themselves: they point at the new names, and the vLLM model server still re-exports them, so code that imports them keeps working. Nothing in the repository uses them now. Deprecating them is refactor(models): retire VLLMConverter aliases #5531, stacked on this PR.
  • AnthropicConverter: Anthropic has a single API it could convert, so the name is not ambiguous, and it matches its module.
  • The fern/docs.yml redirects for the old nemo_gym/responses_converter API page.

Compatibility

The old names resolve to the identical new objects until nemo_gym 0.10.0. The first use of each old path emits a DeprecationWarning that names the new name and the removal release. The entries are one grouped MOVED_NAMES block in nemo_gym/_moved_paths.py:

Old path Resolves to
nemo_gym.responses_converter.ResponsesConverter (released in 0.7.0) ChatCompletionsConverter
nemo_gym.responses_converter.ResponsesConverterState (released in 0.7.0) ChatCompletionsConverterState
nemo_gym.models.chat_completions_converter.ResponsesConverter ChatCompletionsConverter
nemo_gym.models.chat_completions_converter.ResponsesConverterState ChatCompletionsConverterState
nemo_gym.models.ResponsesConverter ChatCompletionsConverter
nemo_gym.models.token_capture.completion.ResponsesConverter (and its nemo_gym.token_id_capture.completion path) ChatCompletionsConverter

The completion module only imported the class, but the recorded import surface lists that name, so it keeps resolving rather than being dropped from the fixture. import_surface.json is unchanged.

Each old path warns once per process, including through the nemo_gym.models package (#5530).

Tests

The new tests in tests/unit_tests/test_moved_paths.py check, for each old path above, in a fresh interpreter, that the old name is the identical new class and that exactly one deprecation warning names the new class and the 0.10.0 removal. With the new MOVED_NAMES block removed, every one of them fails, and so does the existing check that every recorded import surface name still resolves.

Validation

pre-commit run --files <touched files>
PYTHONPATH=$PWD pytest -n 8 tests/unit_tests/models/test_chat_completions_converter.py \
  tests/unit_tests/models/test_custom_tool_function_bridge.py \
  tests/unit_tests/models/test_responses_api_model_streaming.py \
  tests/unit_tests/trajectory/test_atif_reverification.py \
  tests/unit_tests/core/test_responses_api_types.py \
  tests/unit_tests/test_moved_paths.py

All pass, as does the package layering check (import-linter), and python scripts/migrate_imports.py --check . finds nothing left to rewrite for the converter. The partner IF judge tests also pass:

PYTHONPATH=$PWD NEMO_GYM_EXTRA_ROOTS=$PWD pytest resources_servers/partner_if/tests/test_shared_judge.py

The vLLM, LiteLLM and Azure OpenAI model server tests and the BrowseComp agent tests also pass:

NEMO_GYM_EXTRA_ROOTS=$PWD pytest -n 8 responses_api_models/vllm_model/tests \
  responses_api_models/litellm_model/tests responses_api_models/azure_openai_model/tests \
  responses_api_agents/browsecomp_agent/tests

The IHEval, GenRM, SWE, tau2, Terminus 2 and Harbor tests need those servers' own dependencies, so they and the other server test suites are left to CI. The touched model servers, agents and data preparation script were imported directly, except the Hermes agent and the policy tool generation agent, whose own dependencies are not in the core venv.

Rollout evidence

N/A: a pure rename with compatibility aliases. No conversion logic, request shape or verifier behavior changes, so a model rollout would exercise identical code.

@copy-pr-bot

copy-pr-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@ananthsub
ananthsub force-pushed the ananthsub/rename-chat-completions-converter branch from aead1f6 to 1ff1187 Compare November 3, 2026 21:45
@ananthsub
ananthsub marked this pull request as ready for review November 3, 2026 21:48
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 3, 2026 23:56
@ananthsub
ananthsub force-pushed the ananthsub/rename-chat-completions-converter branch from 1ff1187 to f171d06 Compare November 4, 2026 01:00
@ananthsub
ananthsub force-pushed the ananthsub/rename-chat-completions-converter branch from f171d06 to 619a2a9 Compare November 4, 2026 20:23
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Nov 4, 2026
The class converts between the Responses API and Chat Completions, but
its name only named the Responses side. AnthropicConverter also converts
to and from the Responses API, so the old name no longer says which
converter it is. Name it for the API on the other side.

ResponsesConverterState becomes ChatCompletionsConverterState with it.
The VLLMConverter aliases now point at the new names.

The old names keep resolving, with a DeprecationWarning naming the new
name, until nemo_gym 0.10.0: at nemo_gym.responses_converter (released
in 0.7.0), nemo_gym.models.chat_completions_converter, nemo_gym.models,
and the token capture completion module, which imported the class.

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
@ananthsub
ananthsub force-pushed the ananthsub/rename-chat-completions-converter branch from 619a2a9 to 4ae5f5b Compare November 5, 2026 06:18
The VLLMConverter aliases name the same class as ChatCompletionsConverter.
Every use in the repository now names ChatCompletionsConverter: the vLLM,
LiteLLM, Azure OpenAI and GenRM model servers, the BrowseComp, SWE,
tau2, Terminus 2 and Harbor agents, their tests, READMEs, configs and
the vLLM model server docs.

The aliases themselves stay, and the vLLM model server still re-exports
them, so code that imports them keeps working.

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 5, 2026 06:25
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

@ananthsub
ananthsub merged commit 9022d42 into main Nov 5, 2026
106 of 109 checks passed
@ananthsub
ananthsub deleted the ananthsub/rename-chat-completions-converter branch November 5, 2026 07:18

This branch was previously deployed

1 inactive deployment
public — b35aa6f5 Deployed Nov 5, 2026 by copy-pr-bot[bot] via release / finalize / notify #10260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sla:triage-overdue Review assignment is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant