feat: allow deepseek_v3 architecture to use Kimi's bpe pattern - #6653
Merged
Conversation
Contributor
WalkthroughAdded support for the "deepseek_v3" model type in BPE pattern detection by expanding the model_type matching logic and configuring it to use the KIMI_PATTERN tokenizer pattern. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/llm/src/tokenizers/tiktoken.rs`:
- Line 153: Add a regression test verifying that the tokenizer mapping in
lib/llm/src/tokenizers/tiktoken.rs still returns KIMI_PATTERN for the new
"deepseek_v3" branch: create a unit test (e.g.,
test_deepseek_v3_maps_to_kimi_pattern) that exercises the match logic which
includes the arms "kimi" | "kimi_k2" | "kimi_k25" | "deepseek_v3" and asserts
the returned value equals KIMI_PATTERN (or that the tokenizer behaves
identically to the existing "kimi" cases); place the test alongside other
tiktoken tests so future edits will fail if "deepseek_v3" is removed or changed.
ziqifan617
reviewed
Feb 26, 2026
ziqifan617
approved these changes
Feb 26, 2026
alec-flowers
approved these changes
Feb 26, 2026
biswapanda
enabled auto-merge (squash)
February 26, 2026 22:17
biswapanda
added a commit
that referenced
this pull request
Mar 16, 2026
saturley-hall
pushed a commit
that referenced
this pull request
Mar 16, 2026
yao531441
pushed a commit
to yao531441/dynamo
that referenced
this pull request
May 13, 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.
Overview:
baseten-admin/Kimi-2.5-text-nvfp4-v3 model has model_type: "deepseek_v3" in its config.json because Kimi K2.5 is built on the DeepSeek V3 architecture. it still ships the Kimi tiktoken tokenizer file, so the KIMI_PATTERN BPE regex is the correct pattern to use.
No pure DeepSeek V3 model uses tiktoken.model files (they use tokenizer.json instead) so this match is safe.
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit