Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: stop listing EAGLE3 draft files as models (#11228)
Nilay1b4e159ac39a
diff --git a/studio/backend/core/inference/llama_cpp.py b/studio/backend/core/inference/llama_cpp.pyindex 4eaa8c6c449..c42b8bc45b4 100644--- a/studio/backend/core/inference/llama_cpp.py+++ b/studio/backend/core/inference/llama_cpp.py@@ -2801,7 +2801,7 @@ def _is_mtp_model_name(model_identifier: Optional[str], gguf_path: Optional[str]# Mirrors hub.utils.gguf._DRAFTER_KINDS / _DRAFTER_DIR_KINDS.-_DRAFTER_KINDS = ("mtp", "dspark", "dflash")+_DRAFTER_KINDS = ("mtp", "dspark", "dflash", "eagle3")_DRAFTER_DIR_KINDS = ("mtp", "dspark")# Human label per resolved spec mode, for launch logging and the UI notice.@@ -2833,9 +2833,10 @@ _IMATRIX_TOKEN_RE = re.compile(r"^imatrix(?:[._\-]|$)|[._\-]imatrix$", re.IGNOREdef _is_companion_gguf_path(path: str) -> bool:"""True for a non-main GGUF: vision mmproj, a calibration imatrix, or a separatedrafter (repo-root ``mtp-*.gguf``, the ``MTP/`` subdir copies for Gemma 4, the ``dspark/``- drafters for DeepSeek V4 Flash). Mirrors hub.utils.gguf so variant resolution- never picks a companion as the main model -- a Gemma ``Q8_0`` request must not- resolve to ``MTP/...-Q8_0-MTP.gguf``, which sorts ahead of the real weight.+ drafters for DeepSeek V4 Flash, the ``eagle3-*.gguf`` draft heads). Mirrors+ hub.utils.gguf so variant resolution never picks a companion as the main model --+ a Gemma ``Q8_0`` request must not resolve to ``MTP/...-Q8_0-MTP.gguf``, which sorts+ ahead of the real weight.EXCLUSION ONLY. Use ``_is_mtp_only_drafter_path`` to pick a drafter to launch."""diff --git a/studio/backend/hub/utils/gguf.py b/studio/backend/hub/utils/gguf.pyindex fb2a20a2d89..fc9c38b2977 100644--- a/studio/backend/hub/utils/gguf.py+++ b/studio/backend/hub/utils/gguf.py@@ -107,14 +107,14 @@ def is_imatrix_filename(path: str) -> bool:# dspark and dflash are the same DeepSeek V4 Flash drafter: the folder it ships in and the architecture it reports.-_DRAFTER_KINDS = ("mtp", "dspark", "dflash")+_DRAFTER_KINDS = ("mtp", "dspark", "dflash", "eagle3")# Directories only: mtp/ and dspark/ are always a publisher's companion folder, while dflash/ is a family name a user picks for real weights._DRAFTER_DIR_KINDS = ("mtp", "dspark")def is_mtp_drafter_path(path: str) -> bool:- """True for a separate-file drafter, a companion to the main model rather than a selectable quant: the repo-root ``mtp-*.gguf`` (the Q8_0 copy unsloth ships for llama.cpp ``-hf`` auto-discovery), the ``MTP/`` subdir copies (Gemma 4) and the ``dspark/`` drafters (DeepSeek V4 Flash). Repos that bake the head into the main GGUF (Qwen) have no such file, so this is False for them. Must be excluded from main-model selection everywhere mmproj is. Matched by basename prefix, or by an exact parent dir for ``_DRAFTER_DIR_KINDS``; never a substring, since the kind names double as family names, so ``Qwen3.6-27B-MTP-Q4_K_M.gguf`` and ``Qwen3.6-35B-A3B-DFlash-Q4_K_M.gguf`` ARE the model. CANONICAL COPY. Two mirrors must change in lockstep: utils/models/model_config.py ``_is_mtp_drafter`` (utils cannot import hub) and core/inference/llama_cpp.py ``_is_companion_gguf_path`` (core avoids hub imports; bundles the mmproj check)."""+ """True for a separate-file drafter, a companion to the main model rather than a selectable quant: the repo-root ``mtp-*.gguf`` (the Q8_0 copy unsloth ships for llama.cpp ``-hf`` auto-discovery), the ``MTP/`` subdir copies (Gemma 4), the ``dspark/`` drafters (DeepSeek V4 Flash) and the ``eagle3-*.gguf`` draft heads (ggml-org gpt-oss). Repos that bake the head into the main GGUF (Qwen) have no such file, so this is False for them. Must be excluded from main-model selection everywhere mmproj is. Matched by basename prefix, or by an exact parent dir for ``_DRAFTER_DIR_KINDS``; never a substring, since the kind names double as family names, so ``Qwen3.6-27B-MTP-Q4_K_M.gguf`` and ``Qwen3.6-35B-A3B-DFlash-Q4_K_M.gguf`` ARE the model. CANONICAL COPY. Two mirrors must change in lockstep: utils/models/model_config.py ``_is_mtp_drafter`` (utils cannot import hub) and core/inference/llama_cpp.py ``_is_companion_gguf_path`` (core avoids hub imports; bundles the mmproj check)."""p = path.replace("\\", "/").lower()if not p.endswith(".gguf"):return Falsediff --git a/studio/backend/tests/test_mtp_drafter_companion.py b/studio/backend/tests/test_mtp_drafter_companion.pyindex 87d8ea89e54..fdc2c2fe92b 100644--- a/studio/backend/tests/test_mtp_drafter_companion.py+++ b/studio/backend/tests/test_mtp_drafter_companion.py@@ -1,7 +1,7 @@# SPDX-License-Identifier: AGPL-3.0-only# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0-"""Separate-file drafter contracts: MTP (Gemma 4), DSpark and DFlash.+"""Separate-file drafter contracts: MTP (Gemma 4), DSpark, DFlash and EAGLE3.Pins: the drafter-path predicate and its two layering mirrors, Gemmaeffective-size extraction, companion classification in variant plans@@ -86,6 +86,11 @@ DRAFTER_CASES = [("laguna-xs21-dflash-q4.gguf", False),("xdspark/model.gguf", False),("dspark/README.md", False),+ ("eagle3-gpt-oss-20b-Q8_0.gguf", True),+ ("EAGLE3-gpt-oss-20b-BF16.gguf", True),+ ("quants/eagle3-gpt-oss-20b-Q8_0.gguf", True),+ ("Llama-3.1-8B-Eagle3-Q4_K_M.gguf", False),+ ("eagle3/Llama-3.1-8B-Eagle3-Q4_K_M.gguf", False),]@@ -156,6 +161,25 @@ def test_variant_plans_carry_drafter_as_companion():assert q4.download_size_bytes == 4_600+GPT_OSS_FILES = [+ "eagle3-gpt-oss-20b-BF16.gguf",+ "eagle3-gpt-oss-20b-Q8_0.gguf",+ "gpt-oss-20b-MXFP4.gguf",+]+++def test_eagle3_draft_head_is_not_a_variant_or_the_default():+ from hub.utils.gguf import pick_best_gguf++ assert pick_best_gguf(GPT_OSS_FILES) == "gpt-oss-20b-MXFP4.gguf"++ plans = build_gguf_variant_plans(+ [_sib(name, 1_000, f"sha-{i}") for i, name in enumerate(GPT_OSS_FILES)]+ )+ assert set(plans) == {"mxfp4"}+ assert plans["mxfp4"].target_filenames == ("gpt-oss-20b-MXFP4.gguf",)++def test_baked_in_repo_plans_unchanged():plans = build_gguf_variant_plans([_sib("Qwen3.6-27B-MTP-Q4_K_M.gguf", 4_000, "q4")])assert plans["q4_k_m"].target_filenames == ("Qwen3.6-27B-MTP-Q4_K_M.gguf",)diff --git a/studio/backend/utils/models/model_config.py b/studio/backend/utils/models/model_config.pyindex 62c15bda804..90ef337a448 100644--- a/studio/backend/utils/models/model_config.py+++ b/studio/backend/utils/models/model_config.py@@ -1780,14 +1780,15 @@ def _is_imatrix_path(path: str) -> bool:# Mirrors hub.utils.gguf._DRAFTER_KINDS. dflash/ holds real weights, so it is a drafter by prefix only.-_DRAFTER_KINDS = ("mtp", "dspark", "dflash")+_DRAFTER_KINDS = ("mtp", "dspark", "dflash", "eagle3")_DRAFTER_DIR_KINDS = ("mtp", "dspark")def _is_mtp_drafter(path: str) -> bool:"""True for a separate-file drafter, a companion to the main model ratherthan a selectable quant: the repo-root ``mtp-*.gguf``, the ``MTP/`` subdir- copies (Gemma 4) or the ``dspark/`` drafters (DeepSeek V4 Flash).+ copies (Gemma 4), the ``dspark/`` drafters (DeepSeek V4 Flash) or the+ ``eagle3-*.gguf`` draft heads (ggml-org gpt-oss).Mirrors hub.utils.gguf.is_mtp_drafter_path (utils cannot import hub). Must beexcluded everywhere mmproj is, or the drafter leaks into variant menus (adiff --git a/unsloth_cli/commands/start.py b/unsloth_cli/commands/start.pyindex 7c5664bdba7..2d74b78b164 100644--- a/unsloth_cli/commands/start.py+++ b/unsloth_cli/commands/start.py@@ -2116,7 +2116,7 @@ def _hub_gguf_files(repo: str) -> Optional[list]:# Mirrors hub.utils.gguf._DRAFTER_KINDS / _DRAFTER_DIR_KINDS: dspark and dflash are the same DeepSeek V4 Flash drafter, but dflash/ is also a real family name, so only mtp/ and dspark/ count as a companion folder.-_DRAFTER_KINDS = ("mtp", "dspark", "dflash")+_DRAFTER_KINDS = ("mtp", "dspark", "dflash", "eagle3")_DRAFTER_DIR_KINDS = ("mtp", "dspark")diff --git a/unsloth_cli/tests/test_start.py b/unsloth_cli/tests/test_start.pyindex 29e56559864..676015e8b78 100644--- a/unsloth_cli/tests/test_start.py+++ b/unsloth_cli/tests/test_start.py@@ -7731,8 +7731,8 @@ def test_hub_gguf_files_ignores_auxiliary_ggufs(monkeypatch):assert start._hub_gguf_files("owner/mmproj-pack") == []-def test_hub_gguf_files_ignores_dspark_and_dflash_drafters(monkeypatch):- # Mirrors hub.utils.gguf.is_mtp_drafter_path: basename prefix (all three kinds) or exact+def test_hub_gguf_files_ignores_prefixed_drafters(monkeypatch):+ # Mirrors hub.utils.gguf.is_mtp_drafter_path: basename prefix (every kind) or exact# parent dir (mtp/, dspark/ only -- dflash/ is a real family name).monkeypatch.delenv("HF_HUB_OFFLINE", raising = False)monkeypatch.delenv("TRANSFORMERS_OFFLINE", raising = False)@@ -7740,10 +7740,12 @@ def test_hub_gguf_files_ignores_dspark_and_dflash_drafters(monkeypatch):"siblings": [{"rfilename": "DSpark-drafter-Q2K-Q8.gguf"},{"rfilename": "dflash-drafter-Q8_0.gguf"},+ {"rfilename": "eagle3-gpt-oss-20b-Q8_0.gguf"},{"rfilename": "dspark/DeepSeek-V4-Flash-Q8_0.gguf"},# Family names, not companions: these ARE the model.{"rfilename": "Qwen3.6-35B-A3B-DFlash-Q4_K_M.gguf"},{"rfilename": "DFlash/Qwen3.6-27B-DFlash-Q4_K_M.gguf"},+ {"rfilename": "Llama-3.1-8B-Eagle3-Q4_K_M.gguf"},]}monkeypatch.setattr(@@ -7754,6 +7756,7 @@ def test_hub_gguf_files_ignores_dspark_and_dflash_drafters(monkeypatch):assert start._hub_gguf_files("owner/dspark-pack") == ["Qwen3.6-35B-A3B-DFlash-Q4_K_M.gguf","DFlash/Qwen3.6-27B-DFlash-Q4_K_M.gguf",+ "Llama-3.1-8B-Eagle3-Q4_K_M.gguf",]