feat(tokenization): replace request_json with native proto fields in render RPCs#461
Merged
kfirtoledo merged 11 commits intollm-d:mainfrom Mar 25, 2026
Merged
feat(tokenization): replace request_json with native proto fields in render RPCs#461kfirtoledo merged 11 commits intollm-d:mainfrom
kfirtoledo merged 11 commits intollm-d:mainfrom
Conversation
|
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. |
…render RPCs Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
6d74825 to
8532ac7
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the tokenizer gRPC API to replace request_json inputs for render RPCs with structured protobuf fields, and extends ChatMessage to represent multimodal content (text + image blocks) directly in proto.
Changes:
- Replace
request_jsoninRenderChatCompletionRequest/RenderCompletionRequestwith native proto fields (messages/tools/template options, prompt, etc.). - Extend
ChatMessagewithcontent_partsplus newContentPart/ImageUrlmessages to support multimodal inputs. - Regenerate protobuf Go bindings and update tokenizer UDS tests/code to use the new optional-string
contentaccessor.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/tokenization/uds_tokenizer_test.go | Updates mock rendering to use GetContent() for optional proto field access. |
| pkg/tokenization/uds_tokenizer.go | Updates ChatMessage.Content assignment for new optional string field (currently introduces a pointer-to-range-variable bug). |
| api/tokenizerpb/tokenizer.proto | Adds multimodal message types; replaces JSON request fields with structured fields; adds render RPCs. |
| api/tokenizerpb/tokenizer.pb.go | Regenerated Go protobuf bindings reflecting the updated proto schema. |
| api/tokenizerpb/tokenizer_grpc.pb.go | Regenerated Go gRPC bindings; adds new RPC client/server methods. |
| api/indexerpb/indexer_grpc.pb.go | Regenerated header/version metadata only. |
| api/indexerpb/indexer.pb.go | Regenerated header/version metadata only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
vMaroon
reviewed
Mar 25, 2026
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
Member
|
/lgtm |
sagearc
added a commit
to sagearc/llm-d-kv-cache-manager
that referenced
this pull request
Mar 25, 2026
…render RPCs (llm-d#461) * feat(tokenization): replace request_json with native proto fields in render RPCs Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * add multimodal content type Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * populate content parts in chat message proto Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * add ContentPartList wrapper and use oneof for ChatMessage content Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * update uds_tokenizer to use oneof content types Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * remove detail field from ImageUrl Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * remove Detail from ImageBlock, add PlainText helper, fix MarshalJSON Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * remove deprecated json string Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * fix indices in proto Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * cr review Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * trace verbosity Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> --------- Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
sagearc
added a commit
to sagearc/llm-d-kv-cache-manager
that referenced
this pull request
Mar 25, 2026
…render RPCs (llm-d#461) * feat(tokenization): replace request_json with native proto fields in render RPCs Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * add multimodal content type Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * populate content parts in chat message proto Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * add ContentPartList wrapper and use oneof for ChatMessage content Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * update uds_tokenizer to use oneof content types Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * remove detail field from ImageUrl Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * remove Detail from ImageBlock, add PlainText helper, fix MarshalJSON Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * remove deprecated json string Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * fix indices in proto Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * cr review Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> * trace verbosity Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> --------- Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
This was referenced Mar 25, 2026
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.
RenderChatCompletionRequestandRenderCompletionRequestpreviously used arequest_jsonstring field, requiring callers to manually marshal OpenAI types to JSON. This replaces those fields with native proto types so callers work directly with structured proto messages.RenderChatCompletionRequestnow hasmessages,tools,chat_template,add_generation_prompt,continue_final_message, andchat_template_kwargs.RenderCompletionRequestnow haspromptandmodel_name.ChatMessageis also extended to support multimodal content viacontent_parts(text + image_url blocks), consistent with the multimodal work in #219.Ref: vllm-project/vllm#36102
Closes #449