Skip to main content

Module speculative

Module speculative 

Source
Expand description

Multi-Token Prediction (MTP / NextN) support.

ik_llama.cpp’s MTP is an embedded mechanism: a single model carrying NextN prediction layers (loaded with crate::LlamaModelParams::with_mtp), driven by a low-level op-type state machine plus a common_speculative driver.

  • MtpOpType + crate::LlamaContext::set_mtp_op_type expose the raw op-type primitive (available without common).
  • MtpSpeculative (requires the common feature) is the full draft/accept driver, backed by a C++ glue over ik’s common_speculative_* (ik_llama_rs_mtp_*). It reproduces the native --spec-type mtp flow.

Structs§

MtpSpeculative
Full MTP speculative driver (requires the common feature).
MtpSpeculativeParams
Parameters for MTP speculative decoding. Mirrors the shape of llama-cpp-2’s MtpSpeculativeParams (plus temp/mtp_heads for ik’s driver).
MtpStep
Result of one MtpSpeculative::step.

Enums§

MtpOpType
MTP decode-graph operation mode (maps to ik’s llama_mtp_op_type).