Provide the V1 tokenizer inventory activation bridge - #1168
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change scans GGUF tokenizer data, stores the converted inventory in ChangesTokenizer inventory flow
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant TokenizerCapability
participant ModelServingHooksFactory
participant ActivationInventory
participant NativePlugin
TokenizerCapability->>ModelServingHooksFactory: provide optional tokenizer inventory
ModelServingHooksFactory->>ActivationInventory: convert inventory to ABI entries
ActivationInventory->>NativePlugin: pass borrowed TokenizerInventoryView
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
|
This pull request is currently a draft. Reviews will not take place until the PR is marked as ready for review. |
18aeb33 to
5303997
Compare
04efbfa to
05b4afe
Compare
e979b9f to
7ef248f
Compare
05b4afe to
fac223c
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/mesh-native-serving-plugin-api/src/lib.rs`:
- Line 193: Preserve the existing V1 ActivationContext field order by removing
tokenizer_inventory from its current position before the legacy fields and
appending it after monotonic_now_ns. Keep all existing V1 members at their
original offsets; only add the new field as a trailing extension, unless this
change is explicitly converted to a separate V2 table.
In `@crates/skippy-server/src/tokenizer.rs`:
- Around line 189-196: Update source_gguf_path to validate each candidate path
independently and return the first one that is an existing file, allowing
model_path to be selected when source_model_path is unavailable. Add a
regression test covering an invalid source_model_path alongside a valid
model_path and verify the valid fallback is returned.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 099a90fd-c8b4-4632-a08b-443df9dd1f55
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (7)
crates/mesh-native-serving-plugin-api/README.mdcrates/mesh-native-serving-plugin-api/src/lib.rscrates/mesh-native-serving-plugin-host/README.mdcrates/mesh-native-serving-plugin-host/src/lib.rscrates/model-artifact/src/gguf.rscrates/skippy-server/Cargo.tomlcrates/skippy-server/src/tokenizer.rs
|
@coderabbitai what does exposing the tokenizer allow plugins to potentially do / add as features? Can you provide some examples along with your summary? |
|
Tip For best results, initiate chat on the files or code changes.
A plugin receives:
This prevents a plugin from assuming that a token ID, token boundary, or special token has the same meaning across models. Potential plugin features include:
PR summaryPR During activation, Mesh scans the GGUF tokenizer vocabulary and creates an immutable inventory. Mesh then passes a borrowed Plugins must copy or transform the inventory before You are interacting with an AI system. |
👀 |
Purpose
Provide the V1 native-serving-plugin activation contract for tokenizer-aware serving plugins.
Design
ActivationContextcarries a borrowedTokenizerInventoryViewwith native token IDs, byte pieces, and control-token identities.activatereturns.mesh_native_serving_plugin_v1.Use
A tokenizer-aware plugin can build an immutable native-token table during activation. Vocabulary discovery and table construction therefore complete before the proposal/decode path.
Dependency
This draft is based on #1149, which provides the native serving-plugin host and generation lifecycle.
Validation
just with-lld cargo test -p model-artifact -p mesh-native-serving-plugin-host -p skippy-serverjust with-lld cargo clippy -p model-artifact -p mesh-native-serving-plugin-host -p skippy-server -- -D warningsSummary by CodeRabbit
New Features
Bug Fixes
Documentation