For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Python class
TokenHashOverride
TokenHashOverride
class max.pipelines.context.TokenHashOverride(*, token_idx, token_hash, source='media')
Bases: object
Content hash to use in place of a token when hashing KV-cache blocks.
The token stream itself is unchanged. The override is applied only while computing block hashes, so content that is represented by placeholder tokens can participate in prefix-cache keys.
source
source: str = 'media'
Human-readable label describing where the hash override came from (e.g. “image”, “video”).
token_hash
token_hash: int
Hash value to use at token_idx while hashing.
token_idx
token_idx: int
Index of the token to replace while hashing.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!