Instructions to use dahus/gemma-4-e2b-Q6_K-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use dahus/gemma-4-e2b-Q6_K-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="dahus/gemma-4-e2b-Q6_K-GGUF", filename="gemma-4-e2b-Q6_K.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use dahus/gemma-4-e2b-Q6_K-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 dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K # Run inference directly in the terminal: llama cli -hf dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K # Run inference directly in the terminal: llama cli -hf dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K
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 dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K # Run inference directly in the terminal: ./llama-cli -hf dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K
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 dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K
Use Docker
docker model run hf.co/dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K
- LM Studio
- Jan
- vLLM
How to use dahus/gemma-4-e2b-Q6_K-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dahus/gemma-4-e2b-Q6_K-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": "dahus/gemma-4-e2b-Q6_K-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K
- Ollama
How to use dahus/gemma-4-e2b-Q6_K-GGUF with Ollama:
ollama run hf.co/dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K
- Unsloth Studio
How to use dahus/gemma-4-e2b-Q6_K-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for dahus/gemma-4-e2b-Q6_K-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for dahus/gemma-4-e2b-Q6_K-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for dahus/gemma-4-e2b-Q6_K-GGUF to start chatting
- Pi
How to use dahus/gemma-4-e2b-Q6_K-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use dahus/gemma-4-e2b-Q6_K-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 dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K
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 dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use dahus/gemma-4-e2b-Q6_K-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K
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 "dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K" \ --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"
- Docker Model Runner
How to use dahus/gemma-4-e2b-Q6_K-GGUF with Docker Model Runner:
docker model run hf.co/dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K
- Lemonade
How to use dahus/gemma-4-e2b-Q6_K-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull dahus/gemma-4-e2b-Q6_K-GGUF:Q6_K
Run and chat with the model
lemonade run user.gemma-4-e2b-Q6_K-GGUF-Q6_K
List all available models
lemonade list
Gemma 4 E2B — Q6_K GGUF
6-bit quantized GGUF version of google/gemma-4-e2b-it.
Near-lossless quantization — 94% Top-1 agreement with F16 at a fraction of the size.
Other quantizations in this series:
Q2_K · Q3_K_S · Q3_K_M · Q4_K_S · Q4_K_M · Q5_K_S · Q5_K_M · Q8
File Info
| Property | Value |
|---|---|
| Format | GGUF Q6_K |
| File size | 3.58 GB |
| Bits per weight | ~6 |
| Size vs F16 | 2.4× smaller |
Benchmark Results
Tested across 4 categories (Math, Logic, Code, Science), 3 prompts each.
Greedy decoding, 200 max new tokens. Metrics compare logit distributions vs F16 baseline.
Results by Category
| Category | Speed (tok/s) | SQNR | Top-1 Agreement | KL Divergence |
|---|---|---|---|---|
| 🔢 Math | 19.7 | 28.7 dB | 94.3% | 0.0796 |
| 🧠 Logic | 19.9 | 29.3 dB | 93.2% | 0.0891 |
| 💻 Code | 20.0 | 29.0 dB | 93.6% | 0.0502 |
| 🔬 Science | 19.9 | 27.8 dB | 95.1% | 0.0784 |
| Overall | 19.9 | 28.72 dB | 94.1% | 0.0743 |
Quantization Comparison
| Model | Size | Speed (tok/s) | vs F16 speed | SQNR | Top-1 Agree | KL Div |
|---|---|---|---|---|---|---|
| F16 (baseline) | 8.67 GB | 5.7 | 1.0× | baseline | baseline | baseline |
| Q4_K_M | 3.19 GB | 24.0 | 4.2× | 20.33 dB | 82.4% | 0.3356 |
| Q5_K_M | 3.38 GB | 22.0 | 3.9× | 23.25 dB | 86.9% | 0.1248 |
| Q6_K (this) | 3.58 GB | 19.9 | 3.5× | 28.72 dB | 94.1% | 0.0743 |
| Q8 | 4.63 GB | 16.2 | 2.9× | 37.11 dB | 96.0% | 0.0171 |
Key Findings
- Quality: 94.1% Top-1 agreement — crosses the "near-identical to F16" threshold; only Q8 is better
- SQNR: 28.72 dB — a substantial 5.5 dB jump over Q5_K_M; outputs are essentially indistinguishable from F16 in practice
- Speed: 19.9 tok/s — 3.5× faster than F16
- Size: 3.58 GB — only 1 GB more than Q4_K_M for a major quality improvement
- vs Q8: Q6_K is 1.05 GB smaller and 3.7 tok/s faster, with only a small quality difference (94.1 vs 96.0% Top-1)
- Best for: Quality-sensitive tasks where you want near-F16 fidelity but still need to fit under ~5 GB; scientific explanation, precise reasoning, complex multi-step code
Usage
# llama.cpp CLI
./llama-cli -m gemma-4-e2b-q6k.gguf -p "Explain the difference between supervised and reinforcement learning." -n 200
# llama-cpp-python
from llama_cpp import Llama
llm = Llama(model_path="gemma-4-e2b-q6k.gguf", n_ctx=2048)
output = llm("Explain the difference between supervised and reinforcement learning.", max_tokens=200)
print(output["choices"][0]["text"])
Hardware
Tested on: CPU inference (llama.cpp)
Context: 2048 tokens | Greedy decoding
- Downloads last month
- 49
6-bit