For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python class
Checkpointer
Checkpointer
class max.pipelines.kv_cache.checkpoint.Checkpointer(ctx)
Bases: object
Collects lifecycle events and runs heuristics.
Initializes the checkpointer.
-
Parameters:
-
ctx (Context) – The context the heuristics read.
checkpoint()
checkpoint()
Runs each callback the step’s events triggered, once.
-
Returns:
-
The distinct checkpoints chosen.
-
Return type:
factory()
static factory()
Returns a factory to configure and build a checkpointer.
-
Return type:
handles()
handles(kind)
Returns whether any heuristic runs on events of kind.
-
Parameters:
-
kind (EventKind)
-
Return type:
record()
record(event)
Records an event for the next checkpoint step.
Call it before the request’s cache can change, for example before releasing it. Events no heuristic handles are dropped.
-
Parameters:
-
event (Event)
-
Return type:
-
None
register()
register(*heuristics)
Subscribes each of heuristics and returns this checkpointer.
-
Parameters:
-
heuristics (Heuristic)
-
Return type: