IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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 function

select_speculator

select_speculator()โ€‹

max.pipelines.lib.arch_lookup.select_speculator(target, method, draft_arch)

source

Returns the speculator target declares for method/draft_arch.

None when target declares no speculators at all, which is every target still routed by the legacy override chain โ€“ so a caller that applies the result leaves those untouched.

Both halves have to agree. Matching the draft alone runs whichever mechanism the draft checkpoint happens to fit rather than the one asked for; matching the method alone cannot separate two speculators that implement it with different drafts.

Raises:

ValueError โ€“ If target declares speculators but none accepts this method and draft together.

Parameters:

  • target (str)
  • method (Literal['eagle', 'mtp', 'dflash', 'dflash2'] | None)
  • draft_arch (str | None)

Return type:

Speculator | None