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 video: MiniMax-H3 cache-only loads name the missing file and how to fix it (#15547)

Daniel Hanf55886cd84b1
diff --git a/studio/backend/core/inference/video.py b/studio/backend/core/inference/video.py
index 43a95b1c691..c71178bf4ca 100644
--- a/studio/backend/core/inference/video.py
+++ b/studio/backend/core/inference/video.py
@@ -5606,6 +5606,7 @@ class VideoBackend:
H3_GGUF_REPO,
h3_component_metadata_repo,
h3_download_error,
+ h3_offline_miss_error,
h3_text_encoder_filename,
)
from utils.hf_xet_fallback import hf_hub_download_with_xet_fallback
@@ -5795,6 +5796,9 @@ class VideoBackend:
)
)
except Exception as exc: # noqa: BLE001 -- re-raised below, narrowed by name
+ # Cache-only miss: huggingface_hub's LocalEntryNotFoundError does not say how to recover.
+ if local_files_only and VideoBackend._te_fetch_miss(exc, local_files_only = True):
+ raise h3_offline_miss_error(repo, wanted) from exc
raise h3_download_error(repo, wanted, exc) from exc
resolved.append(local)
diff --git a/studio/backend/core/inference/video_minimax_h3.py b/studio/backend/core/inference/video_minimax_h3.py
index 4b0d6b88758..ec18486416d 100644
--- a/studio/backend/core/inference/video_minimax_h3.py
+++ b/studio/backend/core/inference/video_minimax_h3.py
@@ -1101,6 +1101,25 @@ def validate_h3_transformer_filename(filename: str) -> None:
)
+def _h3_role(filename: str) -> str:
+ return {
+ H3_VIDEO_VAE: "video VAE",
+ H3_AUDIO_VAE: "audio VAE",
+ H3_QWEN_Q2: "text encoder",
+ H3_QWEN_Q4: "text encoder",
+ }.get(filename, "denoiser")
+
+
+def h3_offline_miss_error(repo_id: str, filename: str) -> RuntimeError:
+ """A cache-only load (offline, or an auto-switch) missing an H3 file, e.g. VAEs cached before the vae/official/ move."""
+ return RuntimeError(
+ f"MiniMax-H3 needs its {_h3_role(filename)} ({filename}) from {repo_id}, and it is not in the local "
+ "Hugging Face cache. This load may only use cached files (offline, or a load Studio started on its own), "
+ "so it could not download it. Load MiniMax-H3 once while online (or reconnect) so Studio can fetch it; "
+ "after that it loads offline."
+ )
+
+
def h3_download_error(repo_id: str, filename: str, exc: Exception) -> Exception:
"""Returns (never raises) an H3 access error naming repo and component, since private/gated look like not-found; other errors pass through unchanged."""
from huggingface_hub.errors import GatedRepoError, RepositoryNotFoundError
@@ -1108,12 +1127,7 @@ def h3_download_error(repo_id: str, filename: str, exc: Exception) -> Exception:
if not isinstance(exc, (RepositoryNotFoundError, GatedRepoError)):
return exc
- role = {
- H3_VIDEO_VAE: "video VAE",
- H3_AUDIO_VAE: "audio VAE",
- H3_QWEN_Q2: "text encoder",
- H3_QWEN_Q4: "text encoder",
- }.get(filename, "denoiser")
+ role = _h3_role(filename)
gated = isinstance(exc, GatedRepoError)
detail = (
"accept its licence on the Hub, then set a token in Settings"
diff --git a/studio/backend/tests/test_sd_cpp_h3_matrix.py b/studio/backend/tests/test_sd_cpp_h3_matrix.py
index 2ea0474c89f..7f07038ac2d 100644
--- a/studio/backend/tests/test_sd_cpp_h3_matrix.py
+++ b/studio/backend/tests/test_sd_cpp_h3_matrix.py
@@ -462,3 +462,64 @@ def test_h3_revet_does_not_invent_a_change_for_an_unrecorded_tree(
monkeypatch.setattr(xet, "hf_hub_download_with_xet_fallback", _download)
host.run()
+
+
+def _h3_load_with_vae_fetch(monkeypatch, h3_host, error, *, local_files_only):
+ """Run a native H3 load whose video VAE fetch raises ``error``; the other files resolve."""
+ from core.inference.video_minimax_h3 import H3_VIDEO_VAE
+ import utils.hf_xet_fallback as xet
+
+ h3_host(platform = "linux", backend = "cpu", device = "cpu", help_text = _H3_HELP)
+ real_download = xet.hf_hub_download_with_xet_fallback
+
+ def _download(repo, wanted, *args, **kwargs):
+ if wanted == H3_VIDEO_VAE:
+ raise error
+ return real_download(repo, wanted, *args, **kwargs)
+
+ monkeypatch.setattr(xet, "hf_hub_download_with_xet_fallback", _download)
+ fam = _detect_load_family(H3_REPO, None, "minimax-h3")
+ VideoBackend()._run_load_h3_native(
+ fam = fam,
+ token = None,
+ cancel_event = threading.Event(),
+ repo_id = H3_REPO,
+ gguf_filename = H3_FILE,
+ local_files_only = local_files_only,
+ )
+
+
+def test_h3_cache_only_load_names_the_missing_vae_and_the_fix(h3_host, monkeypatch):
+ """VAEs cached before the vae/official/ move miss on a cache-only load; say which file and how to fetch it."""
+ from huggingface_hub.errors import LocalEntryNotFoundError
+
+ from core.inference.video_minimax_h3 import H3_VIDEO_VAE
+ from hub.utils.hf_errors import modelscope_missing
+ from utils.native_path_leases import redact_native_paths
+
+ with pytest.raises(RuntimeError) as caught:
+ _h3_load_with_vae_fetch(
+ monkeypatch, h3_host, LocalEntryNotFoundError("cannot find"), local_files_only = True
+ )
+ text = str(caught.value)
+ assert f"video VAE ({H3_VIDEO_VAE})" in text
+ assert "Load MiniMax-H3 once while online (or reconnect)" in text
+ assert isinstance(caught.value.__cause__, LocalEntryNotFoundError)
+ # The load worker stores exactly this as the progress error the UI and API read.
+ assert (modelscope_missing(caught.value) or redact_native_paths(text)) == text
+
+
+def test_h3_online_load_miss_is_unchanged(h3_host, monkeypatch):
+ from huggingface_hub.errors import LocalEntryNotFoundError
+
+ error = LocalEntryNotFoundError("hub unreachable")
+ with pytest.raises(LocalEntryNotFoundError) as caught:
+ _h3_load_with_vae_fetch(monkeypatch, h3_host, error, local_files_only = False)
+ assert caught.value is error
+
+
+def test_h3_cache_only_load_keeps_an_unrelated_error(h3_host, monkeypatch):
+ error = OSError("disk full")
+ with pytest.raises(OSError) as caught:
+ _h3_load_with_vae_fetch(monkeypatch, h3_host, error, local_files_only = True)
+ assert caught.value is error