-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add GPT-OSS tool calling support #5464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
4b3aa51
Narrow prefix-preserving check to the actual requirement
qgallouedec 0894910
Merge branch 'main' into narrow-prefix-preserving-check
qgallouedec 730070b
Update chat template examples to use multiplication function calls
qgallouedec 4622d77
style
qgallouedec 08d4c51
Move chat templates from inline strings to `.jinja` files
qgallouedec 276559d
tools in dummy
qgallouedec 673c35d
Add chat template files to MANIFEST.in
qgallouedec 604c476
Enhance chat template handling to include tool call formatting in mes…
qgallouedec 83a7ef6
align grpo and async
qgallouedec 0f28384
Merge branch 'main' into chat-templates-files
qgallouedec e5d7cdf
revert no content
qgallouedec a618809
docstyle ignore
qgallouedec a0b81b1
Merge branch 'main' into chat-templates-files
qgallouedec 67ab0af
Merge branch 'main' into chat-templates-files
qgallouedec b18e39e
Add GPT-OSS tool calling support
qgallouedec 71ce5a0
fix gpt oss
qgallouedec 8f1ad1e
Update tool suffix ID retrieval to use actual tool names for GPT-OSS …
qgallouedec 9b9771d
style
qgallouedec b3f4481
align async
qgallouedec 76a0f66
Merge branch 'main' into gpt-oss-tool-calling
qgallouedec 0890038
Merge branch 'main' into gpt-oss-tool-calling
qgallouedec 3253602
style
qgallouedec b95dbec
Merge branch 'main' into gpt-oss-tool-calling
qgallouedec ec81a1e
Merge branch 'main' into gpt-oss-tool-calling
qgallouedec 450b9ef
Merge branch 'main' into gpt-oss-tool-calling
qgallouedec 392dece
Apply suggestions from code review
qgallouedec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefix-preserving check diverges from suffix extraction construction
Low Severity
is_chat_template_prefix_preservingstill uses a hardcoded"dummy"tool name, while_get_tool_suffix_idswas changed to use the real tool name viatool_messages[0]["name"]. The comment on line 350 explicitly states "Use the same dummy messages as_get_tool_suffix_ids", but the constructions now differ. For GPT-OSS, the tool name is embedded in the rendered text (e.g.to=functions.NAME), so the validation function is no longer testing the exact property that_get_tool_suffix_idsrelies on.Additional Locations (2)
trl/trainer/grpo_trainer.py#L1418-L1419trl/experimental/async_grpo/async_rollout_worker.py#L559-L560Reviewed by Cursor Bugbot for commit 450b9ef. Configure here.