Documentation
¶
Overview ¶
Package tiktokenbpe loads tiktoken BPE rank files without SHA-1, so token counting works under GODEBUG=fips140=only.
github.com/pkoukk/tiktoken-go names its on-disk cache file after the SHA-1 of the rank file's URL, and crypto/sha1 panics in FIPS 140-only mode. In FIPS mode this package installs a BpeLoader that behaves like tiktoken-go's own (the same cache directory variables, download and file format) but names new cache files after the SHA-256 of the URL. It still reads a cache file stored under the SHA-1 name, such as a pre-seeded TIKTOKEN_CACHE_DIR in an air-gapped install, through a table of those names computed ahead of time, so no SHA-1 runs. Standard builds keep tiktoken-go's loader.
Import it for its side effect wherever tiktoken encodings are loaded.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.