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
Make llama.cpp CURL support optional during CMake builds
Fizza-Mukhtar22210112c6ac
diff --git a/unsloth/save.py b/unsloth/save.pyindex ceb36854d2a..29d9cdcaff2 100644--- a/unsloth/save.py+++ b/unsloth/save.py@@ -130,6 +130,10 @@ ALLOWED_QUANTS = {"q3_k_xs": "3-bit extra small quantization",}+def has_curl():+ return shutil.which("curl") is not None++CURL_FLAG = "-DLLAMA_CURL=ON" if has_curl() else "-DLLAMA_CURL=OFF"def print_quantization_methods():for key, value in ALLOWED_QUANTS.items():@@ -879,8 +883,9 @@ def install_llama_cpp_make_non_blocking():# Uses new CMAKEn_jobs = max(int(psutil.cpu_count()), 1) # Use less CPUs since 1.5x fastercheck = os.system(- "cmake llama.cpp -B llama.cpp/build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=OFF -DLLAMA_CURL=ON"+ f"cmake llama.cpp -B llama.cpp/build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=OFF {CURL_FLAG}")+if check != 0:raise RuntimeError(f"*** Unsloth: Failed compiling llama.cpp using os.system(...) with error {check}. Please report this ASAP!"@@ -991,11 +996,12 @@ def install_llama_cpp_old(version = -10):if try_execute(commands) == "CMAKE":# Instead use CMAKEcommands = [- "cmake llama.cpp -B llama.cpp/build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=OFF -DLLAMA_CURL=ON",+ "cmake llama.cpp -B llama.cpp/build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=OFF {CURL_FLAG}",f"cmake --build llama.cpp/build --config Release -j{psutil.cpu_count()*2} --clean-first --target {' '.join(LLAMA_CPP_TARGETS)}","cp llama.cpp/build/bin/llama-* llama.cpp","rm -rf llama.cpp/build",]+try_execute(commands)# Check if successful@@ -1037,7 +1043,7 @@ def install_llama_cpp_blocking(use_cuda = False):if try_execute(commands) == "CMAKE":# Instead use CMAKEcommands = [- "cmake llama.cpp -B llama.cpp/build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=OFF -DLLAMA_CURL=ON",+ "cmake llama.cpp -B llama.cpp/build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=OFF {CURL_FLAG}",f"cmake --build llama.cpp/build --config Release -j{psutil.cpu_count()*2} --clean-first --target {' '.join(LLAMA_CPP_TARGETS)}","cp llama.cpp/build/bin/llama-* llama.cpp","rm -rf llama.cpp/build",