Instructions to use unsloth/diffusiongemma-26B-A4B-it-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use unsloth/diffusiongemma-26B-A4B-it-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M
Use Docker
docker model run hf.co/unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use unsloth/diffusiongemma-26B-A4B-it-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/diffusiongemma-26B-A4B-it-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/diffusiongemma-26B-A4B-it-GGUF", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M
- Ollama
How to use unsloth/diffusiongemma-26B-A4B-it-GGUF with Ollama:
ollama run hf.co/unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use unsloth/diffusiongemma-26B-A4B-it-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use unsloth/diffusiongemma-26B-A4B-it-GGUF with Docker Model Runner:
docker model run hf.co/unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M
- Lemonade
How to use unsloth/diffusiongemma-26B-A4B-it-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.diffusiongemma-26B-A4B-it-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use unsloth/diffusiongemma-26B-A4B-it-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use unsloth/diffusiongemma-26B-A4B-it-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Out of Memory on Google Colab only
Compiles and runs on my 8 MB RAM (sic!) notebook, CPU only. (Just decided to add extra swap to test if so, for fun).
Repeatedly OOMs on Google Colab, during compile, here:
[ 32%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-iq4_xs.cu.o
[ 32%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_3.cu.o
[ 32%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q5_k.cu.o
[ 32%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-tile-instance-dkq40-dv40.cu.o
[ 32%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q4_0.cu.o
[ 34%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q5_1.cu.o
[ 34%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_13.cu.o
after plain: cmake --build build -j --config Release --target llama-diffusion-cli
Reminder:
/content/drive/MyDrive/Shared/Downloads/GitHub/llama.cpp# neofetch --off
root@13d001262bd3
-----------------
OS: Ubuntu 22.04.5 LTS x86_64
Host: Google Compute Engine
Kernel: 6.6.122+
Uptime: 7 mins
Packages: 1234 (dpkg)
Shell: bash 5.1.16
Terminal: tmux
CPU: Intel Xeon (2) @ 2.000GHz
GPU: NVIDIA Tesla T4
Memory: 1205MiB / 12975MiB
there and regular llama.cpp compiles, runs well etc:
I have tried it on 2 Google accounts, in 5 sessions so far. Shall rerun the rest with /usr/bin/time -v cmake --build build -j --config Release --target llama-diffusion-cli to show the logs...
OOM-ed once again with some +12 GB RAM spike at [ 38%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_15.cu.o
Note to self:
Try:
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFFand-DCMAKE_CXX_FLAGS_RELEASE="-O2 -g0"-j 2(limits the concurrent compilation threads)
The latter helped to compile without OOM:
CMAKE_BUILD_TYPE=Release
-- ccache found, compilation results will be cached. Disable with GGML_CCACHE=OFF.
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- GGML_SYSTEM_ARCH: x86
-- Including CPU backend
-- x86 detected
-- Adding CPU backend variant ggml-cpu: -march=native
-- CUDA Toolkit found
-- Using CMAKE_CUDA_ARCHITECTURES=75-real CMAKE_CUDA_ARCHITECTURES_NATIVE=75-real
-- CUDA host compiler is GNU 11.4.0
-- Including CUDA backend
-- ggml version: 0.14.0
-- ggml commit: 9b4dae81f-dirty
-- OpenSSL found: 3.0.2
CMake Deprecation Warning at tools/ui/CMakeLists.txt:16 (message):
LLAMA_WEBUI_HF_BUCKET is deprecated, use LLAMA_UI_HF_BUCKET instead
-- Configuring done (50.5s)
-- Generating done (237.7s)
-- Build files have been written to: /content/drive/MyDrive/Shared/Downloads/GitHub/llama.cpp/build
real 4m48.773s
user 0m1.418s
sys 0m2.222s
[ -3%] Built target cpp-httplib
[ -1%] Built target llama-common-base
[ 0%] Built target ggml-base
[ 3%] Built target ggml-cpu
[ 41%] Built target ggml-cuda
[ 43%] Built target ggml
[ 87%] Built target llama
[ 96%] Built target llama-common
[ 96%] Built target llama-diffusion
[ 96%] Built target llama-diffusion-cli
Command being timed: "cmake --build build -j --config Release --target llama-diffusion-cli -j2"
User time (seconds): 1.02
System time (seconds): 2.09
Percent of CPU this job got: 6%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:49.94
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 21120
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 24370
Voluntary context switches: 374024
Involuntary context switches: 1819
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
OK, and these make it run the actual model safely on Google Colab:
#!/bin/bash
# DiffusionGemma Experimental Runner (Tesla T4 Optimized)
# Optimal for 16GB VRAM / 12GB System RAM
# MODEL SELECTION
# Q8_0 is too large (26GB) for T4. Q4_K_M (16GB) is the mandatory baseline.
MODEL="/content/unsloth/diffusiongemma-26B-A4B-it-GGUF/diffusiongemma-26B-A4B-it-Q4_K_M.gguf"
# PARAMETER LOGIC:
# -ngl 20: Maximum safe GPU offload. Leaves ~3GB headroom for CUDA driver and
# DiffusionGemma's large canvas/sampling buffers. Going higher OOMs.
# -n 512: Targets 2 blocks (512 tokens). Higher values increase compute buffer size.
# -cnv: Enables multi-turn conversation mode.
# --diffusion-visual: Optional. Enable to see live denoising.
# ./build/bin/llama-diffusion-cli -m $MODEL -ngl 99 -n 2048 # TOO AGGRESSIVE for T4
# ./build/bin/llama-diffusion-cli -m $MODEL -ngl 0 # TOO SLOW (CPU mode)
nsys profile --stats=true ./build/bin/llama-diffusion-cli \
-m "$MODEL" \
-ngl 20 \
-n 512 \
"$@"
Update: https://unsloth.ai/docs/models/diffusiongemma#unsloth-studio-guide is a much easier method, but one needs to:
pip install unsloth# yes, just forget any .sh orvenvand likenpm install -g localtunnel --verbose# we like to see what happens
2b./usr/local/lib/python3.12/dist-packages/studio/setup.sh# may be needed after server restart, not sure why so yet, because "runinstall.sh" error demands it: 'Studio not set up. Run install.sh first.' *unsloth studio -p 8888 -H 0.0.0.0# it rightly complains that no public URI yetlt --port 8888- We copy the IP shown to the right box
- We may need to refresh the server's GUI (not sure why so yet, otherwise the GGUFs etc are not downloaded yet)
Works.
It probably can be done via .ipynb there, to be tested....
Update, yes, it works, see below, silly me.
Oh, I should have RTFM-ed. Of course: https://colab.research.google.com/github/unslothai/unsloth/blob/main/studio/Unsloth_Studio_Colab.ipynb ... one could just click it.