Skip to content

Add --tool-args-object to serve tool call arguments as objects, revert to OpenAI compatible mode by default (return as strings)#20202

Closed
pwilkin wants to merge 2 commits intoggml-org:masterfrom
pwilkin:tool-args-compat
Closed

Add --tool-args-object to serve tool call arguments as objects, revert to OpenAI compatible mode by default (return as strings)#20202
pwilkin wants to merge 2 commits intoggml-org:masterfrom
pwilkin:tool-args-compat

Conversation

@pwilkin
Copy link
Copy Markdown
Member

@pwilkin pwilkin commented Mar 7, 2026

Currently, due to testing with numerous clients, the behavior of the API has been changed to output tool call arguments as JSON objects. However, this breaks compatibility with several clients that actually do expect OpenAI-compatible behavior. Therefore, I'm adding the option to return the OpenAI-compatible version via --tool-args-compat (or -tac for short).

@pwilkin pwilkin requested review from ggerganov and ngxson as code owners March 7, 2026 17:17
@pwilkin
Copy link
Copy Markdown
Member Author

pwilkin commented Mar 7, 2026

Fixes #20198

@pwilkin pwilkin requested a review from aldehir March 7, 2026 17:17
@github-actions github-actions Bot added testing Everything test related examples server labels Mar 7, 2026
@aldehir
Copy link
Copy Markdown
Contributor

aldehir commented Mar 7, 2026

This should only ever be a string. Why was it changed?

@pwilkin
Copy link
Copy Markdown
Member Author

pwilkin commented Mar 7, 2026

@aldehir because a lot of tools actually expect this to be an object (we had a discussion on it some time ago).

@aldehir
Copy link
Copy Markdown
Contributor

aldehir commented Mar 7, 2026

It's not the spec. I've yet to experience a client that requires it be an object. We need to revert this entirely ASAP.

I was under the impression that we had to parse the string as JSON before feeding it to the template. Not introduce an API change.

Who are the offending clients?

@pwilkin
Copy link
Copy Markdown
Member Author

pwilkin commented Mar 7, 2026

Okay, let's do it this way - I'll make the string behavior the default and change the switch, that way it'll make the OAI-compat behavior the default.

@pwilkin
Copy link
Copy Markdown
Member Author

pwilkin commented Mar 7, 2026

You're right, we shouldn't introduce backwards-incompatible changes.

@pwilkin pwilkin changed the title Add --tool-args-compat to serve tool call arguments in OpenAI compatible mode (as strings) Add --tool-args-object to serve tool call arguments as objects, revert to OpenAI compatible mode by default (return as strings) Mar 7, 2026
@pwilkin
Copy link
Copy Markdown
Member Author

pwilkin commented Mar 7, 2026

Aight, going to just go with the simple revert for now.

@pwilkin pwilkin closed this Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples server testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants