Skip to content

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.

Studio downloads: skip the GGUF requirement lookup on scoped progress polls (#17028)

Daniel Han2b1391b5b65d
diff --git a/studio/backend/hub/services/models/gguf_variants.py b/studio/backend/hub/services/models/gguf_variants.py
index 107b3335095..3bc0f55b777 100644
--- a/studio/backend/hub/services/models/gguf_variants.py
+++ b/studio/backend/hub/services/models/gguf_variants.py
@@ -230,6 +230,9 @@ def gguf_variant_requirements(
variant: str,
hf_token: Optional[str] = None,
) -> Optional[_GgufVariantRequirement]:
+ # A scope is never in the repo's quant listing, so it would miss the cache and refetch model_info every call.
+ if _is_scope_key(variant):
+ return None
key = _variant_hash_cache_key(repo_id, variant, hf_token)
cached = _variant_requirement_cache_get(key)
if cached is not None:
diff --git a/studio/backend/hub/tests/test_scoped_progress_identity.py b/studio/backend/hub/tests/test_scoped_progress_identity.py
index 04e3d67457f..297935d62c5 100644
--- a/studio/backend/hub/tests/test_scoped_progress_identity.py
+++ b/studio/backend/hub/tests/test_scoped_progress_identity.py
@@ -10,6 +10,8 @@ from hub.services import snapshot_progress
from hub.services.models import downloads
from hub.utils import download_manifest
+_real_requirements = downloads.gguf_variants.gguf_variant_requirements
+
@pytest.fixture
def scoped_progress(monkeypatch, tmp_path):
@@ -216,3 +218,23 @@ def test_offline_variant_manifest_does_not_shrink_hint(scoped_progress):
result = case.poll(670, "Q6_K")
assert result["expected_bytes"] == 670
assert result["complete_on_disk"] is False
+
+
[email protected]("scope", ["@diffusion", "@audio", "@hub-assets"])
+def test_scoped_poll_does_not_fetch_model_info(monkeypatch, scoped_progress, scope):
+ case = scoped_progress
+ case.metadata.scoped_files = ()
+ gv = downloads.gguf_variants
+ monkeypatch.setattr(gv, "gguf_variant_requirements", _real_requirements)
+ fetched = []
+ monkeypatch.setattr(
+ gv, "_fetch_gguf_variant_requirements", lambda repo, *a, **k: fetched.append(repo) or {}
+ )
+ (case.blobs / "new.incomplete").write_bytes(b"n" * 20)
+ for _ in range(3):
+ result = case.poll(700, scope)
+ assert fetched == []
+ assert result["expected_bytes"] == 700
+ assert result["downloaded_bytes"] == 0
+ case.poll(700, "Q6_K")
+ assert fetched == ["Org/Model"]