feat(gallery): add Gemma 4 llama.cpp MTP variants; fix gemmable-4-12b-mtp#10876
Merged
Conversation
…-mtp Google shipped the Gemma 4 MTP drafter heads and llama.cpp merged native support in ggml-org/llama.cpp#23398. LocalAI's pinned llama.cpp already carries it, and the config plumbing (draft_model + core/config/mtp.go) was built for exactly this path, but no official Gemma 4 gallery entry wired it up. Add llama.cpp draft-mtp speculative-decoding variants for the dense sizes, sourced from the unsloth QAT GGUF repos (target UD-Q4_K_XL + mtp-*.gguf drafter + BF16 mmproj): - gemma-4-e2b-it-qat-mtp - gemma-4-e4b-it-qat-mtp - gemma-4-12b-it-qat-mtp - gemma-4-31b-it-qat-mtp These replace the previously commented-out attempts, which were disabled because the Janvitos/boxwrench drafter GGUFs declared the architecture as `gemma4_assistant` (underscore) and failed to load on stock llama.cpp. The unsloth drafters use the upstream `gemma4-assistant` (hyphen) spelling that mtp.go's isDraftOnlyAssistantArch expects, so they load without any backend patch. The 26B-A4B MoE is intentionally omitted (the upstream PR reports no meaningful MTP speedup for it). Also fix gemmable-4-12b-mtp: it loaded the draft-only `-mtp` GGUF as the main model with no draft_model set, which cannot run standalone. It now loads the target as the model, wires the drafter via draft_model, enables spec_type:draft-mtp, and downloads both files. All sha256 pins were taken from the HuggingFace API lfs.oid (reliable content hash even for Xet-backed repos). Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude:claude-opus-4-8 [Claude Code]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wire up native llama.cpp Multi-Token Prediction (MTP) speculative decoding for the official Gemma 4 models in the gallery.
Google shipped the Gemma 4 MTP drafter heads and llama.cpp merged native support in ggml-org/llama.cpp#23398 (merged 2026-06-07). LocalAI's pinned llama.cpp is well past that merge and the config plumbing (
draft_model+core/config/mtp.go) already exists, but no official Gemma 4 entry used it.Added (dense sizes, unsloth-sourced: target
UD-Q4_K_XL+mtp-*.ggufdrafter + BF16 mmproj)gemma-4-e2b-it-qat-mtpgemma-4-e4b-it-qat-mtpgemma-4-12b-it-qat-mtpgemma-4-31b-it-qat-mtpThese replace the previously commented-out/disabled attempts. Those were disabled because the Janvitos/boxwrench drafter GGUFs declared architecture
gemma4_assistant(underscore), which stock llama.cpp rejects. The unsloth drafters use the upstreamgemma4-assistant(hyphen) spelling thatmtp.go'sisDraftOnlyAssistantArchexpects, so they load without any backend patch (verified by GGUF header inspection).The 26B-A4B MoE is intentionally omitted — the upstream PR reports no meaningful MTP speedup for it.
Fixed:
gemmable-4-12b-mtpIt loaded the draft-only
-mtpGGUF as the main model with nodraft_modelset (a draft-only head cannot run standalone). Now it loads the target as the model, wires the drafter viadraft_model, enablesspec_type:draft-mtp, and downloads both files.Verification
sha256pins taken from the HuggingFace APIlfs.oid(reliable content hash even for Xet-backed repos).gemma4-assistant(hyphen) via GGUF header range-fetch.gallery/index.yamlparses; all new entries resolve model/draft/mmproj/files correctly.Caveats
🤖 Generated with Claude Code