Instructions to use dahus/gemma-4-e2b-it-Q8_0-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-it-Q8_0-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-it-Q8_0-GGUF", filename="gemma-4-e2b-Q8_0.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-it-Q8_0-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0 # Run inference directly in the terminal: llama-cli -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0 # Run inference directly in the terminal: llama-cli -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0
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-it-Q8_0-GGUF:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0
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-it-Q8_0-GGUF:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0
Use Docker
docker model run hf.co/dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0
- LM Studio
- Jan
- vLLM
How to use dahus/gemma-4-e2b-it-Q8_0-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-it-Q8_0-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-it-Q8_0-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0
- Ollama
How to use dahus/gemma-4-e2b-it-Q8_0-GGUF with Ollama:
ollama run hf.co/dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0
- Unsloth Studio
How to use dahus/gemma-4-e2b-it-Q8_0-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-it-Q8_0-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-it-Q8_0-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-it-Q8_0-GGUF to start chatting
- Pi
How to use dahus/gemma-4-e2b-it-Q8_0-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0
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-it-Q8_0-GGUF:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use dahus/gemma-4-e2b-it-Q8_0-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0
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-it-Q8_0-GGUF:Q8_0
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use dahus/gemma-4-e2b-it-Q8_0-GGUF with Docker Model Runner:
docker model run hf.co/dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0
- Lemonade
How to use dahus/gemma-4-e2b-it-Q8_0-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0
Run and chat with the model
lemonade run user.gemma-4-e2b-it-Q8_0-GGUF-Q8_0
List all available models
lemonade list
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0# Run inference directly in the terminal:
llama-cli -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0Use 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-it-Q8_0-GGUF:Q8_0# Run inference directly in the terminal:
./llama-cli -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0Build 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-it-Q8_0-GGUF:Q8_0# Run inference directly in the terminal:
./build/bin/llama-cli -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0Use Docker
docker model run hf.co/dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0Gemma 4 E2B it — Q8 GGUF
8-bit quantized GGUF version of google/gemma-4-e2b-it.
Highest quality quantization — 96% Top-1 agreement with F16, effectively lossless.
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 · Q6_K
File Info
| Property | Value |
|---|---|
| Format | GGUF Q8 |
| File size | 4.97 GB |
| Bits per weight | ~8 |
| Size vs F16 | 1.9× 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 | 16.2 | 37.1 dB | 95.7% | 0.0151 |
| 🧠 Logic | 16.2 | 36.8 dB | 96.6% | 0.0166 |
| 💻 Code | 16.3 | 37.8 dB | 97.4% | 0.0155 |
| 🔬 Science | 16.3 | 36.7 dB | 94.2% | 0.0209 |
| Overall | 16.2 | 37.11 dB | 96.0% | 0.0171 |
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 |
| Q2_K | 2.99 GB | 31.6 | 5.6× | 5.85 dB | 32.0% | 4.1149 |
| Q3_K_S | 3.11 GB | 28.9 | 5.1× | 10.12 dB | 63.2% | 1.2605 |
| Q3_K_M | 2.98 GB | 27.4 | 4.8× | 13.93 dB | 63.2% | 1.6747 |
| Q4_K_S | 3.37 GB | 25.0 | 4.4× | 19.10 dB | 80.9% | 0.3456 |
| Q4_K_M | 3.43 GB | 24.0 | 4.2× | 20.33 dB | 82.4% | 0.3356 |
| Q5_K_S | 3.6 GB | 21.9 | 3.9x | 23.32 dB | 87.7% | 0.1547 |
| Q5_K_M | 3.63 GB | 22.0 | 3.9× | 23.25 dB | 86.9% | 0.1248 |
| Q8 (this) | 4.97 GB | 16.2 | 2.9× | 37.11 dB | 96.0% | 0.0171 |
Key Findings
- Quality: 37.11 dB SQNR and KL divergence of just 0.017 — for all practical purposes, identical to F16
- Top-1 Agreement: 96.0% — the model picks the same token as F16 96 times out of 100
- Speed: 16.2 tok/s — still 2.9× faster than F16, just slower than lower-bit quants
- Size: 4.63 GB — fits in 6 GB RAM; half the size of F16
- vs Q6_K: +8.4 dB SQNR and +1.9% Top-1 for 1.05 GB extra; worth it if you have the RAM
- Best for: Maximum quality with reasonable size reduction; production deployments where output must match F16 as closely as possible
Usage
# llama.cpp CLI
./llama-cli -m gemma-4-e2b-q8.gguf -p "Explain how a transformer neural network works." -n 200
# llama-cpp-python
from llama_cpp import Llama
llm = Llama(model_path="gemma-4-e2b-q8.gguf", n_ctx=2048)
output = llm("Explain how a transformer neural network works.", max_tokens=200)
print(output["choices"][0]["text"])
Hardware
Tested on: CPU inference (llama.cpp)
Context: 2048 tokens | Greedy decoding
- Downloads last month
- 83
8-bit
Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0# Run inference directly in the terminal: llama-cli -hf dahus/gemma-4-e2b-it-Q8_0-GGUF:Q8_0