Skip to content

Update Extensions for Harmony/GPT-OSS Tool Calling Support - #2200

Merged
kunal-vaishnavi merged 7 commits into
mainfrom
sayanshaw/harmony-tool-calling
Jun 10, 2026
Merged

Update Extensions for Harmony/GPT-OSS Tool Calling Support#2200
kunal-vaishnavi merged 7 commits into
mainfrom
sayanshaw/harmony-tool-calling

Conversation

@sayanshaw24

@sayanshaw24 sayanshaw24 commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Update ort-extensions for Harmony/GPT-OSS tool calling support

Summary

Updates the ort-extensions dependency to include the merged Skip Tool Normalization for GPT-OSS/Harmony Templates PR, and adds a tools-only path to model-qa.py for models that handle tool calling natively via their chat template (without constrained decoding).

Changes

File Change
cmake/deps.txt Update onnxruntime_extensions SHA to 97809255e4cfc6fdee2b32d565935067c0309f8b (includes Harmony skip-normalization fix)

Context

GPT-OSS (Harmony) models use chat templates that access tool.function directly, expecting the raw OpenAI tool format. The previous NormalizeTools() logic in ort-extensions unwrapped the function object, breaking these templates. The updated extensions commit skips normalization when the template content indicates it expects raw tool objects.

Testing

  • E2E validated against gpt-oss-20b-generic-cpu in Foundry Local with full tool-call round-trip (tool call generation → tool execution → final response)
  • Extensions PR passed all CI tests including new Harmony-specific unit tests

Related PRs

Copilot AI review requested due to automatic review settings June 8, 2026 22:39
@sayanshaw24
sayanshaw24 requested a review from a team as a code owner June 8, 2026 22:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the onnxruntime-extensions dependency and extends the Python model-qa.py example to support “tools-only” tool calling flows used by Harmony/GPT-OSS chat templates (i.e., passing tools via the tools parameter to apply_chat_template without embedding them into the message list).

Changes:

  • Bump onnxruntime_extensions to commit 97809255e4cfc6fdee2b32d565935067c0309f8b (includes Harmony/GPT-OSS skip-normalization behavior).
  • Add an elif args.tools_file branch in examples/python/model-qa.py to load tools from a file even when constrained decoding guidance isn’t enabled.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
cmake/deps.txt Updates the pinned onnxruntime_extensions git commit to a newer revision.
examples/python/model-qa.py Adds a tools-only path to pass tools into apply_chat_template for native tool-calling templates.

@sayanshaw24
sayanshaw24 enabled auto-merge (squash) June 9, 2026 18:47
@kunal-vaishnavi
kunal-vaishnavi disabled auto-merge June 10, 2026 21:44
@kunal-vaishnavi
kunal-vaishnavi merged commit b8a7848 into main Jun 10, 2026
15 of 19 checks passed
@kunal-vaishnavi
kunal-vaishnavi deleted the sayanshaw/harmony-tool-calling branch June 10, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants