Gpt2BpeTokenizer64 is a bounded callable reference API:
- Call
Reset(). - Call
AcceptAscii(value)for every prompt byte. - Consume any transport or framing delimiters outside the tokenizer unless they belong to the input text.
- Call
Tokenize(). - Check
HasError(). - Read
GetTokenCount()and eachGetToken(index).
The tokenizer rejects bytes above 0x7f and inputs longer than 64 bytes. It
does not silently truncate them.
- Call
Gpt2BpeDecoder128.Reset()before a response. - Call
AppendToken(token)for each generated token. - Check the returned value and
HasError(). - Transmit bytes
0 .. GetByteCount() - 1withGetByte(index).
The decoder returns original bytes rather than Livt strings. This keeps output handling independent of application-specific text and byte-stream consumers.
IBpeMergeTable.Lookup(left, right) updates three readable results:
HasMerge()reports whether the pair exists;GetRank()returns a non-negative rank, where lower wins;GetMergedToken()returns the merged vocabulary token.
IGpt2Vocabulary has two lookup directions:
LookupByteandGetByteTokenprovide initial byte-level symbols;ReadToken,GetTokenLength, andGetTokenByteprovide decoded bytes.
Lookups complete before their getter is called. A memory implementation may therefore schedule multiple cycles internally without changing the caller API.
The application must generate table contents from the exact tokenizer revision paired with its model, verify checksums, and retain the tokenizer's licensing metadata. The package intentionally carries no third-party vocabulary data.