Discover Packages
github.com/bethropolis/sift
internal
tokenize
package
Version:
v1.6.0
Opens a new window with list of versions in this module.
Published: Oct 9, 2026
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package tokenize counts tokens offline and fits documents to a budget.
FitToBudget greedily keeps files until the next one would exceed budget.
Files are expected to be pre-sorted by priority; it returns the kept files
and the total tokens used.
type Tokenizer struct {
}
Tokenizer counts tokens using an offline BPE encoder.
New returns a Tokenizer for the named encoding (e.g. "cl100k_base",
"o200k_base"). An empty name selects cl100k_base.
Count returns the number of tokens in text.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.