From 4e88092452e1122c014b86735da5e6cd74d08c91 Mon Sep 17 00:00:00 2001 From: Roland Tannous <115670425+rolandtannous@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:02:43 +0400 Subject: [PATCH] Preflight llama-server check before downloading remote GGUF files --- studio/backend/utils/models/model_config.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/studio/backend/utils/models/model_config.py b/studio/backend/utils/models/model_config.py index 53ac28be65..601ea75770 100644 --- a/studio/backend/utils/models/model_config.py +++ b/studio/backend/utils/models/model_config.py @@ -800,6 +800,15 @@ class ModelConfig: # Check if the HF repo contains GGUF files gguf_filename = detect_gguf_model_remote(identifier, hf_token=hf_token) if gguf_filename: + # Preflight: verify llama-server binary exists before downloading + # a potentially multi-GB GGUF file + from core.inference.llama_cpp import LlamaCppBackend + if not LlamaCppBackend._find_llama_server_binary(): + raise RuntimeError( + "llama-server binary not found — cannot load GGUF models. " + "Run setup.sh to build it, or set LLAMA_SERVER_PATH." + ) + logger.info(f"Detected remote GGUF repo '{identifier}', file: {gguf_filename}") logger.info(f"Downloading GGUF file '{gguf_filename}' from '{identifier}'...") local_gguf_path = download_gguf_file(