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.

fix(studio): add -ngl -1 when model fits on GPU to enable GPU offloading (#4588)

Daniel Hand87c21aebf52
diff --git a/studio/backend/core/inference/llama_cpp.py b/studio/backend/core/inference/llama_cpp.py
index 7b1db8fd04c..81a087341a0 100644
--- a/studio/backend/core/inference/llama_cpp.py
+++ b/studio/backend/core/inference/llama_cpp.py
@@ -857,6 +857,9 @@ class LlamaCppBackend:
if use_fit:
cmd.extend(["--fit", "on"])
+ elif gpu_indices is not None:
+ # Model fits on selected GPU(s) -- offload all layers
+ cmd.extend(["-ngl", "-1"])
if n_threads is not None:
cmd.extend(["--threads", str(n_threads)])