Python class
BaseContext
BaseContextβ
class max.interfaces.BaseContext(*args, **kwargs)
Bases: Protocol
Core interface for request lifecycle management across all of MAX, including serving, scheduling, and pipelines.
This protocol is intended to provide a unified, minimal contract for request state and status handling throughout the MAX stack. Each pipeline variant (for example, text generation, embeddings, image generation) is expected to extend this interface by creating their own modality-specific context classes that implement this protocol and add additional functionality relevant to their particular use case.
The minimal interface ensures that all context types can be handled uniformly by the scheduling and serving infrastructure, while allowing pipeline-specific implementations to add their own state management, input validation, and result handling.
is_doneβ
property is_done: bool
Whether the request has completed generation.
request_idβ
property request_id: RequestID
Unique identifier for the request.
statusβ
property status: GenerationStatus
Current generation status of the request.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!