Skip to content

Align the interface of the uds tokenizer service with Tokenizer#257

Merged
github-actions[bot] merged 1 commit into
llm-d:mainfrom
delavet:community/uds-tokenizer-interface-align
Jan 20, 2026
Merged

Align the interface of the uds tokenizer service with Tokenizer#257
github-actions[bot] merged 1 commit into
llm-d:mainfrom
delavet:community/uds-tokenizer-interface-align

Conversation

@delavet
Copy link
Copy Markdown
Collaborator

@delavet delavet commented Jan 19, 2026

fix #207

This PR introduces two behavioral changes:

  1. The UDS tokenizer service no longer identifies the model to load from its own environment variables. Instead, it provides an InitializeTokenizer method, which allows the service to dynamically load the tokenizer for a model based on the model name passed in. This also enables us to configure the model loaded by the tokenizer through a unified configuration.
  2. The UDS tokenizer service now respects the addSpecialTokens parameter passed into the Encode method, rather than using a fixed value from the environment variables. This implementation aligns more closely with the definition of the Tokenizer interface.

Signed-off-by: 露营 <luying.yh@alibaba-inc.com>
"""Initialize service with configuration"""
self.tokenizer = self._create_tokenizer(config.model)
self.config = config
def __init__(self, config: TokenizerConfig = None):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think this module can directly reuse the vLLM wrapping defined in the preprocessing package?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It is possible. I am actually preparing another PR to make the uds tokenizer use the vLLM wrapper. If you think it's OK, I can also add this directly to this PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually, I suggest preparing another PR to replace uds_tokenizer with the vLLM wrapper after the merge of #221. This is because, in the current main branch code, the vLLM wrapper only provides the apply_chat_template method so far. What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sounds great!

@vMaroon
Copy link
Copy Markdown
Member

vMaroon commented Jan 20, 2026

/lgtm
/approve

@github-actions github-actions Bot added the lgtm Looks good to me, indicates that a PR is ready to be merged. label Jan 20, 2026
@github-actions github-actions Bot merged commit 2d261e3 into llm-d:main Jan 20, 2026
5 checks passed
guygir pushed a commit to guygir/llm-d-kv-cache-manager that referenced this pull request Apr 20, 2026
Bumps the go-dependencies group with 3 updates: [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis), [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) and [k8s.io/client-go](https://github.com/kubernetes/client-go).


Updates `github.com/alicebob/miniredis/v2` from 2.34.0 to 2.35.0
- [Release notes](https://github.com/alicebob/miniredis/releases)
- [Changelog](https://github.com/alicebob/miniredis/blob/master/CHANGELOG.md)
- [Commits](alicebob/miniredis@v2.34.0...v2.35.0)

Updates `k8s.io/apimachinery` from 0.33.2 to 0.33.3
- [Commits](kubernetes/apimachinery@v0.33.2...v0.33.3)

Updates `k8s.io/client-go` from 0.33.2 to 0.33.3
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](kubernetes/client-go@v0.33.2...v0.33.3)

---
updated-dependencies:
- dependency-name: github.com/alicebob/miniredis/v2
  dependency-version: 2.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: k8s.io/apimachinery
  dependency-version: 0.33.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-dependencies
- dependency-name: k8s.io/client-go
  dependency-version: 0.33.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Looks good to me, indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The uds tokenizer does not comply with the Tokenizer interface specification.

2 participants