build: widen openai floor to >=2.7#142
Merged
Merged
Conversation
The floor was pinned at the version that happened to be current when the package metadata was written, not at a version the code actually needs. It blocks downstream consumers: NeMo Gym pins openai<=2.7.2, so adding nemo-switchyard to Gym is unsatisfiable today. Switchyard uses openai for request/response schema types and the async client in lib/llm_client.py. Every symbol imported resolves on 2.0.0, and the Python suite at v0.1.0 passes identically on 2.0.0, 2.2.0, 2.5.0, 2.7.2, 2.34.0 and 2.48.0 (69 passed in all six runs). The upper bound at the major version is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Lin Jia <linj@nvidia.com>
Lowering the floor all the way to 2.0.0 was more than the motivating case needs. NeMo Gym pins openai<=2.7.2, so >=2.7 is enough to make the two co-installable while keeping the supported range that much narrower. The suite at v0.1.0 passes identically on 2.7.0, 2.7.1 and 2.7.2 as it does on 2.34.0 and 2.48.0 (69 passed in every run). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Lin Jia <linj@nvidia.com>
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
WalkthroughThe project’s OpenAI dependency floor changes from version 2.34.0 to 2.7, while the ChangesOpenAI Compatibility
Estimated code review effort: 2 (Simple) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
ayushag-nv
approved these changes
Jul 24, 2026
linj-glitch
added a commit
to NVIDIA-NeMo/Gym
that referenced
this pull request
Jul 25, 2026
Users had to run pip install themselves before launch mode would work. Gym already creates a virtual environment per server and installs that server's pyproject into it, so declaring the dependency here removes the manual step without putting Switchyard anywhere near Gym's core dependencies. The published nemo-switchyard 0.1.0 declares openai>=2.34.0, which Gym's openai<=2.7.2 cannot satisfy. That floor was never a real requirement -- the suite at v0.1.0 passes identically on 2.7.0 through 2.48.0 -- and it was widened in NVIDIA-NeMo/Switchyard#142, but PyPI releases are immutable so the published artifact keeps the old metadata. A uv override neutralizes it. The override restates Gym's own openai pin rather than expressing a preference of its own, so the resolved openai is whatever Gym would have resolved anyway (2.7.2, verified). Overrides apply to every requirement for a package, not just the offending one, so omitting the ceiling would erase Gym's own and pull in a far newer openai than Gym is tested against. nemo-switchyard is pinned exactly, since the override asserts something about one specific published artifact. Both come out once a release with the widened floor ships. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Lin Jia <linj@nvidia.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.
In order to integrate into Gym, we need to widen the openai floor
What
Lowers the
openaidependency floor from>=2.34.0to>=2.7. The upper bound at the major version is unchanged, and the resolved version stays 2.34.0 — this only widens what consumers are allowed to bring.Why
The floor was set to whatever version was current when the package metadata was written, not to a version the code needs. The same pattern shows in its neighbours: every floor equals its locked version (
openai2.34.0/2.34.0,pydantic2.13.3/2.13.3,httpx0.28.1/0.28.1).It has a concrete downstream cost. NeMo Gym pins
openai<=2.7.2, so addingnemo-switchyardto Gym is unsatisfiable today:That blocks the Gym <> Switchyard integration — Gym needs to launch the proxy for router evals and, later, to import Switchyard for schema mapping. Fixing it from Gym's side instead would mean migrating Gym's openai SDK across ~27 minor versions, touching ~10 core modules that import internal type paths (
openai.types.responses.response_create_params,response_output_text_param,shared.chat_model, …). Relaxing an over-tight floor here is the cheaper and more accurate fix.>=2.7rather than lower is deliberate: it is the narrowest floor that overlaps Gym's ceiling, so the supported range grows no more than it has to.Verification
Switchyard uses openai for request/response schema types plus the async client in
lib/llm_client.py. Two checks:switchyard/resolves on 2.7.0, includingopenai.types.chat.chat_completion_message_function_tool_call, which was the one I expected to be version-gated. Zero missing modules or symbols.v0.1.0, run against the publishednemo-switchyard[server]==0.1.0wheel, is identical across every version tested:The single failure is
test_build_and_serve_registers_extra_endpoints, identical in all runs — an artifact of running the tests against the installed wheel rather than the source tree, not an openai regression.e2e,contract,getting_startedandreadmewere excluded (network / docs deps).For what it's worth the suite also passes on 2.0.0, 2.2.0 and 2.5.0, so 2.7 is a policy choice rather than a limit of the code. Happy to drop it further if reviewers prefer.
uv lock --checkpasses.Follow-up
Once this ships in a release, adding
nemo-switchyardto NeMo Gym becomes a one-line change scoped to the Switchyard model server package, rather than a change to Gym's core dependencies.🤖 Generated with Claude Code
Summary by CodeRabbit