feat: implemented native ctok tokenization engine with model scopes

- Implemented the `ctok` Rust native tokenization engine with offline support for Claude V3, V47, V5, and V5Sonnet families.
- Replaced global token estimation with model-scoped `Tokenizer` instances and provider-anchored transcript accounting across packages.
- Added vocabulary generation scripts, test fixtures, and comprehensive unit tests for tokenizer routing and matching modes.
This commit is contained in:
can1357
2026-08-19 23:27:29 +02:00
parent c39004063e
commit 12238f55ca
63 changed files with 6745 additions and 664 deletions
+1
View File
@@ -37,6 +37,7 @@
"test": "bun test --parallel",
"fix": "biome check --write --unsafe .",
"fmt": "biome format --write .",
"gen:ctok": "bun scripts/gen-ctok-vocab.ts",
"gen:native": "bun scripts/embed-native.ts",
"gen:native:reset": "bun scripts/embed-native.ts --reset",
"gen:npm": "bun scripts/gen-npm-packages.ts",