Skip to content

Add explicit token-producer backend selector#1582

Open
zhouyou9505 wants to merge 6 commits into
llm-d:mainfrom
zhouyou9505:fix/1472-token-producer-backend-selector
Open

Add explicit token-producer backend selector#1582
zhouyou9505 wants to merge 6 commits into
llm-d:mainfrom
zhouyou9505:fix/1472-token-producer-backend-selector

Conversation

@zhouyou9505

@zhouyou9505 zhouyou9505 commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

  • add an optional backend selector for the token-producer plugin
  • support explicit estimate, vllm, and uds backend selection while preserving legacy inference when omitted
  • update token-producer docs, chart docs, sample configs, and e2e config fixtures to show explicit backend selection

Fixes #1472

Validation

Local curl smoke testing with a temporary HTTP harness that loads token-producer through PluginFactory:

  • backend: estimate: POST /v1/completions returned estimated token IDs from the in-process backend
  • backend: vllm: POST /v1/completions with a local fake vLLM /render server returned token_ids: [101,102,103]
  • backend: uds: POST /v1/completions with a local fake gRPC Unix socket tokenizer returned token_ids: [201,202,203]

@github-actions github-actions Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 10, 2026
Signed-off-by: zhouyou9505 <zhouyou9505@gmail.com>
@zhouyou9505
zhouyou9505 force-pushed the fix/1472-token-producer-backend-selector branch from 04309fb to cfa3f2f Compare June 10, 2026 17:03
@zhouyou9505
zhouyou9505 marked this pull request as ready for review June 12, 2026 09:12
@zhouyou9505
zhouyou9505 requested review from a team, liu-cong, sagearc and vMaroon as code owners June 12, 2026 09:12
Co-authored-by: CodeFree <codefree@chinatelcom.cn>

Signed-off-by: zhouyou9505 <zhouyou9505@gmail.com>

@sagearc sagearc 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.

Thanks @zhouyou9505! Looks good to me overall, just left a few minor comments.

Comment on lines 85 to 86

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.

Since {"backend":"estimate","vllm":{}} is now accepted this comment is not longer true

Comment on lines +71 to +77
// Backend selection: `backend` explicitly selects the backend when set. When it
// is omitted, existing configs continue to infer the backend from `estimate`,
// `vllm`, `udsTokenizerConfig`, or `modelName`.
type tokenizerPluginConfig struct {
// Backend explicitly selects "estimate", "vllm", or "uds". When omitted,
// the plugin infers the backend from legacy config fields.
Backend tokenizerBackend `json:"backend,omitempty"`

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.

nit: duplicated explanation of the inferred backend path

// `vllm`, `udsTokenizerConfig`, or `modelName`.
type tokenizerPluginConfig struct {
// Backend explicitly selects "estimate", "vllm", or "uds". When omitted,
// the plugin infers the backend from legacy config fields.

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.

The config fields themselves are not legacy, only the implicit inference logic, right?

@zhouyou9505 zhouyou9505 Jun 25, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Correct. Got it. The fields themselves are not legacy. Only the implicit backend inference behavior is legacy and kept for backward compatibility. I will refine the description.

@github-actions

Copy link
Copy Markdown
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.

@zhouyou9505
zhouyou9505 marked this pull request as draft June 25, 2026 17:29
Signed-off-by: zhouyou9505 <zhouyou9505@gmail.com>
@zhouyou9505
zhouyou9505 force-pushed the fix/1472-token-producer-backend-selector branch from 7d8b3e5 to 69526ed Compare June 27, 2026 06:21
@zhouyou9505
zhouyou9505 marked this pull request as ready for review June 27, 2026 06:22
@zhouyou9505
zhouyou9505 requested a review from sagearc June 27, 2026 06:35
@zhouyou9505

zhouyou9505 commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@sagearc Hi, I’ve addressed the review feedback and pushed the changes. Could you please help review again? Thanks!

@zhouyou9505

Copy link
Copy Markdown
Member Author

@sagearc @vMaroon Hi, I’ve addressed the review feedback and pushed the changes. Could you please help review again? Thanks!

@sagearc

sagearc commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Thanks @zhouyou9505

@sagearc
sagearc enabled auto-merge (squash) July 8, 2026 07:19
@sagearc
sagearc disabled auto-merge July 8, 2026 09:41
@zhouyou9505
zhouyou9505 requested a review from sagearc July 14, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

token-producer: explicit backend selector field

2 participants