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: use a custom llama.cpp build (#9292)
Etherle99dfe5a2b30
diff --git a/studio/backend/core/inference/llama_cpp.py b/studio/backend/core/inference/llama_cpp.pyindex d698240d66b..fee040787b3 100644--- a/studio/backend/core/inference/llama_cpp.py+++ b/studio/backend/core/inference/llama_cpp.py@@ -210,9 +210,10 @@ class _CpuFallbackRuntime(NamedTuple):# Shared so the from_identifier preflight and the load-time raise stay in sync.LLAMA_SERVER_NOT_FOUND_DETAIL = (- "This is a GGUF model, but the llama.cpp runtime (llama-server) is not "- "installed. Run `unsloth studio setup` to download the prebuilt runtime, "- "then try again. (Advanced: set LLAMA_SERVER_PATH to an existing binary.)"+ "This is a GGUF model, but no executable llama.cpp runtime (llama-server) "+ "is available. Run `unsloth studio setup` to download the prebuilt runtime, "+ "then try again. If you selected a custom runtime, restore its execute "+ "permission first (for example, `chmod +x llama-server` on Unix).")# Shared by the pre-teardown and post-metadata rejections (#7205).@@ -3713,6 +3714,11 @@ class LlamaCppBackend:# Which llama-server file this load ran. `unsloth studio update` replaces it# in place, so a stand-down blamed on the binary can spot a real update.self._launch_binary_revision: tuple = ()+ # Binary a load has selected but not necessarily spawned yet. None means+ # no load is pending; the settings route compares a populated revision+ # before is_active becomes true so a concurrent path save cannot hide a+ # required reload.+ self._binary_revision_pending: Optional[tuple] = None# Set after an auto-Vulkan crash recovers with all devices disabled.self._cpu_fallback_reason: Optional[str] = Noneself._cpu_fallback_runtime: Optional[_CpuFallbackRuntime] = None@@ -4020,12 +4026,16 @@ class LlamaCppBackend:# path string, and on macOS the launch resolves a managed entrypoint to# its target, so comparing an unresolved discovery path against it would# differ for the same unchanged file and reload the model on every Apply.+ return self._binary_changed_since_revision(self._launch_binary_revision)++ def _binary_changed_since_revision(self, revision: tuple) -> bool:+ """Whether the current selection differs from a captured binary."""current = self._binary_revision(self._exec_path_for_launch(self._find_llama_server_binary()))- if not current or not self._launch_binary_revision:+ if not current or not revision:return False- return current != self._launch_binary_revision+ return current != revisiondef spec_binary_fallback_can_retry(self) -> bool:"""Whether the binary has since gained what the last load stood down for.@@ -4857,24 +4867,30 @@ class LlamaCppBackend:Search order:1. LLAMA_SERVER_PATH environment variable (direct path to binary)1b. UNSLOTH_LLAMA_CPP_PATH env var (custom llama.cpp install dir)- 2. ~/.unsloth/llama.cpp/llama-server (make build, root dir)- 3. ~/.unsloth/llama.cpp/build/bin/llama-server (cmake build, Linux)- 4. ~/.unsloth/llama.cpp/build/bin/Release/llama-server.exe (cmake build, Windows)- 5. ./llama.cpp/llama-server (legacy: make build, root dir)- 6. ./llama.cpp/build/bin/llama-server (legacy: cmake in-tree build)- 7. llama-server on PATH (system install)- 8. ./bin/llama-server (legacy: extracted binary)+ 2. Studio's custom llama.cpp folder setting+ 3. ~/.unsloth/llama.cpp/llama-server (make build, root dir)+ 4. ~/.unsloth/llama.cpp/build/bin/llama-server (cmake build, Linux)+ 5. ~/.unsloth/llama.cpp/build/bin/Release/llama-server.exe (cmake build, Windows)+ 6. ./llama.cpp/llama-server (legacy: make build, root dir)+ 7. ./llama.cpp/build/bin/llama-server (legacy: cmake in-tree build)+ 8. llama-server on PATH (system install)+ 9. ./bin/llama-server (legacy: extracted binary)"""binary_name = "llama-server.exe" if sys.platform == "win32" else "llama-server"def _file_status(p: Path) -> str:- # "file", "absent", or "denied" (exists but stays access-denied- # across a short retry: Windows AV/ACL or an install replace in- # flight). is_file() raises PermissionError (WinError 5) instead of- # returning False for the locked case, so never treat it as missing.+ # "file", "absent", "non_executable", or "denied". A denied+ # file stays access-denied across a short retry (Windows AV/ACL or+ # an install replace in flight). is_file() raises PermissionError+ # (WinError 5) instead of returning False for the locked case, so+ # never treat it as missing.for _ in range(5):try:- return "file" if p.is_file() else "absent"+ if not p.is_file():+ return "absent"+ if sys.platform != "win32" and not os.access(p, os.X_OK):+ return "non_executable"+ return "file"except PermissionError:time.sleep(0.2)except OSError:@@ -4885,33 +4901,43 @@ class LlamaCppBackend:return _file_status(p) == "file"def _layout_candidates(d: Path) -> list:- # build layouts probed under a llama.cpp dir, highest priority first- cands = [d / binary_name, d / "build" / "bin" / binary_name]- if sys.platform == "win32":- cands.append(d / "build" / "bin" / "Release" / binary_name)- return cands+ # Keep Settings validation and runtime discovery on one layout+ # contract so a folder accepted by the UI is always launchable.+ from utils.llama_cpp_path_settings import llama_server_candidates+ return list(llama_server_candidates(d))def _unavailable(p: object) -> None:# a pinned or managed binary that exists but is access-denied: report# it instead of silently downgrading to a lower-priority llama-serverlogger.warning(- f"llama-server at {p} exists but is access-denied (antivirus or "- "an in-flight install); not falling back to another binary, "- "retry once it is released"+ f"llama-server at {p} is not executable or is access-denied "+ "(permissions, antivirus, or an in-flight install); not falling "+ "back to another binary, retry once it is available")return Nonedef _scan_pinned(paths: list):- # first existing candidate wins -> (path, None); a present-but-denied- # one -> (None, denied_path) so the caller reports it rather than- # skipping to a lower-priority location. include_denied returns the- # locked path instead: diffusion asset lookup only needs its dir.+ # First executable candidate wins. A genuinely access-denied one+ # stops immediately; a known non-executable candidate is remembered+ # while sibling build layouts are checked. include_denied returns an+ # unavailable path instead: diffusion asset lookup only needs its dir.+ non_executable = Nonefor p in paths:st = _file_status(p)if st == "file":return str(p), Noneif st == "denied":return (str(p), None) if include_denied else (None, p)+ if st == "non_executable" and non_executable is None:+ # A source checkout may leave a stale root entrypoint beside a+ # valid CMake build. Keep looking within this pinned layout,+ # but do not fall through to a different runtime if none works.+ non_executable = p+ if non_executable is not None:+ # include_denied is used only to preserve genuinely transient+ # access-denied paths. A missing execute bit needs repair, not a+ # retry, and must not pass the download preflight as available.+ return (None, None) if include_denied else (None, non_executable)return None, None# 1. Env var: direct path to binary@@ -4925,14 +4951,37 @@ class LlamaCppBackend:# 1b. UNSLOTH_LLAMA_CPP_PATH: custom llama.cpp install dircustom_llama_cpp = os.environ.get("UNSLOTH_LLAMA_CPP_PATH")- if custom_llama_cpp:+ managed_path_marker = os.environ.get("UNSLOTH_STUDIO_MANAGED_LLAMA_CPP_PATH") == "1"+ if custom_llama_cpp and not managed_path_marker:hit, locked = _scan_pinned(_layout_candidates(Path(custom_llama_cpp)))if locked is not None:return _unavailable(locked)if hit:return hit- # 2-4. Match installer layout: env-mode -> $STUDIO_HOME/llama.cpp;+ # 2. Studio setting: a deliberate pin, so a missing or inaccessible+ # selected build must not silently fall through to the bundled runtime.+ # The user would otherwise see their custom path selected while another+ # llama-server actually ran.+ try:+ from utils.llama_cpp_path_settings import get_stored_custom_llama_cpp_path+ studio_custom_llama_cpp = get_stored_custom_llama_cpp_path()+ except Exception:+ studio_custom_llama_cpp = None+ if studio_custom_llama_cpp is not None:+ hit, locked = _scan_pinned(_layout_candidates(studio_custom_llama_cpp))+ if locked is not None:+ return _unavailable(locked)+ if hit:+ return hit+ logger.warning(+ "The custom llama.cpp folder selected in Studio no longer contains "+ "%s; not falling back to another runtime",+ binary_name,+ )+ return None++ # 3-5. Match installer layout: env-mode -> $STUDIO_HOME/llama.cpp;# default/HOME-redirect -> ~/.unsloth/llama.cpp (sibling of studio).legacy_llama = Path.home() / ".unsloth" / "llama.cpp"_resolved_sr, _is_legacy = LlamaCppBackend._resolved_studio_root_and_is_legacy()@@ -11322,11 +11371,16 @@ class LlamaCppBackend:if not binary:return Truetry:+ from utils.llama_cpp_path_settings import custom_llama_cpp_path_sourcefrom utils.llama_cpp_update import (_active_install_is_local_link,_llama_install_root,)+ # A Settings-selected checkout is user-owned even when its ordinary+ # `llama.cpp` directory name or prebuilt marker resembles our tree.+ if custom_llama_cpp_path_source() == "studio":+ return False# A --with-llama-cpp-dir tree is the user's own checkout reached# through a symlinked llama.cpp dir. The updater refuses to write# through that link, so it cannot repair the binary either, and its@@ -11460,7 +11514,12 @@ class LlamaCppBackend:if not binary or sys.platform != "darwin":return binaryif not LlamaCppBackend._is_unsloth_managed_binary(binary):- return binary+ try:+ from utils.llama_cpp_path_settings import custom_llama_cpp_path_source+ if custom_llama_cpp_path_source() != "studio":+ return binary+ except Exception:+ return binaryif not _is_installer_entrypoint(binary):return binary# template_only: the outer entrypoint being ours says nothing about@@ -13629,7 +13688,7 @@ class LlamaCppBackend:@contextlib.contextmanagerdef _serial_load_scope(self):- """Hold the serial load lock, and release the pending budget with it.+ """Hold the serial load lock and release pending launch state with it.The pending fraction is armed before the download, so every exit ahead ofthe spawn has to give it back or the settings route, which reads it before@@ -13644,6 +13703,7 @@ class LlamaCppBackend:yieldfinally:self._vram_fraction_pending = None+ self._binary_revision_pending = None@_with_gguf_load_markerdef load_model(@@ -13850,19 +13910,27 @@ class LlamaCppBackend:# Resolve llama-server now but defer a not-found error: a block-diffusion# GGUF uses the diffusion runner, and its arch is only known after the header.- binary = self._find_llama_server_binary()- # macOS: launch the resolved server, never a shell entrypoint. SIP- # purges DYLD_* while starting the protected /bin/sh a wrapper- # entrypoint runs under, so the loader path built for the child- # would not survive the wrapper's own exec (#8566). The installer- # writes a wrapper only when it cannot symlink, and that wrapper- # does nothing but exec the target with "$@", so this is the same- # launch minus the shell hop. The resolved path stays inside the- # managed install, so provenance-aware advice is unaffected.- # Resolved here rather than at the later reset so every consumer of- # `binary` below (capability probe, revision stamp) shares one path- # space; `_binary_changed_since_launch` compares against this one.- binary = self._exec_path_for_launch(binary)+ # Serialize this snapshot with settings writes. If a save wins the+ # guard, this load sees the new folder; if the load wins, the save+ # response compares against this pending old revision and asks for a+ # reload even before Popen makes is_active true.+ from utils.llama_cpp_path_settings import llama_cpp_path_selection_guard++ with llama_cpp_path_selection_guard():+ binary = self._find_llama_server_binary()+ # macOS: launch the resolved server, never a shell entrypoint. SIP+ # purges DYLD_* while starting the protected /bin/sh a wrapper+ # entrypoint runs under, so the loader path built for the child+ # would not survive the wrapper's own exec (#8566). The installer+ # writes a wrapper only when it cannot symlink, and that wrapper+ # does nothing but exec the target with "$@", so this is the same+ # launch minus the shell hop. The resolved path stays inside the+ # managed install, so provenance-aware advice is unaffected.+ # Resolved here rather than at the later reset so every consumer of+ # `binary` below (capability probe, revision stamp) shares one path+ # space; `_binary_changed_since_launch` compares against this one.+ binary = self._exec_path_for_launch(binary)+ self._binary_revision_pending = self._binary_revision(binary)# Every capability answer shaping this launch, latching whether any was a# guess. Accumulated, not sampled: the decisions straddle the whole load (slot@@ -19221,6 +19289,11 @@ class LlamaCppBackend:"""Match live state and adopt the caller's compatible GPU placement."""if not self.matches_load_source(intent):return False+ # A custom-path save leaves the model intent unchanged, but the+ # resident process still belongs to the previously selected runtime.+ if self._binary_changed_since_launch():+ logger.info("llama-server selection changed since launch; forcing a reload")+ return Falseintent = self._preserve_cpu_fallback_intent(intent, source_matches = True)# The stored state is what LAUNCHED, and on a virtualised Metal device that is# the CPU-pinned rewrite, not the request. Apply the same rewrite herediff --git a/studio/backend/core/inference/stt_mtmd_sidecar.py b/studio/backend/core/inference/stt_mtmd_sidecar.pyindex 7665f7cd8cd..3b19e4f0060 100644--- a/studio/backend/core/inference/stt_mtmd_sidecar.py+++ b/studio/backend/core/inference/stt_mtmd_sidecar.py@@ -551,6 +551,7 @@ class MtmdSttSidecar:self._process: Optional[subprocess.Popen] = Noneself._port: Optional[int] = Noneself._model_id: Optional[str] = None+ self._binary_path_revision: Optional[int] = Noneself._loading = False# Published as soon as Popen returns, so a startup can be preempted# before _process is assigned (readiness takes up to three minutes).@@ -626,6 +627,7 @@ class MtmdSttSidecar:self._process = Noneself._port = Noneself._model_id = None+ self._binary_path_revision = Nonedef _drain_active_requests(self, deadline: float) -> None:"""Wait, bounded, for in-flight transcriptions to finish.@@ -804,6 +806,9 @@ class MtmdSttSidecar:raise SttTranscriptionCancelledError("Transcription cancelled.")self._raise_if_update_in_progress()model_id = resolve_mtmd_model_id(model)+ from utils.llama_cpp_path_settings import custom_llama_cpp_path_revision++ path_revision = custom_llama_cpp_path_revision()binary = ensure_engine_available()# Startup happens outside _lock (it is slow), so this keeps two callers# from each spawning a server and orphaning the first.@@ -811,17 +816,31 @@ class MtmdSttSidecar:if request_cancel_event is not None and request_cancel_event.is_set():raise SttTranscriptionCancelledError("Transcription cancelled.")self._raise_if_update_in_progress()- self._load_locked(model_id, binary, request_cancel_event)+ self._load_locked(+ model_id,+ binary,+ request_cancel_event,+ path_revision = path_revision,+ )def _load_locked(self,model_id: str,binary: str,request_cancel_event: Optional[threading.Event] = None,+ *,+ path_revision: Optional[int] = None,) -> None:+ if path_revision is None:+ from utils.llama_cpp_path_settings import custom_llama_cpp_path_revision+ path_revision = custom_llama_cpp_path_revision()with self._lock:training = _training_active()- if self._process_alive() and self._model_id == model_id:+ if (+ self._process_alive()+ and self._model_id == model_id+ and self._binary_path_revision == path_revision+ ):# Same model, so only the offload mode can differ: a server# started at -ngl 0 during training would otherwise serve every# later dictation on CPU. Restarting for that is an@@ -929,6 +948,7 @@ class MtmdSttSidecar:self._process = processself._port = portself._model_id = model_id+ self._binary_path_revision = path_revisionself._gpu_disabled = trainingself._generation += 1self._schedule_idle_unload_locked()diff --git a/studio/backend/core/rag/embed_llama_server.py b/studio/backend/core/rag/embed_llama_server.pyindex dbe22b7782a..d1762f22d0f 100644--- a/studio/backend/core/rag/embed_llama_server.py+++ b/studio/backend/core/rag/embed_llama_server.py@@ -108,6 +108,7 @@ class LlamaServerBackend:# makes it stale, forcing a re-resolve + respawn (see _ensure_ready).self._model_repo: str | None = Noneself._binary: str | None = None+ self._binary_path_revision: int | None = None# Sticky after an auto GPU start fails: later spawns stay on CPU.self._force_cpu = False# Pooled client (full URLs per request survive a respawn); trust_env=False skips HTTP(S)_PROXY.@@ -124,7 +125,9 @@ class LlamaServerBackend:if self._binary is not None:return self._binaryfrom core.inference.llama_cpp import LlamaCppBackend+ from utils.llama_cpp_path_settings import custom_llama_cpp_path_revision+ path_revision = custom_llama_cpp_path_revision()binary = LlamaCppBackend._find_llama_server_binary()if not binary:raise RuntimeError(@@ -137,6 +140,7 @@ class LlamaServerBackend:binary = _resolve_entrypoint(binary)self._assert_embedding_support(binary)self._binary = binary+ self._binary_path_revision = path_revisionreturn binary@staticmethod@@ -650,7 +654,12 @@ class LlamaServerBackend:def _current(self) -> bool:"""Alive AND serving the effective repo (a Settings model change makes alive server stale)."""- return self._process_alive() and self._model_repo == config.effective_gguf_repo()+ from utils.llama_cpp_path_settings import custom_llama_cpp_path_revision+ return (+ self._process_alive()+ and self._model_repo == config.effective_gguf_repo()+ and self._binary_path_revision == custom_llama_cpp_path_revision()+ )def _ensure_ready(self) -> None:"""Guarantee a live server on the effective model, (re)spawning if needed.@@ -662,6 +671,11 @@ class LlamaServerBackend:if self._current():returnself._kill_process()+ from utils.llama_cpp_path_settings import custom_llama_cpp_path_revision++ if self._binary_path_revision != custom_llama_cpp_path_revision():+ self._binary = None+ self._binary_path_revision = Noneself._spawn()def _restart(self) -> None:diff --git a/studio/backend/main.py b/studio/backend/main.pyindex 10ffa7ef031..bdbad179ad0 100644--- a/studio/backend/main.py+++ b/studio/backend/main.py@@ -222,8 +222,14 @@ except (OSError, ValueError):if _STUDIO_ROOT_RESOLVED != _LEGACY_STUDIO_ROOT:if not os.environ.get("UNSLOTH_STUDIO_HOME"):os.environ["UNSLOTH_STUDIO_HOME"] = str(_STUDIO_ROOT_RESOLVED)+ _MANAGED_LLAMA_CPP_PATH = _STUDIO_ROOT_RESOLVED / "llama.cpp"if not os.environ.get("UNSLOTH_LLAMA_CPP_PATH"):- os.environ["UNSLOTH_LLAMA_CPP_PATH"] = str(_STUDIO_ROOT_RESOLVED / "llama.cpp")+ os.environ["UNSLOTH_LLAMA_CPP_PATH"] = str(_MANAGED_LLAMA_CPP_PATH)+ # A CLI/desktop launcher may already have exported Studio's own install path.+ # Classify by the canonical value so that inherited default remains editable.+ from utils.llama_cpp_path_settings import mark_managed_llama_cpp_path++ mark_managed_llama_cpp_path(_MANAGED_LLAMA_CPP_PATH)# The studio bundles unsloth_zoo; declare unsloth present (as `import unsloth` does) so its# lazy submodule imports and the DiffusionGemma runner don't trip the install guard.diff --git a/studio/backend/routes/settings.py b/studio/backend/routes/settings.pyindex abab19c189f..13f61dbc61a 100644--- a/studio/backend/routes/settings.py+++ b/studio/backend/routes/settings.py@@ -120,6 +120,11 @@ from utils.embedding_model_settings import (validate_embedding_model,)from utils.hf_cache_settings import cache_status, get_hf_cache_paths, set_hf_cache_home+from utils.llama_cpp_path_settings import (+ MAX_CUSTOM_LLAMA_CPP_PATH_LENGTH,+ custom_llama_cpp_path_status,+ set_custom_llama_cpp_path,+)from utils.media_generation_preset_settings import (delete_media_generation_preset,get_media_generation_preset_settings,@@ -626,6 +631,20 @@ class HuggingFaceCacheResponse(BaseModel):environment_variable: Optional[str] = None+class LlamaCppPathPayload(BaseModel):+ path: Optional[str] = Field(default = None, max_length = MAX_CUSTOM_LLAMA_CPP_PATH_LENGTH)+++class LlamaCppPathResponse(BaseModel):+ path: Optional[str] = None+ source: Literal["default", "studio", "environment"]+ editable: bool+ available: bool+ resolved_binary: Optional[str] = None+ environment_variable: Optional[str] = None+ reload_required: bool = False++class OpenAIAutoSwitchPayload(BaseModel):enabled: bool# None leaves the stored value untouched (partial updates can't clobber it).@@ -905,6 +924,27 @@ def _hugging_face_cache_response() -> HuggingFaceCacheResponse:return HuggingFaceCacheResponse(**cache_status(get_hf_cache_paths()))+def _llama_cpp_path_reload_required() -> bool:+ """Whether a running or pending GGUF server predates the path selection."""+ try:+ from routes.inference import get_llama_cpp_backend++ backend = get_llama_cpp_backend()+ pending = getattr(backend, "_binary_revision_pending", None)+ if pending is not None:+ return backend._binary_changed_since_revision(pending)+ return bool(backend.is_active and backend._binary_changed_since_launch())+ except Exception:+ return False+++def _llama_cpp_path_response() -> LlamaCppPathResponse:+ return LlamaCppPathResponse(+ **custom_llama_cpp_path_status(),+ reload_required = _llama_cpp_path_reload_required(),+ )++@router.get("/hugging-face-cache", response_model = HuggingFaceCacheResponse)def get_hugging_face_cache(current_subject: str = Depends(get_current_subject),@@ -925,6 +965,35 @@ def update_hugging_face_cache(return _hugging_face_cache_response()[email protected]("/llama-cpp-path", response_model = LlamaCppPathResponse)+def get_llama_cpp_path(current_subject: str = Depends(get_current_subject)) -> LlamaCppPathResponse:+ return _llama_cpp_path_response()++[email protected]("/llama-cpp-path", response_model = LlamaCppPathResponse)+def update_llama_cpp_path(+ payload: LlamaCppPathPayload,+ current_subject: str = Depends(get_current_subject),+ via_api_key: bool = Depends(authenticated_via_api_key),+) -> LlamaCppPathResponse:+ # Only the interactive Studio UI may change this executable setting.+ require_ui_session(via_api_key)+ try:+ set_custom_llama_cpp_path(payload.path)+ except RuntimeError as exc:+ raise HTTPException(status_code = 409, detail = str(exc)) from exc+ except ValueError as exc:+ raise log_and_http_error(+ exc,+ 400,+ # Validator messages are safe to expose to the UI.+ str(exc),+ event = "settings.update_llama_cpp_path_failed",+ log = logger,+ ) from exc+ return _llama_cpp_path_response()++@router.get("/upload-limit", response_model = UploadLimitResponse)def get_upload_limit(current_subject: str = Depends(get_current_subject)) -> UploadLimitResponse:return _upload_limit_response(get_upload_limit_mb())diff --git a/studio/backend/run.py b/studio/backend/run.pyindex b65c1fecfdd..3853a1c9b48 100644--- a/studio/backend/run.py+++ b/studio/backend/run.py@@ -1292,8 +1292,14 @@ except (OSError, ValueError):if _STUDIO_ROOT_RESOLVED != _LEGACY_STUDIO_ROOT:if not os.environ.get("UNSLOTH_STUDIO_HOME"):os.environ["UNSLOTH_STUDIO_HOME"] = str(_STUDIO_ROOT_RESOLVED)+ _MANAGED_LLAMA_CPP_PATH = _STUDIO_ROOT_RESOLVED / "llama.cpp"if not os.environ.get("UNSLOTH_LLAMA_CPP_PATH"):- os.environ["UNSLOTH_LLAMA_CPP_PATH"] = str(_STUDIO_ROOT_RESOLVED / "llama.cpp")+ os.environ["UNSLOTH_LLAMA_CPP_PATH"] = str(_MANAGED_LLAMA_CPP_PATH)+ # The CLI and generated launchers can export this path before run.py starts.+ # Preserve its managed provenance while leaving every other env pin explicit.+ from utils.llama_cpp_path_settings import mark_managed_llama_cpp_path++ mark_managed_llama_cpp_path(_MANAGED_LLAMA_CPP_PATH)# The studio bundles unsloth_zoo; declare unsloth present (as `import unsloth`# does) so its lazy submodule imports (export, hardware, mlx) and thediff --git a/studio/backend/tests/test_gguf_reload_inheritance.py b/studio/backend/tests/test_gguf_reload_inheritance.pyindex 0a747d6fa5d..d8d3108f68b 100644--- a/studio/backend/tests/test_gguf_reload_inheritance.py+++ b/studio/backend/tests/test_gguf_reload_inheritance.py@@ -126,6 +126,27 @@ def test_already_in_target_state_uses_gguf_path_when_present(tmp_path):)+def test_already_loaded_model_reloads_when_selected_binary_changes():+ backend = _loaded_backend()+ backend._binary_changed_since_launch = lambda: True++ assert (+ _matches(+ backend,+ gguf_path = None,+ model_identifier = "owner/repo",+ hf_variant = "Q4_K_M",+ n_ctx = 8192,+ cache_type_kv = None,+ speculative_type = None,+ chat_template_override = None,+ extra_args = None,+ is_vision = False,+ )+ is False+ )++def test_already_in_target_state_rejects_different_gguf_path(tmp_path):a = tmp_path / "a.gguf"a.write_bytes(b"")diff --git a/studio/backend/tests/test_llama_cpp_darwin_loader_env.py b/studio/backend/tests/test_llama_cpp_darwin_loader_env.pyindex 8b2f6d04bf1..735ca97f453 100644--- a/studio/backend/tests/test_llama_cpp_darwin_loader_env.py+++ b/studio/backend/tests/test_llama_cpp_darwin_loader_env.py@@ -297,6 +297,18 @@ class TestExecPathForLaunch:monkeypatch.setenv("UNSLOTH_LLAMA_CPP_PATH", str(tmp_path / "llama.cpp"))assert LlamaCppBackend._exec_path_for_launch(str(wrapper)) == str(target)+ def test_a_selected_installer_entrypoint_still_resolves_by_shape(self, monkeypatch, tmp_path):+ from utils import llama_cpp_path_settings as path_settings++ monkeypatch.setattr(sys, "platform", "darwin")+ monkeypatch.setattr(path_settings, "custom_llama_cpp_path_source", lambda: "studio")+ wrapper, target = self._wrapper(tmp_path)+ # Simulate the LF-only installer template even on a Windows test host.+ wrapper.write_bytes(b'#!/bin/sh\nexec "$(dirname "$0")/llama-server-real" "$@"\n')++ assert LlamaCppBackend._is_unsloth_managed_binary(str(wrapper)) is False+ assert LlamaCppBackend._exec_path_for_launch(str(wrapper)) == str(target)+def test_a_pinned_custom_wrapper_is_launched_as_given(self, monkeypatch, tmp_path):wrapper, _ = self._wrapper(tmp_path)monkeypatch.setattr(sys, "platform", "darwin")diff --git a/studio/backend/tests/test_llama_cpp_path_settings.py b/studio/backend/tests/test_llama_cpp_path_settings.pynew file mode 100644index 00000000000..1b39c8f7d43--- /dev/null+++ b/studio/backend/tests/test_llama_cpp_path_settings.py@@ -0,0 +1,357 @@+# SPDX-License-Identifier: AGPL-3.0-only+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++from __future__ import annotations++import os+import sys+from pathlib import Path++import pytest++_BACKEND_DIR = str(Path(__file__).resolve().parent.parent)+if _BACKEND_DIR not in sys.path:+ sys.path.insert(0, _BACKEND_DIR)++from utils import llama_cpp_path_settings as path_settings+++def settings_store(monkeypatch):+ store = {}+ monkeypatch.delenv("LLAMA_SERVER_PATH", raising = False)+ monkeypatch.delenv("UNSLOTH_LLAMA_CPP_PATH", raising = False)+ monkeypatch.delenv(path_settings.MANAGED_LLAMA_CPP_PATH_MARKER, raising = False)+ monkeypatch.setattr(+ "storage.studio_db.get_app_setting",+ lambda key, fallback = None: store.get(key, fallback),+ )+ monkeypatch.setattr(+ "storage.studio_db.upsert_app_settings",+ lambda values: store.update(values) or values,+ )+ return store+++def _binary(+ root: Path,+ *,+ platform: str | None = None,+ layout: str = "build",+) -> Path:+ name = path_settings.llama_server_binary_name(platform)+ if layout == "root":+ binary = root / name+ elif layout == "release":+ binary = root / "build" / "bin" / "Release" / name+ else:+ binary = root / "build" / "bin" / name+ binary.parent.mkdir(parents = True, exist_ok = True)+ binary.write_bytes(b"test llama-server")+ binary.chmod(0o755)+ return binary+++ ("platform", "layout"),+ [+ ("linux", "root"),+ ("linux", "build"),+ ("darwin", "build"),+ ("win32", "root"),+ ("win32", "build"),+ ("win32", "release"),+ ],+)+def test_supported_build_layouts_resolve(tmp_path, platform, layout):+ root = tmp_path / f"{platform}-{layout}"+ expected = _binary(root, platform = platform, layout = layout)++ assert path_settings.resolve_llama_server_binary(root, platform = platform) == expected+++def test_setting_round_trip_and_reset(settings_store, tmp_path):+ root = tmp_path / "custom llama.cpp"+ binary = _binary(root)+ initial_revision = path_settings.custom_llama_cpp_path_revision()++ selected = path_settings.set_custom_llama_cpp_path(str(root))+ status = path_settings.custom_llama_cpp_path_status()++ assert selected == root.resolve()+ assert settings_store[path_settings.CUSTOM_LLAMA_CPP_PATH_SETTING_KEY] == str(root.resolve())+ assert status == {+ "path": str(root.resolve()),+ "source": "studio",+ "editable": True,+ "available": True,+ "resolved_binary": str(binary),+ "environment_variable": None,+ }+ assert path_settings.custom_llama_cpp_path_revision() == initial_revision + 1++ assert path_settings.set_custom_llama_cpp_path(None) is None+ assert settings_store[path_settings.CUSTOM_LLAMA_CPP_PATH_SETTING_KEY] is None+ assert path_settings.custom_llama_cpp_path_status()["source"] == "default"+ assert path_settings.custom_llama_cpp_path_revision() == initial_revision + 2+++def test_setting_rejects_missing_folder_and_folder_without_server(settings_store, tmp_path):+ with pytest.raises(ValueError, match = "does not exist"):+ path_settings.set_custom_llama_cpp_path(str(tmp_path / "missing"))++ empty = tmp_path / "empty"+ empty.mkdir()+ with pytest.raises(ValueError, match = "No executable llama-server"):+ path_settings.set_custom_llama_cpp_path(str(empty))++ assert path_settings.CUSTOM_LLAMA_CPP_PATH_SETTING_KEY not in settings_store+++def test_environment_path_is_displayed_and_locks_the_setting(settings_store, monkeypatch, tmp_path):+ stored = tmp_path / "stored"+ _binary(stored)+ settings_store[path_settings.CUSTOM_LLAMA_CPP_PATH_SETTING_KEY] = str(stored)++ env_root = tmp_path / "environment"+ env_binary = _binary(env_root)+ monkeypatch.setenv("UNSLOTH_LLAMA_CPP_PATH", str(env_root))++ status = path_settings.custom_llama_cpp_path_status()+ assert status["source"] == "environment"+ assert status["editable"] is False+ assert status["path"] == str(env_root)+ assert status["resolved_binary"] == str(env_binary)+ assert status["environment_variable"] == "UNSLOTH_LLAMA_CPP_PATH"+ with pytest.raises(RuntimeError, match = "UNSLOTH_LLAMA_CPP_PATH"):+ path_settings.set_custom_llama_cpp_path(str(stored))+++def test_direct_environment_binary_has_highest_priority(settings_store, monkeypatch, tmp_path):+ env_dir = tmp_path / "directory-env"+ _binary(env_dir)+ direct = _binary(tmp_path / "direct")+ monkeypatch.setenv("UNSLOTH_LLAMA_CPP_PATH", str(env_dir))+ monkeypatch.setenv("LLAMA_SERVER_PATH", str(direct))++ status = path_settings.custom_llama_cpp_path_status()++ assert status["path"] == str(direct)+ assert status["resolved_binary"] == str(direct)+ assert status["environment_variable"] == "LLAMA_SERVER_PATH"+++def test_studio_managed_environment_path_does_not_lock_out_the_ui(+ settings_store, monkeypatch, tmp_path+):+ from core.inference.llama_cpp import LlamaCppBackend++ managed = tmp_path / "managed"+ _binary(managed)+ selected = tmp_path / "selected"+ selected_binary = _binary(selected)+ monkeypatch.setenv("UNSLOTH_LLAMA_CPP_PATH", str(managed))+ monkeypatch.setenv(path_settings.MANAGED_LLAMA_CPP_PATH_MARKER, "1")++ path_settings.set_custom_llama_cpp_path(str(selected))+ status = path_settings.custom_llama_cpp_path_status()++ assert status["source"] == "studio"+ assert status["editable"] is True+ assert status["resolved_binary"] == str(selected_binary)+ assert LlamaCppBackend._find_llama_server_binary() == str(selected_binary)+++def test_inherited_managed_path_is_marked_even_when_launcher_exported_it(+ settings_store, monkeypatch, tmp_path+):+ managed = tmp_path / "not-installed-yet" / "llama.cpp"+ monkeypatch.setenv("UNSLOTH_LLAMA_CPP_PATH", str(managed))++ assert path_settings.mark_managed_llama_cpp_path(managed) is True+ assert os.environ[path_settings.MANAGED_LLAMA_CPP_PATH_MARKER] == "1"+ assert path_settings.custom_llama_cpp_path_status()["editable"] is True++ explicit = tmp_path / "user-owned-llama.cpp"+ monkeypatch.setenv("UNSLOTH_LLAMA_CPP_PATH", str(explicit))+ assert path_settings.mark_managed_llama_cpp_path(managed) is False+ assert path_settings.MANAGED_LLAMA_CPP_PATH_MARKER not in os.environ+ assert path_settings.custom_llama_cpp_path_status()["editable"] is False+++def test_runtime_skips_non_executable_root_entrypoint_for_valid_build_layout(+ settings_store, monkeypatch, tmp_path+):+ from core.inference.llama_cpp import LlamaCppBackend++ root = tmp_path / "custom"+ root_binary = _binary(root, platform = "linux", layout = "root")+ build_binary = _binary(root, platform = "linux", layout = "build")+ monkeypatch.setattr(path_settings.sys, "platform", "linux")+ monkeypatch.setattr(+ path_settings.os,+ "access",+ lambda path, mode: Path(path) != root_binary,+ )++ path_settings.set_custom_llama_cpp_path(str(root))++ assert path_settings.resolve_llama_server_binary(root) == build_binary+ assert LlamaCppBackend._find_llama_server_binary() == str(build_binary)+++def test_runtime_resolver_uses_studio_path_and_does_not_silently_fallback(+ settings_store, monkeypatch, tmp_path+):+ from core.inference.llama_cpp import LlamaCppBackend++ selected = tmp_path / "selected"+ binary = _binary(selected)+ settings_store[path_settings.CUSTOM_LLAMA_CPP_PATH_SETTING_KEY] = str(selected)++ assert LlamaCppBackend._find_llama_server_binary() == str(binary)++ binary.unlink()+ monkeypatch.setattr("core.inference.llama_cpp.shutil.which", lambda _name: "fallback")+ assert LlamaCppBackend._find_llama_server_binary() is None+++def test_runtime_resolver_rejects_a_selected_binary_that_loses_execute_permission(+ settings_store, monkeypatch, tmp_path+):+ from core.inference import llama_cpp as llama_cpp_module+ from core.inference.llama_cpp import (+ LLAMA_SERVER_NOT_FOUND_DETAIL,+ LlamaCppBackend,+ )++ selected = tmp_path / "selected"+ binary = _binary(selected, platform = "linux")+ settings_store[path_settings.CUSTOM_LLAMA_CPP_PATH_SETTING_KEY] = str(selected)+ real_access = os.access++ monkeypatch.setattr(llama_cpp_module.sys, "platform", "linux")+ monkeypatch.setattr(+ os,+ "access",+ lambda path, mode: False if Path(path) == binary else real_access(path, mode),+ )++ assert path_settings.custom_llama_cpp_path_status()["available"] is False+ assert LlamaCppBackend._find_llama_server_binary() is None+ assert LlamaCppBackend._find_llama_server_binary(include_denied = True) is None+ assert "execute permission" in LLAMA_SERVER_NOT_FOUND_DETAIL+++def test_backend_updater_never_replaces_a_studio_selected_tree(monkeypatch):+ from utils import llama_cpp_update++ monkeypatch.setattr(llama_cpp_update, "_studio_custom_path_active", lambda: True)+ monkeypatch.setattr(llama_cpp_update, "_find_binary", lambda: "custom/llama-server")+ monkeypatch.setattr(+ llama_cpp_update,+ "read_install_marker",+ lambda _binary: {"backend": "cuda", "backend_request": "auto"},+ )++ status = llama_cpp_update.get_backend_status()+ plan = llama_cpp_update._plan_llama_phase("cpu")++ assert status["supported"] is False+ assert status["reason"] == "custom_path"+ assert plan["skip_reason"] == "custom_path"+ assert plan["refusal"]["reason"] == "custom_path"+++def test_selected_checkout_is_not_given_managed_runtime_repair_advice(settings_store, tmp_path):+ from core.inference.llama_cpp import LlamaCppBackend++ root = tmp_path / "llama.cpp"+ binary = _binary(root)+ path_settings.set_custom_llama_cpp_path(str(root))++ assert LlamaCppBackend._is_unsloth_managed_binary(str(binary)) is False+ message = LlamaCppBackend._missing_library_message("libllama.so", str(binary))+ assert "unsloth studio update" not in message+ assert "custom install" in message+++def test_settings_route_round_trips_the_selected_folder(settings_store, monkeypatch, tmp_path):+ from routes import settings as settings_route++ root = tmp_path / "route-selected"+ binary = _binary(root)+ monkeypatch.setattr(settings_route, "_llama_cpp_path_reload_required", lambda: False)++ saved = settings_route.update_llama_cpp_path(+ settings_route.LlamaCppPathPayload(path = str(root)),+ current_subject = "studio-user",+ via_api_key = False,+ )+ loaded = settings_route.get_llama_cpp_path(current_subject = "studio-user")++ assert saved.path == str(root.resolve())+ assert saved.source == "studio"+ assert saved.resolved_binary == str(binary)+ assert loaded == saved+++def test_settings_route_reports_reload_while_old_binary_launch_is_pending(monkeypatch):+ from routes import inference as inference_route+ from routes import settings as settings_route++ class _PendingBackend:+ is_active = False+ _binary_revision_pending = ("old-binary",)++ @staticmethod+ def _binary_changed_since_revision(revision):+ return revision == ("old-binary",)++ monkeypatch.setattr(inference_route, "get_llama_cpp_backend", lambda: _PendingBackend())++ assert settings_route._llama_cpp_path_reload_required() is True+++def test_settings_route_rejects_api_key_writes_before_mutation(monkeypatch):+ from fastapi import HTTPException+ from routes import settings as settings_route++ mutated = False++ def _unexpected_mutation(_path):+ nonlocal mutated+ mutated = True++ monkeypatch.setattr(settings_route, "set_custom_llama_cpp_path", _unexpected_mutation)++ with pytest.raises(HTTPException) as exc_info:+ settings_route.update_llama_cpp_path(+ settings_route.LlamaCppPathPayload(path = None),+ current_subject = "api-client",+ via_api_key = True,+ )++ assert exc_info.value.status_code == 403+ assert mutated is False+++def test_settings_route_returns_the_specific_validation_error(settings_store, tmp_path):+ from fastapi import HTTPException+ from routes import settings as settings_route++ empty = tmp_path / "empty"+ empty.mkdir()++ with pytest.raises(HTTPException) as exc_info:+ settings_route.update_llama_cpp_path(+ settings_route.LlamaCppPathPayload(path = str(empty)),+ current_subject = "studio-user",+ via_api_key = False,+ )++ assert exc_info.value.status_code == 400+ assert exc_info.value.detail == (+ f"No executable {path_settings.llama_server_binary_name()} was found in that folder "+ "or its build/bin directory."+ )diff --git a/studio/backend/tests/test_local_llama_cpp_link.py b/studio/backend/tests/test_local_llama_cpp_link.pyindex a6dab0ee8c4..9568b34fcaf 100644--- a/studio/backend/tests/test_local_llama_cpp_link.py+++ b/studio/backend/tests/test_local_llama_cpp_link.py@@ -18,6 +18,7 @@ from pathlib import Pathimport pytest+from utils import llama_cpp_path_settings as path_settingsfrom utils import llama_cpp_update as ufrom core.inference import llama_cpp as llama_cpp_modulefrom core.inference.llama_cpp import LlamaCppBackend@@ -209,3 +210,26 @@ def test_orphan_cleanup_kills_under_real_root(tmp_path: Path, monkeypatch, scan)killed = _run_orphan_scan(monkeypatch, studio_root, fake, scan, tmp_path)assert killed == 1assert fake.killed is True++[email protected]("scan", ["psutil", "procfs"])+def test_orphan_cleanup_spares_studio_selected_custom_tree(+ tmp_path: Path, monkeypatch, scan+) -> None:+ studio_root = tmp_path / "studio-home"+ studio_root.mkdir()+ custom_root = tmp_path / "user-owned-llama.cpp"+ binary = custom_root / _server_subpath()+ binary.parent.mkdir(parents = True)+ binary.write_text("x")+ monkeypatch.setattr(+ path_settings,+ "get_stored_custom_llama_cpp_path",+ lambda: custom_root.resolve(),+ )++ fake = _FakeProc(os.getpid() + 999, str(binary.resolve()))+ killed = _run_orphan_scan(monkeypatch, studio_root, fake, scan, tmp_path)++ assert killed == 0+ assert fake.killed is Falsediff --git a/studio/backend/tests/test_rag_embed_llama_server.py b/studio/backend/tests/test_rag_embed_llama_server.pyindex 8c9e7723eb6..1d3a32d053e 100644--- a/studio/backend/tests/test_rag_embed_llama_server.py+++ b/studio/backend/tests/test_rag_embed_llama_server.py@@ -445,6 +445,9 @@ def test_ensure_ready_respawns_dead_process(monkeypatch):b._process = _FakeProc(alive = True)# _current() now also checks the served repo, so mark it current.b._model_repo = config.effective_gguf_repo()+ from utils.llama_cpp_path_settings import custom_llama_cpp_path_revision++ b._binary_path_revision = custom_llama_cpp_path_revision()monkeypatch.setattr(b, "_spawn", fake_spawn)b._ensure_ready()@@ -455,6 +458,33 @@ def test_ensure_ready_respawns_dead_process(monkeypatch):assert spawned["n"] == 1+def test_path_save_restarts_embedder_with_new_binary(monkeypatch):+ from utils import llama_cpp_path_settings++ backend = LlamaServerBackend()+ backend._process = _FakeProc(alive = True)+ backend._model_repo = config.effective_gguf_repo()+ backend._binary = "/old/llama-server"+ backend._binary_path_revision = llama_cpp_path_settings.custom_llama_cpp_path_revision()+ monkeypatch.setattr(+ llama_cpp_path_settings, "_path_revision", backend._binary_path_revision + 1+ )+ spawned = []++ def fake_spawn():+ spawned.append(backend._binary)+ backend._process = _FakeProc(alive = True)+ backend._model_repo = config.effective_gguf_repo()+ backend._binary = "/new/llama-server"+ backend._binary_path_revision = llama_cpp_path_settings.custom_llama_cpp_path_revision()++ monkeypatch.setattr(backend, "_spawn", fake_spawn)+ backend._ensure_ready()++ assert spawned == [None]+ assert backend._binary == "/new/llama-server"++def test_post_restarts_once_on_connect_error(monkeypatch):import httpxdiff --git a/studio/backend/tests/test_stt_mtmd_sidecar.py b/studio/backend/tests/test_stt_mtmd_sidecar.pyindex 9241c4160f9..7da2b990357 100644--- a/studio/backend/tests/test_stt_mtmd_sidecar.py+++ b/studio/backend/tests/test_stt_mtmd_sidecar.py@@ -224,6 +224,27 @@ def test_a_switch_to_a_missing_model_keeps_the_working_one(spawned, monkeypatch)sidecar.unload()+def test_path_save_restarts_warm_mtmd_server(spawned, monkeypatch):+ from utils import llama_cpp_path_settings++ made, _, _ = spawned+ sidecar = MtmdSttSidecar(keep_alive_seconds = 0)+ monkeypatch.setattr(MtmdSttSidecar, "_wait_for_server", staticmethod(lambda *a, **k: True))+ sidecar.load("qwen3-asr-0.6b")+ monkeypatch.setattr(+ llama_cpp_path_settings,+ "_path_revision",+ llama_cpp_path_settings.custom_llama_cpp_path_revision() + 1,+ )++ sidecar.load("qwen3-asr-0.6b")++ assert len(made) == 2+ assert made[0].poll() is not None+ assert sidecar.loaded_model == "qwen3-asr-0.6b"+ sidecar.unload()++def test_a_model_switch_never_kills_a_running_transcription(spawned, monkeypatch):made, _, _ = spawnedsidecar = MtmdSttSidecar(keep_alive_seconds = 0)diff --git a/studio/backend/utils/llama_cpp_path_settings.py b/studio/backend/utils/llama_cpp_path_settings.pynew file mode 100644index 00000000000..49a63e4eb69--- /dev/null+++ b/studio/backend/utils/llama_cpp_path_settings.py@@ -0,0 +1,200 @@+# SPDX-License-Identifier: AGPL-3.0-only+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++"""Persist and validate the llama.cpp directory selected in Studio settings."""++from __future__ import annotations++import os+import sys+import threading+from contextlib import contextmanager+from pathlib import Path+from typing import Iterator, Optional++CUSTOM_LLAMA_CPP_PATH_SETTING_KEY = "custom_llama_cpp_path"+MAX_CUSTOM_LLAMA_CPP_PATH_LENGTH = 32767+MANAGED_LLAMA_CPP_PATH_MARKER = "UNSLOTH_STUDIO_MANAGED_LLAMA_CPP_PATH"++_settings_lock = threading.RLock()+_path_revision = 0+++def mark_managed_llama_cpp_path(directory: Path | str) -> bool:+ """Mark Studio's inherited install path without hiding a real env override."""+ configured = os.environ.get("UNSLOTH_LLAMA_CPP_PATH", "").strip()+ if not configured:+ os.environ.pop(MANAGED_LLAMA_CPP_PATH_MARKER, None)+ return False+ try:+ managed = Path(directory).expanduser().resolve(strict = False)+ inherited = Path(configured).expanduser().resolve(strict = False)+ is_managed = inherited == managed+ except (OSError, RuntimeError, ValueError):+ is_managed = False+ if is_managed:+ os.environ[MANAGED_LLAMA_CPP_PATH_MARKER] = "1"+ else:+ os.environ.pop(MANAGED_LLAMA_CPP_PATH_MARKER, None)+ return is_managed+++@contextmanager+def llama_cpp_path_selection_guard() -> Iterator[None]:+ """Serialize a runtime path snapshot with a settings write.++ Model loads and UI saves share this lock so reload status sees one snapshot.+ """+ with _settings_lock:+ yield+++def llama_server_binary_name(platform: Optional[str] = None) -> str:+ return "llama-server.exe" if (platform or sys.platform) == "win32" else "llama-server"+++def llama_server_candidates(+ directory: Path | str, *, platform: Optional[str] = None+) -> tuple[Path, ...]:+ """Supported llama.cpp build layouts, in the runtime's search order."""+ root = Path(directory)+ binary_name = llama_server_binary_name(platform)+ candidates = [+ root / binary_name,+ root / "build" / "bin" / binary_name,+ ]+ if (platform or sys.platform) == "win32":+ candidates.append(root / "build" / "bin" / "Release" / binary_name)+ return tuple(candidates)+++def _usable_binary(path: Path, *, platform: Optional[str] = None) -> bool:+ try:+ if not path.is_file():+ return False+ except OSError:+ return False+ return (platform or sys.platform) == "win32" or os.access(path, os.X_OK)+++def resolve_llama_server_binary(+ directory: Path | str, *, platform: Optional[str] = None+) -> Optional[Path]:+ """Return the first executable llama-server in a supported layout."""+ return next(+ (+ candidate+ for candidate in llama_server_candidates(directory, platform = platform)+ if _usable_binary(candidate, platform = platform)+ ),+ None,+ )+++def get_stored_custom_llama_cpp_path() -> Optional[Path]:+ """The Studio-selected directory, or ``None`` when automatic discovery is active."""+ try:+ from storage.studio_db import get_app_setting+ value = get_app_setting(CUSTOM_LLAMA_CPP_PATH_SETTING_KEY, None)+ except Exception:+ # A settings DB problem must not take the bundled runtime down with it.+ return None+ if not isinstance(value, str):+ return None+ value = value.strip()+ if not value or len(value) > MAX_CUSTOM_LLAMA_CPP_PATH_LENGTH:+ return None+ return Path(value).expanduser()+++def _environment_override() -> tuple[Optional[str], Optional[str], bool]:+ """``(path, variable, direct_binary)`` for the existing environment pins."""+ direct = os.environ.get("LLAMA_SERVER_PATH", "").strip()+ if direct:+ return direct, "LLAMA_SERVER_PATH", True+ directory = os.environ.get("UNSLOTH_LLAMA_CPP_PATH", "").strip()+ if directory and os.environ.get(MANAGED_LLAMA_CPP_PATH_MARKER) != "1":+ return directory, "UNSLOTH_LLAMA_CPP_PATH", False+ return None, None, False+++def custom_llama_cpp_path_source() -> str:+ """The active custom-path authority: environment, studio, or default."""+ env_path, _variable, _direct = _environment_override()+ if env_path is not None:+ return "environment"+ if get_stored_custom_llama_cpp_path() is not None:+ return "studio"+ return "default"+++def _canonical_directory(value: str) -> Path:+ raw = value.strip()+ if not raw:+ raise ValueError("Choose a llama.cpp folder or use the bundled runtime.")+ if len(raw) > MAX_CUSTOM_LLAMA_CPP_PATH_LENGTH:+ raise ValueError("The llama.cpp folder path is too long.")+ try:+ directory = Path(raw).expanduser().resolve(strict = True)+ except (OSError, RuntimeError, ValueError) as exc:+ raise ValueError("The llama.cpp folder does not exist or cannot be accessed.") from exc+ if not directory.is_dir():+ raise ValueError("The custom llama.cpp path must be a folder.")+ if resolve_llama_server_binary(directory) is None:+ binary_name = llama_server_binary_name()+ raise ValueError(+ f"No executable {binary_name} was found in that folder or its build/bin directory."+ )+ return directory+++def set_custom_llama_cpp_path(value: Optional[str]) -> Optional[Path]:+ """Store a validated directory. ``None`` restores automatic discovery."""+ global _path_revision+ env_path, variable, _direct = _environment_override()+ if env_path is not None:+ raise RuntimeError(f"The llama.cpp path is managed by the {variable} environment variable.")+ directory = _canonical_directory(value) if value is not None else None+ with _settings_lock:+ from storage.studio_db import upsert_app_settings+ upsert_app_settings(+ {CUSTOM_LLAMA_CPP_PATH_SETTING_KEY: (str(directory) if directory is not None else None)}+ )+ _path_revision += 1+ return directory+++def custom_llama_cpp_path_revision() -> int:+ """In-process revision used to retire sidecars launched before a path save."""+ with _settings_lock:+ return _path_revision+++def custom_llama_cpp_path_status() -> dict:+ """UI payload describing the effective custom-path selection."""+ env_path, variable, direct_binary = _environment_override()+ source = "default"+ path: Optional[Path] = None+ binary: Optional[Path] = None++ if env_path is not None:+ source = "environment"+ path = Path(env_path).expanduser()+ if direct_binary:+ binary = path if _usable_binary(path) else None+ else:+ binary = resolve_llama_server_binary(path)+ else:+ path = get_stored_custom_llama_cpp_path()+ if path is not None:+ source = "studio"+ binary = resolve_llama_server_binary(path)++ return {+ "path": str(path) if path is not None else None,+ "source": source,+ "editable": source != "environment",+ "available": source == "default" or binary is not None,+ "resolved_binary": str(binary) if binary is not None else None,+ "environment_variable": variable,+ }diff --git a/studio/backend/utils/llama_cpp_update.py b/studio/backend/utils/llama_cpp_update.pyindex 93e1c753d3f..4017eb9ddc9 100644--- a/studio/backend/utils/llama_cpp_update.py+++ b/studio/backend/utils/llama_cpp_update.py@@ -295,6 +295,15 @@ def _active_install_is_local_link(binary: Optional[str]) -> bool:return _flow.active_install_is_local_link(binary, dir_name = "llama.cpp")+def _studio_custom_path_active() -> bool:+ """True when Settings, rather than the managed installer, owns the runtime."""+ try:+ from utils.llama_cpp_path_settings import custom_llama_cpp_path_source+ return custom_llama_cpp_path_source() == "studio"+ except Exception:+ return False++def _local_link_status() -> dict:"""Status payload for a local-link install: unmanaged, no update offered."""return _flow.local_link_status(_job, _job_lock)@@ -368,6 +377,10 @@ def _llama_only_status() -> dict:"""The llama.cpp half of get_update_status (no whisper sub-status)."""binary = _find_binary()+ # A path selected in Settings is user-managed even if its folder happens to+ # contain an Unsloth prebuilt marker. Never offer to replace that tree.+ if _studio_custom_path_active():+ return _local_link_status()# A --with-llama-cpp-dir local link is the user's own tree; never offer to# replace it. Bail before any network/freshness work.if _active_install_is_local_link(binary):@@ -468,6 +481,8 @@ def _resolve_backends_for_host(def _switch_support(binary: Optional[str], marker: Optional[dict]) -> Optional[str]:"""Return why this install cannot be switched, or None if it can."""+ if _studio_custom_path_active():+ return "custom_path"if binary is None:return "not_installed"if _active_install_is_local_link(binary):@@ -779,6 +794,19 @@ _WHISPER_PHASE_WEIGHT = 0.3def _plan_llama_phase(backend_request: Optional[str] = None) -> dict:"""Plan the llama phase for an update or backend switch."""binary = _find_binary()+ if _studio_custom_path_active():+ return {+ "skip_reason": "custom_path",+ "refusal": {+ "started": False,+ "reason": "custom_path",+ "message": (+ "llama.cpp is using the custom folder selected in Settings; "+ "Unsloth won't replace it. Update that build yourself or restore "+ "the bundled runtime first."+ ),+ },+ }# Refuse to update a --with-llama-cpp-dir local link: installing a prebuilt# here would write through the link into the user's own checkout (or fail)# and silently drop the link the flag created.diff --git a/studio/frontend/src/features/model-picker/components/model-selector/folder-browser.tsx b/studio/frontend/src/features/model-picker/components/model-selector/folder-browser.tsxindex 339c1a6e684..0a5401cdc91 100644--- a/studio/frontend/src/features/model-picker/components/model-selector/folder-browser.tsx+++ b/studio/frontend/src/features/model-picker/components/model-selector/folder-browser.tsx@@ -9,6 +9,7 @@ import {Dialog,DialogClose,DialogContent,+ DialogDescription,DialogFooter,DialogHeader,DialogTitle,@@ -30,6 +31,7 @@ export interface FolderBrowserProps {/** Optional initial directory. Defaults to the user's home on the server. */initialPath?: string;title?: string;+ description?: string;confirmLabel?: string;showModelHints?: boolean;}@@ -83,6 +85,7 @@ export function FolderBrowser({onSelect,initialPath,title = "Select folder to detect models",+ description,confirmLabel = "Use this folder",showModelHints = true,}: FolderBrowserProps) {@@ -131,6 +134,7 @@ export function FolderBrowser({// Fetch only on closed -> open; later navigation is driven by `navigate()`,// so `path` is deliberately kept out of the dependency list.+ // biome-ignore lint/correctness/useExhaustiveDependencies: only reopening resets navigation to the initial pathuseEffect(() => {if (!open) return;// fallbackOnError: recover into HOME if initialPath is bad, rather than@@ -159,6 +163,9 @@ export function FolderBrowser({><DialogHeader className="px-6 pt-6 pb-2"><DialogTitle>{title}</DialogTitle>+ <DialogDescription className="sr-only">+ {description ?? title}+ </DialogDescription></DialogHeader>{/* Breadcrumb */}@@ -246,7 +253,8 @@ export function FolderBrowser({(empty directory)</div>)}- {showModelHints && data.model_files_here !== undefined &&+ {showModelHints &&+ data.model_files_here !== undefined &&data.model_files_here > 0 && (<div className="border-t border-border/30 px-6 py-1.5 text-ui-10 text-foreground/70">{data.model_files_here} model filediff --git a/studio/frontend/src/features/model-picker/index.ts b/studio/frontend/src/features/model-picker/index.tsindex 4a2f90c14b8..8e761485c48 100644--- a/studio/frontend/src/features/model-picker/index.ts+++ b/studio/frontend/src/features/model-picker/index.ts@@ -3,6 +3,7 @@export { ModelSelector } from "./components/model-selector";export { FolderBrowser } from "./components/model-selector/folder-browser";+export { invalidateLlamaFlagCatalog } from "./api/llama-flags";export { ModelRowMenu } from "./components/model-selector/model-row-menu";export {makePinRank,diff --git a/studio/frontend/src/features/settings/api/llama-cpp-path.ts b/studio/frontend/src/features/settings/api/llama-cpp-path.tsnew file mode 100644index 00000000000..ccb1a746811--- /dev/null+++ b/studio/frontend/src/features/settings/api/llama-cpp-path.ts@@ -0,0 +1,66 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++import { authFetch } from "@/features/auth";+import { readFastApiError } from "@/lib/format-fastapi-error";++export interface LlamaCppPathSettings {+ path: string | null;+ source: "default" | "studio" | "environment";+ editable: boolean;+ available: boolean;+ resolvedBinary: string | null;+ environmentVariable: string | null;+ reloadRequired: boolean;+}++interface ApiLlamaCppPathSettings {+ path: string | null;+ source: LlamaCppPathSettings["source"];+ editable: boolean;+ available: boolean;+ // biome-ignore lint/style/useNamingConvention: API schema+ resolved_binary: string | null;+ // biome-ignore lint/style/useNamingConvention: API schema+ environment_variable: string | null;+ // biome-ignore lint/style/useNamingConvention: API schema+ reload_required: boolean;+}++function fromApi(value: ApiLlamaCppPathSettings): LlamaCppPathSettings {+ return {+ path: value.path,+ source: value.source,+ editable: value.editable,+ available: value.available,+ resolvedBinary: value.resolved_binary,+ environmentVariable: value.environment_variable,+ reloadRequired: value.reload_required,+ };+}++export async function loadLlamaCppPathSettings(): Promise<LlamaCppPathSettings> {+ const response = await authFetch("/api/settings/llama-cpp-path");+ if (!response.ok) {+ throw new Error(+ await readFastApiError(response, "Failed to load the llama.cpp folder"),+ );+ }+ return fromApi(await response.json());+}++export async function updateLlamaCppPathSettings(+ path: string | null,+): Promise<LlamaCppPathSettings> {+ const response = await authFetch("/api/settings/llama-cpp-path", {+ method: "PUT",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({ path }),+ });+ if (!response.ok) {+ throw new Error(+ await readFastApiError(response, "Failed to update the llama.cpp folder"),+ );+ }+ return fromApi(await response.json());+}diff --git a/studio/frontend/src/features/settings/components/llama-backend-section.tsx b/studio/frontend/src/features/settings/components/llama-backend-section.tsxindex 486792f5f52..8fcdfa4eefd 100644--- a/studio/frontend/src/features/settings/components/llama-backend-section.tsx+++ b/studio/frontend/src/features/settings/components/llama-backend-section.tsx@@ -2,6 +2,7 @@// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0import { Button } from "@/components/ui/button";+import { Input } from "@/components/ui/input";import { Progress } from "@/components/ui/progress";import {Select,@@ -11,13 +12,24 @@ import {SelectValue,} from "@/components/ui/select";import { formatBytes } from "@/features/hub";+import {+ FolderBrowser,+ invalidateLlamaFlagCatalog,+} from "@/features/model-picker";import { type TranslationKey, useT } from "@/i18n";+import { toast } from "@/lib/toast";+import { useEffect, useState } from "react";import {type LlamaBackendOption,isLlamaBackend,llamaBackendSelectionNeedsApply,visibleLlamaBackendOptions,} from "../api/llama-backend";+import {+ type LlamaCppPathSettings,+ loadLlamaCppPathSettings,+ updateLlamaCppPathSettings,+} from "../api/llama-cpp-path";import { useLlamaBackendSwitch } from "../hooks/use-llama-backend-switch";import { backendDisplayName } from "../lib/llama-backend-labels";import { SettingsRow } from "./settings-row";@@ -28,12 +40,180 @@ const UNSUPPORTED_REASONS: Record<string, TranslationKey> = {local_link: "settings.resources.llamaBackend.unsupported.localLink",source_build: "settings.resources.llamaBackend.unsupported.sourceBuild",no_install_dir: "settings.resources.llamaBackend.unsupported.notInstalled",+ custom_path: "settings.resources.llamaBackend.unsupported.customPath",unresolved: "settings.resources.llamaBackend.unsupported.unresolved",};+function LlamaCppPathRow({ onChanged }: { onChanged: () => void }) {+ const t = useT();+ const [settings, setSettings] = useState<LlamaCppPathSettings | null>(null);+ const [draftPath, setDraftPath] = useState("");+ const [browserOpen, setBrowserOpen] = useState(false);+ const [saving, setSaving] = useState(false);+ const [error, setError] = useState<string | null>(null);++ useEffect(() => {+ let active = true;+ void loadLlamaCppPathSettings()+ .then((next) => {+ if (!active) return;+ setSettings(next);+ setDraftPath(next.path ?? "");+ setError(null);+ })+ .catch((reason) => {+ if (!active) return;+ setError(reason instanceof Error ? reason.message : String(reason));+ });+ return () => {+ active = false;+ };+ }, []);++ const save = async (path: string | null) => {+ setSaving(true);+ setError(null);+ try {+ const next = await updateLlamaCppPathSettings(path);+ setSettings(next);+ setDraftPath(next.path ?? "");+ setBrowserOpen(false);+ toast.success(t("settings.resources.llamaBackend.customPath.saved"));+ onChanged();+ } catch (reason) {+ const message = reason instanceof Error ? reason.message : String(reason);+ setError(message);+ toast.error(t("settings.resources.llamaBackend.customPath.saveError"), {+ description: message,+ });+ } finally {+ setSaving(false);+ }+ };++ const pathDirty = Boolean(+ settings?.editable && draftPath.trim() !== (settings.path ?? ""),+ );+ const detail = settings+ ? settings.source === "environment"+ ? t("settings.resources.llamaBackend.customPath.environmentManaged", {+ variable: settings.environmentVariable ?? "UNSLOTH_LLAMA_CPP_PATH",+ })+ : settings.available+ ? settings.reloadRequired+ ? t("settings.resources.llamaBackend.customPath.reloadRequired")+ : settings.source === "studio"+ ? t("settings.resources.llamaBackend.customPath.active")+ : t("settings.resources.llamaBackend.customPath.bundled")+ : t("settings.resources.llamaBackend.customPath.missingBinary")+ : null;++ return (+ <>+ <SettingsRow+ label={t("settings.resources.llamaBackend.customPath.label")}+ description={t(+ "settings.resources.llamaBackend.customPath.description",+ )}+ hint={t("settings.resources.llamaBackend.customPath.hint")}+ className="max-[840px]:flex-col max-[840px]:items-stretch max-[840px]:gap-2"+ >+ <div className="grid w-[392px] min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] gap-x-2 gap-y-1.5 max-[840px]:w-full">+ <Input+ readOnly={!settings?.editable}+ aria-label={t("settings.resources.llamaBackend.customPath.label")}+ value={draftPath}+ placeholder={+ settings+ ? t("settings.resources.llamaBackend.customPath.automatic")+ : t("common.loading")+ }+ onChange={(event) => setDraftPath(event.target.value)}+ onKeyDown={(event) => {+ if (event.key === "Enter" && pathDirty && !saving) {+ void save(draftPath.trim() || null);+ }+ }}+ title={settings?.resolvedBinary ?? settings?.path ?? undefined}+ className="h-8 min-w-0 font-mono text-xs"+ data-testid="llama-cpp-path-input"+ />+ <Button+ variant="outline"+ size="sm"+ className="h-8"+ disabled={!pathDirty || saving}+ onClick={() => void save(draftPath.trim() || null)}+ data-testid="llama-cpp-path-save"+ >+ {saving ? t("common.saving") : t("common.save")}+ </Button>+ <Button+ variant="outline"+ size="sm"+ className="h-8"+ disabled={!settings?.editable || saving}+ onClick={() => setBrowserOpen(true)}+ data-testid="llama-cpp-path-change"+ >+ {saving+ ? t("settings.resources.llamaBackend.customPath.saving")+ : t("settings.resources.llamaBackend.customPath.change")}+ </Button>+ {detail || settings?.source === "studio" ? (+ <div className="col-span-3 flex min-w-0 items-center justify-between gap-2 pl-3.5 pr-1 text-xs text-muted-foreground">+ {detail ? (+ <span title={detail} className="min-w-0 truncate">+ {detail}+ </span>+ ) : null}+ {settings?.source === "studio" ? (+ <Button+ variant="link"+ size="xs"+ className="h-auto shrink-0 px-0 text-xs"+ disabled={saving}+ onClick={() => void save(null)}+ data-testid="llama-cpp-path-reset"+ >+ {t("settings.resources.llamaBackend.customPath.useBundled")}+ </Button>+ ) : null}+ </div>+ ) : null}+ </div>+ </SettingsRow>++ {error ? (+ <p+ className="pb-3 text-xs text-destructive"+ data-testid="llama-cpp-path-error"+ >+ {error}+ </p>+ ) : null}++ <FolderBrowser+ open={browserOpen}+ onOpenChange={setBrowserOpen}+ onSelect={(path) => void save(path)}+ initialPath={settings?.path ?? undefined}+ title={t("settings.resources.llamaBackend.customPath.chooseTitle")}+ description={t(+ "settings.resources.llamaBackend.customPath.description",+ )}+ confirmLabel={t(+ "settings.resources.llamaBackend.customPath.chooseAction",+ )}+ showModelHints={false}+ />+ </>+ );+}+export function LlamaBackendSection() {const t = useT();- const { status, selected, setSelected, running, apply, loadError } =+ const { status, selected, setSelected, running, apply, refresh, loadError } =useLlamaBackendSwitch();const optionLabel = (option: LlamaBackendOption) => {@@ -129,6 +309,13 @@ export function LlamaBackendSection() {</div></SettingsRow>+ <LlamaCppPathRow+ onChanged={() => {+ invalidateLlamaFlagCatalog();+ void refresh(true);+ }}+ />+{running ? (<div className="pb-3" data-testid="llama-backend-progress"><Progressdiff --git a/studio/frontend/src/features/settings/hooks/use-llama-backend-switch.ts b/studio/frontend/src/features/settings/hooks/use-llama-backend-switch.tsindex 6ec4cf209de..5b20824a096 100644--- a/studio/frontend/src/features/settings/hooks/use-llama-backend-switch.ts+++ b/studio/frontend/src/features/settings/hooks/use-llama-backend-switch.ts@@ -218,6 +218,7 @@ export function useLlamaBackendSwitch() {setSelected,running: Boolean(running),apply,+ refresh,loadError,};}diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.tsindex 10a9f6ebfc1..0f02489457e 100644--- a/studio/frontend/src/i18n/locales/ar.ts+++ b/studio/frontend/src/i18n/locales/ar.ts@@ -860,6 +860,24 @@ export const ar = {switchFailed: "تعذّر تغيير خلفية llama.cpp.",switchInterrupted: "توقفت عملية التبديل قبل اكتمالها.",envLocked: "تم ضبطها على {backend} عبر متغيّر البيئة UNSLOTH_LLAMA_CPP_BACKEND، وهو يتجاوز هذا الإعداد.",+ customPath: {+ label: "مجلد llama.cpp مخصّص",+ description: "استخدم إصدار llama-server الخاص بك.",+ hint: "اختر مجلد llama.cpp الذي يحتوي على llama-server، أو إصدارًا يوجد فيه ضمن build/bin. يُستخدم وقت التشغيل المخصّص لمحادثة GGUF والتضمينات ونماذج الصوت المدعومة. تبقى لمتغيرات البيئة الأولوية.",+ automatic: "تلقائي (مضمّن)",+ bundled: "يستخدم وقت تشغيل llama.cpp الذي ثبّته Unsloth.",+ active: "سيُستخدم llama-server المخصّص عند تحميل النموذج التالي.",+ environmentManaged: "تديره متغير البيئة {variable}.",+ missingBinary: "لم يعد llama-server متاحًا في هذا المجلد. اختر مجلدًا آخر أو استخدم وقت التشغيل المضمّن.",+ reloadRequired: "أعد تحميل النموذج لاستخدام llama-server المحدد.",+ change: "تغيير",+ saving: "جارٍ الحفظ...",+ useBundled: "استخدام المضمّن",+ chooseTitle: "اختر مجلد llama.cpp",+ chooseAction: "استخدام هذا المجلد",+ saved: "تم تحديث مجلد llama.cpp",+ saveError: "تعذّر تحديث مجلد llama.cpp",+ },backends: {auto: "تلقائي",cpu: "CPU",@@ -872,6 +890,7 @@ export const ar = {notInstalled: "لم يُعثر على تثبيت llama.cpp مُدار، لذا لا توجد خلفية لتبديلها.",localLink: "llama.cpp مجلد محلي ربطته بنفسك، ولن يستبدله Unsloth.",sourceBuild: "بُني هذا الإصدار من llama.cpp من الشيفرة المصدرية، لذا لا يمكن تبديل خلفيته من هنا.",+ customPath: "تم تحديد مجلد llama.cpp مخصّص. يحدد هذا الإصدار خلفية الحوسبة.",unresolved: "تعذّر التحقق من الخلفيات المتاحة. تحقّق من اتصالك وحاول مرة أخرى.",},// لا يظهر: كلمات إضافية لبحث الإعدادات.diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.tsindex 513dca9852e..e0784dfc14b 100644--- a/studio/frontend/src/i18n/locales/de.ts+++ b/studio/frontend/src/i18n/locales/de.ts@@ -886,6 +886,24 @@ export const de = {switchFailed: "Das llama.cpp-Backend konnte nicht geändert werden.",switchInterrupted: "Der Wechsel wurde vor dem Abschluss unterbrochen.",envLocked: "Durch die Umgebungsvariable UNSLOTH_LLAMA_CPP_BACKEND auf {backend} festgelegt; sie überschreibt diese Einstellung.",+ customPath: {+ label: "Benutzerdefinierter llama.cpp-Ordner",+ description: "Verwende deinen eigenen llama-server-Build.",+ hint: "Wähle den llama.cpp-Ordner mit llama-server oder einen Build, in dem er unter build/bin liegt. Die benutzerdefinierte Laufzeit wird für GGUF-Chat, Einbettungen und unterstützte Sprachmodelle verwendet. Umgebungsvariablen haben weiterhin Vorrang.",+ automatic: "Automatisch (mitgeliefert)",+ bundled: "Verwendet die von Unsloth installierte llama.cpp-Laufzeit.",+ active: "Dein eigener llama-server wird beim nächsten Laden eines Modells verwendet.",+ environmentManaged: "Wird durch die Umgebungsvariable {variable} verwaltet.",+ missingBinary: "llama-server ist in diesem Ordner nicht mehr verfügbar. Wähle einen anderen Ordner oder verwende die mitgelieferte Laufzeit.",+ reloadRequired: "Lade das Modell neu, um den ausgewählten llama-server zu verwenden.",+ change: "Ändern",+ saving: "Speichern...",+ useBundled: "Mitgelieferte Version verwenden",+ chooseTitle: "llama.cpp-Ordner auswählen",+ chooseAction: "Diesen Ordner verwenden",+ saved: "llama.cpp-Ordner aktualisiert",+ saveError: "Der llama.cpp-Ordner konnte nicht aktualisiert werden",+ },backends: {auto: "Automatisch",cpu: "CPU",@@ -898,6 +916,7 @@ export const de = {notInstalled: "Es wurde keine von Unsloth verwaltete llama.cpp-Installation gefunden, daher gibt es kein Backend zum Wechseln.",localLink: "llama.cpp ist ein selbst verknüpftes lokales Verzeichnis, das Unsloth nicht ersetzt.",sourceBuild: "Dieses llama.cpp wurde aus dem Quellcode gebaut; sein Backend lässt sich hier nicht wechseln.",+ customPath: "Ein benutzerdefinierter llama.cpp-Ordner ist ausgewählt. Dessen Build bestimmt das Compute-Backend.",unresolved: "Die verfügbaren Backends konnten nicht geprüft werden. Prüfe deine Verbindung und versuche es erneut.",},// Wird nicht angezeigt: zusätzliche Begriffe für die Einstellungssuche.diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.tsindex 27299c61d92..924b4dfef50 100644--- a/studio/frontend/src/i18n/locales/en.ts+++ b/studio/frontend/src/i18n/locales/en.ts@@ -856,6 +856,24 @@ export const en = {switchFailed: "Could not change the llama.cpp backend.",switchInterrupted: "The switch was interrupted before completion.",envLocked: "Set to {backend} by the UNSLOTH_LLAMA_CPP_BACKEND environment variable, which overrides this setting.",+ customPath: {+ label: "Custom llama.cpp folder",+ description: "Use your own llama-server build.",+ hint: "Choose the llama.cpp folder containing llama-server, or a build where it is under build/bin. The custom runtime is used for GGUF chat, embeddings, and supported voice models. Environment variables still take priority.",+ automatic: "Automatic (bundled)",+ bundled: "Uses the llama.cpp runtime installed by Unsloth.",+ active: "Your custom llama-server will be used for the next model load.",+ environmentManaged: "Managed by the {variable} environment variable.",+ missingBinary: "llama-server is no longer available in this folder. Choose another folder or use the bundled runtime.",+ reloadRequired: "Reload the model to use the selected llama-server.",+ change: "Change",+ saving: "Saving...",+ useBundled: "Use bundled",+ chooseTitle: "Choose llama.cpp folder",+ chooseAction: "Use this folder",+ saved: "llama.cpp folder updated",+ saveError: "Couldn't update the llama.cpp folder",+ },backends: {auto: "Automatic",cpu: "CPU",@@ -868,11 +886,12 @@ export const en = {notInstalled: "No managed llama.cpp install was found, so there is no backend to switch.",localLink: "llama.cpp is a local directory you linked yourself, so Unsloth will not replace it.",sourceBuild: "This llama.cpp was built from source, so its backend cannot be switched from here.",+ customPath: "A custom llama.cpp folder is selected. Its build decides the compute backend.",unresolved: "The available backends could not be checked. Check your connection and try again.",},// Not rendered: extra terms the settings search matches these rows on.llamaBackendKeywords:- "llama.cpp backend gguf inference cuda rocm hip vulkan metal cpu gpu accelerator prebuilt switch engine",+ "llama.cpp backend gguf inference cuda rocm hip vulkan metal cpu gpu accelerator prebuilt switch engine custom path folder directory llama-server executable binary",},modelMemory: {title: "Model memory",diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.tsindex ce335aa6a2e..3313f15550e 100644--- a/studio/frontend/src/i18n/locales/es.ts+++ b/studio/frontend/src/i18n/locales/es.ts@@ -881,6 +881,24 @@ export const es = {switchFailed: "No se pudo cambiar el backend de llama.cpp.",switchInterrupted: "El cambio se interrumpió antes de completarse.",envLocked: "Fijado en {backend} por la variable de entorno UNSLOTH_LLAMA_CPP_BACKEND, que tiene prioridad sobre este ajuste.",+ customPath: {+ label: "Carpeta personalizada de llama.cpp",+ description: "Usa tu propia compilación de llama-server.",+ hint: "Elige la carpeta de llama.cpp que contiene llama-server o una compilación donde esté en build/bin. El runtime personalizado se usa para chat GGUF, embeddings y modelos de voz compatibles. Las variables de entorno siguen teniendo prioridad.",+ automatic: "Automático (incluido)",+ bundled: "Usa el runtime de llama.cpp instalado por Unsloth.",+ active: "Tu llama-server personalizado se usará la próxima vez que cargues un modelo.",+ environmentManaged: "Gestionado por la variable de entorno {variable}.",+ missingBinary: "llama-server ya no está disponible en esta carpeta. Elige otra carpeta o usa el runtime incluido.",+ reloadRequired: "Vuelve a cargar el modelo para usar el llama-server seleccionado.",+ change: "Cambiar",+ saving: "Guardando...",+ useBundled: "Usar incluido",+ chooseTitle: "Elegir carpeta de llama.cpp",+ chooseAction: "Usar esta carpeta",+ saved: "Carpeta de llama.cpp actualizada",+ saveError: "No se pudo actualizar la carpeta de llama.cpp",+ },backends: {auto: "Automático",cpu: "CPU",@@ -893,6 +911,7 @@ export const es = {notInstalled: "No se encontró una instalación de llama.cpp gestionada, así que no hay backend que cambiar.",localLink: "llama.cpp es un directorio local que enlazaste tú, así que Unsloth no lo reemplazará.",sourceBuild: "Este llama.cpp se compiló desde el código fuente, así que su backend no se puede cambiar desde aquí.",+ customPath: "Hay una carpeta personalizada de llama.cpp seleccionada. Su compilación determina el backend de cómputo.",unresolved: "No se pudieron consultar los backends disponibles. Revisa tu conexión e inténtalo de nuevo.",},// No se muestra: términos adicionales para la búsqueda de ajustes.diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.tsindex 90f6718868c..81111558f0f 100644--- a/studio/frontend/src/i18n/locales/fr.ts+++ b/studio/frontend/src/i18n/locales/fr.ts@@ -885,6 +885,24 @@ export const fr = {switchFailed: "Impossible de changer le backend llama.cpp.",switchInterrupted: "Le changement a été interrompu avant d’être terminé.",envLocked: "Fixé à {backend} par la variable d'environnement UNSLOTH_LLAMA_CPP_BACKEND, qui prévaut sur ce réglage.",+ customPath: {+ label: "Dossier llama.cpp personnalisé",+ description: "Utilisez votre propre build de llama-server.",+ hint: "Choisissez le dossier llama.cpp contenant llama-server, ou un build où il se trouve sous build/bin. Le runtime personnalisé est utilisé pour le chat GGUF, les embeddings et les modèles vocaux compatibles. Les variables d'environnement restent prioritaires.",+ automatic: "Automatique (fourni)",+ bundled: "Utilise le runtime llama.cpp installé par Unsloth.",+ active: "Votre llama-server personnalisé sera utilisé au prochain chargement de modèle.",+ environmentManaged: "Géré par la variable d'environnement {variable}.",+ missingBinary: "llama-server n'est plus disponible dans ce dossier. Choisissez un autre dossier ou utilisez le runtime fourni.",+ reloadRequired: "Rechargez le modèle pour utiliser le llama-server sélectionné.",+ change: "Modifier",+ saving: "Enregistrement...",+ useBundled: "Utiliser la version fournie",+ chooseTitle: "Choisir le dossier llama.cpp",+ chooseAction: "Utiliser ce dossier",+ saved: "Dossier llama.cpp mis à jour",+ saveError: "Impossible de mettre à jour le dossier llama.cpp",+ },backends: {auto: "Automatique",cpu: "CPU",@@ -897,6 +915,7 @@ export const fr = {notInstalled: "Aucune installation llama.cpp gérée n'a été trouvée, il n'y a donc pas de backend à changer.",localLink: "llama.cpp est un dossier local que vous avez lié vous-même ; Unsloth ne le remplacera pas.",sourceBuild: "Ce llama.cpp a été compilé depuis les sources, son backend ne peut pas être changé ici.",+ customPath: "Un dossier llama.cpp personnalisé est sélectionné. Son build détermine le backend de calcul.",unresolved: "Impossible de vérifier les backends disponibles. Vérifiez votre connexion et réessayez.",},// Non affiché : termes supplémentaires pour la recherche dans les réglages.diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.tsindex 28e740a270d..d0ea5d1b14d 100644--- a/studio/frontend/src/i18n/locales/hi.ts+++ b/studio/frontend/src/i18n/locales/hi.ts@@ -863,6 +863,24 @@ export const hi = {switchFailed: "llama.cpp बैकएंड नहीं बदला जा सका।",switchInterrupted: "स्विच पूरा होने से पहले बाधित हो गया।",envLocked: "पर्यावरण चर UNSLOTH_LLAMA_CPP_BACKEND ने इसे {backend} पर तय किया है, जो इस सेटिंग पर भारी पड़ता है।",+ customPath: {+ label: "कस्टम llama.cpp फ़ोल्डर",+ description: "अपना llama-server बिल्ड इस्तेमाल करें।",+ hint: "वह llama.cpp फ़ोल्डर चुनें जिसमें llama-server हो, या ऐसा बिल्ड जहाँ यह build/bin में हो। कस्टम रनटाइम GGUF चैट, एम्बेडिंग और समर्थित वॉइस मॉडल के लिए इस्तेमाल होता है। पर्यावरण चर को फिर भी प्राथमिकता मिलती है।",+ automatic: "स्वचालित (बंडल किया हुआ)",+ bundled: "Unsloth द्वारा इंस्टॉल किया गया llama.cpp रनटाइम इस्तेमाल करता है।",+ active: "अगली बार मॉडल लोड होने पर आपका कस्टम llama-server इस्तेमाल होगा।",+ environmentManaged: "{variable} पर्यावरण चर द्वारा प्रबंधित।",+ missingBinary: "इस फ़ोल्डर में llama-server अब उपलब्ध नहीं है। दूसरा फ़ोल्डर चुनें या बंडल रनटाइम इस्तेमाल करें।",+ reloadRequired: "चुने हुए llama-server को इस्तेमाल करने के लिए मॉडल फिर से लोड करें।",+ change: "बदलें",+ saving: "सहेजा जा रहा है...",+ useBundled: "बंडल वाला इस्तेमाल करें",+ chooseTitle: "llama.cpp फ़ोल्डर चुनें",+ chooseAction: "यह फ़ोल्डर इस्तेमाल करें",+ saved: "llama.cpp फ़ोल्डर अपडेट हुआ",+ saveError: "llama.cpp फ़ोल्डर अपडेट नहीं हो सका",+ },backends: {auto: "स्वचालित",cpu: "CPU",@@ -875,6 +893,7 @@ export const hi = {notInstalled: "कोई प्रबंधित llama.cpp इंस्टॉल नहीं मिला, इसलिए बदलने के लिए कोई बैकएंड नहीं है।",localLink: "llama.cpp आपकी अपनी लिंक की हुई लोकल डायरेक्टरी है, इसलिए Unsloth उसे नहीं बदलेगा।",sourceBuild: "यह llama.cpp सोर्स से बनाया गया है, इसलिए इसका बैकएंड यहाँ से नहीं बदला जा सकता।",+ customPath: "एक कस्टम llama.cpp फ़ोल्डर चुना गया है। उसका बिल्ड कंप्यूट बैकएंड तय करता है।",unresolved: "उपलब्ध बैकएंड की जाँच नहीं हो सकी। अपना कनेक्शन देखकर दोबारा कोशिश करें।",},// दिखाया नहीं जाता: सेटिंग्स खोज के लिए अतिरिक्त शब्द।diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.tsindex c5550908758..8d18c727a6b 100644--- a/studio/frontend/src/i18n/locales/it.ts+++ b/studio/frontend/src/i18n/locales/it.ts@@ -852,6 +852,24 @@ export const it = {switchFailed: "Impossibile cambiare il backend di llama.cpp.",switchInterrupted: "Il cambio è stato interrotto prima del completamento.",envLocked: "Impostato su {backend} dalla variabile d'ambiente UNSLOTH_LLAMA_CPP_BACKEND, che ha la precedenza su questa opzione.",+ customPath: {+ label: "Cartella llama.cpp personalizzata",+ description: "Usa la tua build di llama-server.",+ hint: "Scegli la cartella llama.cpp che contiene llama-server o una build in cui si trova sotto build/bin. Il runtime personalizzato viene usato per chat GGUF, embedding e modelli vocali supportati. Le variabili d'ambiente hanno comunque la priorità.",+ automatic: "Automatico (incluso)",+ bundled: "Usa il runtime llama.cpp installato da Unsloth.",+ active: "Il tuo llama-server personalizzato verrà usato al prossimo caricamento del modello.",+ environmentManaged: "Gestito dalla variabile d'ambiente {variable}.",+ missingBinary: "llama-server non è più disponibile in questa cartella. Scegli un'altra cartella o usa il runtime incluso.",+ reloadRequired: "Ricarica il modello per usare il llama-server selezionato.",+ change: "Cambia",+ saving: "Salvataggio...",+ useBundled: "Usa quello incluso",+ chooseTitle: "Scegli la cartella llama.cpp",+ chooseAction: "Usa questa cartella",+ saved: "Cartella llama.cpp aggiornata",+ saveError: "Impossibile aggiornare la cartella llama.cpp",+ },backends: {auto: "Automatico",cpu: "CPU",@@ -864,6 +882,7 @@ export const it = {notInstalled: "Nessuna installazione di llama.cpp gestita da Unsloth, quindi non c'è un backend da cambiare.",localLink: "llama.cpp è una cartella locale collegata da te, quindi Unsloth non la sostituirà.",sourceBuild: "Questo llama.cpp è stato compilato dai sorgenti, quindi il backend non è modificabile da qui.",+ customPath: "È selezionata una cartella llama.cpp personalizzata. La sua build determina il backend di calcolo.",unresolved: "Non è stato possibile controllare i backend disponibili. Verifica la connessione e riprova.",},// Non visualizzato: termini aggiuntivi per la ricerca nelle impostazioni.diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.tsindex 151a57250ac..0d6454a6fc9 100644--- a/studio/frontend/src/i18n/locales/ja.ts+++ b/studio/frontend/src/i18n/locales/ja.ts@@ -843,6 +843,24 @@ export const ja = {switchFailed: "llama.cpp のバックエンドを変更できませんでした。",switchInterrupted: "切り替えは完了する前に中断されました。",envLocked: "環境変数 UNSLOTH_LLAMA_CPP_BACKEND により {backend} に固定されています。この設定より優先されます。",+ customPath: {+ label: "カスタム llama.cpp フォルダー",+ description: "独自の llama-server ビルドを使用します。",+ hint: "llama-server を含む llama.cpp フォルダー、または build/bin 配下にあるビルドを選択します。カスタムランタイムは GGUF チャット、埋め込み、対応する音声モデルで使用されます。環境変数が引き続き優先されます。",+ automatic: "自動(同梱)",+ bundled: "Unsloth がインストールした llama.cpp ランタイムを使用します。",+ active: "次回のモデル読み込みからカスタム llama-server が使用されます。",+ environmentManaged: "環境変数 {variable} によって管理されています。",+ missingBinary: "このフォルダーでは llama-server を利用できなくなりました。別のフォルダーを選ぶか、同梱ランタイムを使用してください。",+ reloadRequired: "選択した llama-server を使用するにはモデルを再読み込みしてください。",+ change: "変更",+ saving: "保存中...",+ useBundled: "同梱版を使用",+ chooseTitle: "llama.cpp フォルダーを選択",+ chooseAction: "このフォルダーを使用",+ saved: "llama.cpp フォルダーを更新しました",+ saveError: "llama.cpp フォルダーを更新できませんでした",+ },backends: {auto: "自動",cpu: "CPU",@@ -855,6 +873,7 @@ export const ja = {notInstalled: "管理対象の llama.cpp インストールが見つからないため、切り替えるバックエンドがありません。",localLink: "llama.cpp は自分でリンクしたローカルディレクトリのため、Unsloth は置き換えません。",sourceBuild: "この llama.cpp はソースからビルドされているため、ここではバックエンドを切り替えられません。",+ customPath: "カスタム llama.cpp フォルダーが選択されています。そのビルドによって計算バックエンドが決まります。",unresolved: "利用可能なバックエンドを確認できませんでした。接続を確認して再試行してください。",},// 非表示: 設定検索用の追加キーワード。diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.tsindex 3da7a963be9..d41930af229 100644--- a/studio/frontend/src/i18n/locales/ko.ts+++ b/studio/frontend/src/i18n/locales/ko.ts@@ -857,6 +857,24 @@ export const ko = {switchFailed: "llama.cpp 백엔드를 변경하지 못했습니다.",switchInterrupted: "전환이 완료되기 전에 중단되었습니다.",envLocked: "환경 변수 UNSLOTH_LLAMA_CPP_BACKEND가 {backend}(으)로 고정했으며, 이 설정보다 우선합니다.",+ customPath: {+ label: "사용자 지정 llama.cpp 폴더",+ description: "직접 빌드한 llama-server를 사용합니다.",+ hint: "llama-server가 들어 있는 llama.cpp 폴더 또는 build/bin 아래에 있는 빌드를 선택하세요. 사용자 지정 런타임은 GGUF 채팅, 임베딩, 지원되는 음성 모델에 사용됩니다. 환경 변수가 계속 우선합니다.",+ automatic: "자동(번들)",+ bundled: "Unsloth가 설치한 llama.cpp 런타임을 사용합니다.",+ active: "다음 모델 로드부터 사용자 지정 llama-server를 사용합니다.",+ environmentManaged: "{variable} 환경 변수로 관리됩니다.",+ missingBinary: "이 폴더에서 llama-server를 더 이상 사용할 수 없습니다. 다른 폴더를 선택하거나 번들 런타임을 사용하세요.",+ reloadRequired: "선택한 llama-server를 사용하려면 모델을 다시 로드하세요.",+ change: "변경",+ saving: "저장 중...",+ useBundled: "번들 사용",+ chooseTitle: "llama.cpp 폴더 선택",+ chooseAction: "이 폴더 사용",+ saved: "llama.cpp 폴더가 업데이트되었습니다",+ saveError: "llama.cpp 폴더를 업데이트하지 못했습니다",+ },backends: {auto: "자동",cpu: "CPU",@@ -869,6 +887,7 @@ export const ko = {notInstalled: "관리되는 llama.cpp 설치를 찾을 수 없어 전환할 백엔드가 없습니다.",localLink: "llama.cpp는 직접 연결한 로컬 디렉터리이므로 Unsloth가 교체하지 않습니다.",sourceBuild: "이 llama.cpp는 소스에서 빌드되어 여기서 백엔드를 전환할 수 없습니다.",+ customPath: "사용자 지정 llama.cpp 폴더가 선택되어 있습니다. 해당 빌드가 컴퓨팅 백엔드를 결정합니다.",unresolved: "사용 가능한 백엔드를 확인하지 못했습니다. 연결을 확인한 뒤 다시 시도하세요.",},// 표시되지 않음: 설정 검색용 추가 키워드.diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.tsindex d2abee95a48..1c066063a34 100644--- a/studio/frontend/src/i18n/locales/pt-br.ts+++ b/studio/frontend/src/i18n/locales/pt-br.ts@@ -869,6 +869,24 @@ export const ptBR = {switchFailed: "Could not change the llama.cpp backend.",switchInterrupted: "The switch was interrupted before completion.",envLocked: "Set to {backend} by the UNSLOTH_LLAMA_CPP_BACKEND environment variable, which overrides this setting.",+ customPath: {+ label: "Pasta personalizada do llama.cpp",+ description: "Use sua própria compilação do llama-server.",+ hint: "Escolha a pasta do llama.cpp que contém o llama-server ou uma compilação em que ele esteja em build/bin. O runtime personalizado é usado no chat GGUF, em embeddings e nos modelos de voz compatíveis. Variáveis de ambiente continuam tendo prioridade.",+ automatic: "Automático (incluído)",+ bundled: "Usa o runtime llama.cpp instalado pelo Unsloth.",+ active: "Seu llama-server personalizado será usado no próximo carregamento de modelo.",+ environmentManaged: "Gerenciado pela variável de ambiente {variable}.",+ missingBinary: "O llama-server não está mais disponível nesta pasta. Escolha outra pasta ou use o runtime incluído.",+ reloadRequired: "Recarregue o modelo para usar o llama-server selecionado.",+ change: "Alterar",+ saving: "Salvando...",+ useBundled: "Usar incluído",+ chooseTitle: "Escolher pasta do llama.cpp",+ chooseAction: "Usar esta pasta",+ saved: "Pasta do llama.cpp atualizada",+ saveError: "Não foi possível atualizar a pasta do llama.cpp",+ },backends: {auto: "Automatic",cpu: "CPU",@@ -881,6 +899,7 @@ export const ptBR = {notInstalled: "No managed llama.cpp install was found, so there is no backend to switch.",localLink: "llama.cpp is a local directory you linked yourself, so Unsloth will not replace it.",sourceBuild: "This llama.cpp was built from source, so its backend cannot be switched from here.",+ customPath: "Uma pasta personalizada do llama.cpp está selecionada. A compilação dela determina o backend de computação.",unresolved: "The available backends could not be checked. Check your connection and try again.",},// Not rendered: extra terms the settings search matches these rows on.diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.tsindex d3d6c1bb407..722c1da400b 100644--- a/studio/frontend/src/i18n/locales/ru.ts+++ b/studio/frontend/src/i18n/locales/ru.ts@@ -865,6 +865,24 @@ export const ru = {switchFailed: "Не удалось изменить бэкенд llama.cpp.",switchInterrupted: "Переключение было прервано до завершения.",envLocked: "Значение {backend} задано переменной окружения UNSLOTH_LLAMA_CPP_BACKEND, она важнее этой настройки.",+ customPath: {+ label: "Пользовательская папка llama.cpp",+ description: "Используйте собственную сборку llama-server.",+ hint: "Выберите папку llama.cpp с llama-server или сборку, где он находится в build/bin. Пользовательская среда используется для чата GGUF, эмбеддингов и поддерживаемых голосовых моделей. Переменные окружения по-прежнему имеют приоритет.",+ automatic: "Автоматически (в комплекте)",+ bundled: "Используется среда llama.cpp, установленная Unsloth.",+ active: "Ваш llama-server будет использован при следующей загрузке модели.",+ environmentManaged: "Управляется переменной окружения {variable}.",+ missingBinary: "llama-server больше недоступен в этой папке. Выберите другую папку или используйте комплектную среду.",+ reloadRequired: "Перезагрузите модель, чтобы использовать выбранный llama-server.",+ change: "Изменить",+ saving: "Сохранение...",+ useBundled: "Использовать комплектный",+ chooseTitle: "Выбрать папку llama.cpp",+ chooseAction: "Использовать эту папку",+ saved: "Папка llama.cpp обновлена",+ saveError: "Не удалось обновить папку llama.cpp",+ },backends: {auto: "Автоматически",cpu: "CPU",@@ -877,6 +895,7 @@ export const ru = {notInstalled: "Управляемая установка llama.cpp не найдена, поэтому менять нечего.",localLink: "llama.cpp, это локальный каталог, который вы подключили сами, и Unsloth его не заменяет.",sourceBuild: "Этот llama.cpp собран из исходников, его бэкенд нельзя переключить отсюда.",+ customPath: "Выбрана пользовательская папка llama.cpp. Её сборка определяет вычислительный бэкенд.",unresolved: "Не удалось проверить доступные бэкенды. Проверьте подключение и повторите попытку.",},// Не отображается: дополнительные слова для поиска по настройкам.diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.tsindex 190fadab78b..645166f9830 100644--- a/studio/frontend/src/i18n/locales/zh-CN.ts+++ b/studio/frontend/src/i18n/locales/zh-CN.ts@@ -839,6 +839,24 @@ export const zhCN = {switchFailed: "无法更改 llama.cpp 后端。",switchInterrupted: "切换在完成前中断。",envLocked: "已由环境变量 UNSLOTH_LLAMA_CPP_BACKEND 固定为 {backend},其优先级高于此设置。",+ customPath: {+ label: "自定义 llama.cpp 文件夹",+ description: "使用你自己的 llama-server 构建。",+ hint: "选择包含 llama-server 的 llama.cpp 文件夹,或 llama-server 位于 build/bin 下的构建。自定义运行时用于 GGUF 聊天、嵌入和受支持的语音模型。环境变量仍然优先。",+ automatic: "自动(内置)",+ bundled: "使用 Unsloth 安装的 llama.cpp 运行时。",+ active: "下次加载模型时将使用你的自定义 llama-server。",+ environmentManaged: "由 {variable} 环境变量管理。",+ missingBinary: "此文件夹中的 llama-server 已不可用。请选择其他文件夹或使用内置运行时。",+ reloadRequired: "请重新加载模型以使用所选 llama-server。",+ change: "更改",+ saving: "正在保存...",+ useBundled: "使用内置版本",+ chooseTitle: "选择 llama.cpp 文件夹",+ chooseAction: "使用此文件夹",+ saved: "llama.cpp 文件夹已更新",+ saveError: "无法更新 llama.cpp 文件夹",+ },backends: {auto: "自动",cpu: "CPU",@@ -851,6 +869,7 @@ export const zhCN = {notInstalled: "未找到受管理的 llama.cpp 安装,因此没有可切换的后端。",localLink: "llama.cpp 是你自己链接的本地目录,Unsloth 不会替换它。",sourceBuild: "此 llama.cpp 由源码编译,无法在这里切换后端。",+ customPath: "已选择自定义 llama.cpp 文件夹。其构建决定计算后端。",unresolved: "无法检查可用的后端。请检查网络连接后重试。",},// 不显示:用于设置搜索的额外词条。diff --git a/studio/frontend/tests/llama-backend-payload.test.ts b/studio/frontend/tests/llama-backend-payload.test.tsindex 484c6fb0310..784b45aaed3 100644--- a/studio/frontend/tests/llama-backend-payload.test.ts+++ b/studio/frontend/tests/llama-backend-payload.test.ts@@ -172,6 +172,7 @@ test("every unsupported reason survives the parser verbatim", () => {"local_link","source_build","no_install_dir",+ "custom_path","unresolved",]) {const status = parseLlamaBackendStatus({