From 1d2869c6e54d5003f3927a79efbca0fefa034a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Thu, 13 Aug 2026 13:39:16 +0200 Subject: [PATCH] spec : auto-detect mtp draft model type (#27005) --- common/speculative.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/speculative.cpp b/common/speculative.cpp index 862c4f045..cd2dfc760 100644 --- a/common/speculative.cpp +++ b/common/speculative.cpp @@ -2246,6 +2246,12 @@ std::vector common_speculative_types_from_gguf(const st const std::string arch = gguf_get_val_str(gguf_ctx.get(), arch_id); if (arch != "dflash") { + const uint32_t block_count = gguf_get_val_u32(gguf_ctx.get(), gguf_find_key(gguf_ctx.get(), (arch + ".block_count").c_str())); + + if (gguf_find_tensor(gguf_ctx.get(), ("blk." + std::to_string(block_count - 1) + ".nextn.eh_proj.weight").c_str()) >= 0) { + return { COMMON_SPECULATIVE_TYPE_DRAFT_MTP }; + } + return {}; }