fix(tokenizer): convert Anthropic tools to OpenAI schema for /render#1986
Closed
dkhachyan wants to merge 2 commits into
Closed
fix(tokenizer): convert Anthropic tools to OpenAI schema for /render#1986dkhachyan wants to merge 2 commits into
dkhachyan wants to merge 2 commits into
Conversation
dkhachyan
requested review from
a team,
liu-cong,
sagearc and
vMaroon
as code owners
July 13, 2026 14:05
Contributor
|
🚨 Unsigned commits detected! Please sign your commits. For instructions on how to set up GPG/SSH signing and verify your commits, please see GitHub Documentation. |
dkhachyan
force-pushed
the
convert-anthropic-tools
branch
from
July 13, 2026 14:11
3b8cfc5 to
2bbfaf1
Compare
sagearc
reviewed
Jul 15, 2026
Contributor
There was a problem hiding this comment.
Thanks @dkhachyan, please fix your commits sign-off
https://github.com/llm-d/llm-d/blob/main/PR_SIGNOFF.md
Signed-off-by: Denis Khachyan <khachyanda@gmail.com>
dkhachyan
force-pushed
the
convert-anthropic-tools
branch
from
July 15, 2026 19:01
2bbfaf1 to
f924bca
Compare
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.
What type of PR is this?
/kind bug
What this PR does / why we need it:
Follow-up to #1896.
Anthropic Messages requests (
/v1/messages) failed tokenization against thevLLM
/renderendpoint when the request carriedtools. The router forwardedAnthropic-shaped tool definitions (
{name, description, input_schema})verbatim, but vLLM's OpenAI-compatible
/renderexpects the function schema(
{type: "function", function: {name, description, parameters}}), so itrejected the request with HTTP 400 (
Field required: body.tools[0].function).This broke the token-producer path and, in turn, precise-prefix-cache routing
for Claude Code traffic.
MessagesToRenderChatRequestnow maps Anthropic custom tools into the OpenAIfunction schema (
input_schema->parameters, nested underfunction).Tools that are already OpenAI-shaped (carry a
functionfield) or are notobject-shaped pass through unchanged.
Which issue(s) this PR fixes:
Fixes #1861