feat(server): reject draft-only GGUF + support --model-draft (MTP speculative decoding) - #11
Open
mrDedchai wants to merge 7 commits into
Open
feat(server): reject draft-only GGUF + support --model-draft (MTP speculative decoding)#11mrDedchai wants to merge 7 commits into
mrDedchai wants to merge 7 commits into
Conversation
…culative decoding) 2026-08-16: loading an MTP-ONLY GGUF (18 tensors — just the draft head) as the main model failed at decode with a confusing network/stream error. - backend: reject files with < 100 tensors as 'draft-only' with a clear ModelError (use a full chat model, or pass as draft via WS_MODEL_DRAFT) - backend: --model-draft <path> + --spec-type draft-mtp when a draft is configured (arg or WS_MODEL_DRAFT env) — enables MTP speculative decoding paired with a full Qwen3.8 model (Method 1 usage) - schema: ModelLoadRequest.model_draft; model_manager forwards it - 6 tests (reject 18 tensors / accept 500 / zero skip / draft flags from arg + env / no flag without draft); 495 passed (2 pre-existing simulator failures belong to the other agent's calibration commit baf4b72)
…paque (CalledProcessError without output)
…rs slower in parallel)
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.
Summary
Fixes the confusing "Network error" when loading an MTP-ONLY GGUF (e.g.
Qwen3.8-27B-MTP-ONLY-Q8_0, 18 tensors = just the spec-draft head, no transformer) as the main chat model — it has no attention/FFN weights, so decode fails server-side and the UI shows a generic network error.1. Draft-only rejection (clear error before spawn)
LlamaServerBackend.__init__now rejects files with < 100 tensors as "draft-only/MTP GGUF" with aModelErrorexplaining: use a full chat model, or pass this as--model-draft(WS_MODEL_DRAFT).GGUFParser.n_tensors(real file: MTP-ONLY = 18, full model = 1,202).2.
--model-draftsupport (MTP speculative decoding)ModelLoadRequest.model_draft(falls back toWS_MODEL_DRAFTenv), forwarded throughmodel_managerto the backend, which appends--model-draft <path> --spec-type draft-mtpto llama-server.model_path+ draft head inmodel_draft.Tests
6 new (
tests/test_model_draft.py+tests/gguf_helper.py):test_simulator_calibrationfailures belong to the other agent's commitbaf4b72— unrelated)