Instructions to use Shariyat/gemma-4-E2B-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 Shariyat/gemma-4-E2B-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 Shariyat/gemma-4-E2B-it-GGUF:IQ3_S # Run inference directly in the terminal: llama cli -hf Shariyat/gemma-4-E2B-it-GGUF:IQ3_S
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Shariyat/gemma-4-E2B-it-GGUF:IQ3_S # Run inference directly in the terminal: llama cli -hf Shariyat/gemma-4-E2B-it-GGUF:IQ3_S
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 Shariyat/gemma-4-E2B-it-GGUF:IQ3_S # Run inference directly in the terminal: ./llama-cli -hf Shariyat/gemma-4-E2B-it-GGUF:IQ3_S
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 Shariyat/gemma-4-E2B-it-GGUF:IQ3_S # Run inference directly in the terminal: ./build/bin/llama-cli -hf Shariyat/gemma-4-E2B-it-GGUF:IQ3_S
Use Docker
docker model run hf.co/Shariyat/gemma-4-E2B-it-GGUF:IQ3_S
- LM Studio
- Jan
- vLLM
How to use Shariyat/gemma-4-E2B-it-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Shariyat/gemma-4-E2B-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": "Shariyat/gemma-4-E2B-it-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Shariyat/gemma-4-E2B-it-GGUF:IQ3_S
- Ollama
How to use Shariyat/gemma-4-E2B-it-GGUF with Ollama:
ollama run hf.co/Shariyat/gemma-4-E2B-it-GGUF:IQ3_S
- Unsloth Desktop
- Pi
How to use Shariyat/gemma-4-E2B-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 Shariyat/gemma-4-E2B-it-GGUF:IQ3_S
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": "Shariyat/gemma-4-E2B-it-GGUF:IQ3_S" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Shariyat/gemma-4-E2B-it-GGUF with Docker Model Runner:
docker model run hf.co/Shariyat/gemma-4-E2B-it-GGUF:IQ3_S
- Lemonade
How to use Shariyat/gemma-4-E2B-it-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Shariyat/gemma-4-E2B-it-GGUF:IQ3_S
Run and chat with the model
lemonade run user.gemma-4-E2B-it-GGUF-IQ3_S
List all available models
lemonade list
- Hermes Agent
How to use Shariyat/gemma-4-E2B-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 Shariyat/gemma-4-E2B-it-GGUF:IQ3_S
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 Shariyat/gemma-4-E2B-it-GGUF:IQ3_S
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Shariyat/gemma-4-E2B-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 Shariyat/gemma-4-E2B-it-GGUF:IQ3_S
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 "Shariyat/gemma-4-E2B-it-GGUF:IQ3_S" \ --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"
Gemma 4 E2B Instruct — GGUF Quantizations
Quantized versions of google/gemma-4-E2B-it, converted to GGUF format and optimized for local deployment on PC and mobile devices.
All variants were produced using an importance matrix (imatrix) to preserve model quality as much as possible at each compression level.
Available Files
| File | Size | Min RAM | Recommended For |
|---|---|---|---|
gemma-4-E2B-it-Q4_0-imat.gguf |
3.4 Go | 5 Go | Desktop / laptop |
gemma-4-E2B-it-Q4_0.gguf |
3.4 Go | 5 Go | Desktop / laptop |
gemma-4-E2B-it-IQ4_XS-imat.gguf |
3.3 Go | 4.5 Go | Best quality/size ratio ✅ |
gemma-4-E2B-it-Q3_K_M-imat.gguf |
3.2 Go | 4 Go | Good balance |
gemma-4-E2B-it-Q3_K_M.gguf |
3.2 Go | 4 Go | Good balance |
gemma-4-E2B-it-Q3_K_S-imat.gguf |
3.1 Go | 4 Go | Mobile mid-range |
gemma-4-E2B-it-IQ3_S-imat.gguf |
3.1 Go | 4 Go | Mobile mid-range |
gemma-4-E2B-it-Q2_K-imat.gguf |
3.0 Go | 3.5 Go | Low-end devices |
Not sure which to pick? Start with
IQ4_XS-imaton PC, andQ3_K_S-imatorQ2_K-imaton mobile.
What is Quantization?
Quantization reduces the precision of a model's numerical weights — for example from 16-bit floating point down to 3 or 4 bits per value. This dramatically shrinks the file size and RAM usage, making it possible to run large language models on consumer hardware.
The trade-off is a small loss in output quality, which is more noticeable at lower bit levels (Q2) and barely perceptible at higher ones (Q4).
imatrix (importance matrix) is a technique that analyzes which weights matter most for the model's behavior and preserves them more carefully during compression. The -imat variants in this repo use this method and consistently outperform standard quantizations of the same bit level.
Quick Start — Desktop / Laptop
1. Download llama.cpp
Pre-built binaries for Windows, macOS, and Linux are available on the llama.cpp releases page. Download the latest release for your platform.
2. Download a model file
Pick one file from the list above and download it from this repository.
3. Run
./llama-cli \
-m gemma-4-E2B-it-IQ4_XS-imat.gguf \
-p "<start_of_turn>user\nHello, how are you?<end_of_turn>\n<start_of_turn>model\n" \
-n 512 \
--temp 1.0 --top-p 0.95 --top-k 64 \
--no-display-prompt
Run as a local chat server (OpenAI-compatible API)
./llama-server \
-m gemma-4-E2B-it-IQ4_XS-imat.gguf \
--port 8080 \
--ctx-size 4096
Then open http://localhost:8080 in your browser for a built-in chat interface, or connect any OpenAI-compatible client to http://localhost:8080/v1.
Quick Start — Ollama (Easiest on Desktop)
Ollama is the simplest way to run GGUF models locally with a single command.
# 1. Install Ollama (Linux/macOS)
curl -fsSL https://ollama.com/install.sh | sh
# 2. Create a Modelfile
cat > Modelfile << 'EOF'
FROM ./gemma-4-E2B-it-IQ4_XS-imat.gguf
TEMPLATE """<start_of_turn>system
{{ .System }}<end_of_turn>
<start_of_turn>user
{{ .Prompt }}<end_of_turn>
<start_of_turn>model
{{ .Response }}<end_of_turn>
"""
SYSTEM "You are a helpful assistant."
PARAMETER temperature 1.0
PARAMETER top_p 0.95
PARAMETER top_k 64
PARAMETER num_ctx 4096
EOF
# 3. Import and run
ollama create gemma4-e2b -f Modelfile
ollama run gemma4-e2b
Quick Start — Mobile (Android)
Several Android apps support GGUF models and run inference fully offline:
- MLC Chat — open source, supports GGUF
- ChatterUI — simple chat UI, llama.cpp backend
- Pocketpal AI — polished interface, easy model import
General steps:
- Transfer the GGUF file to your Android device (via USB or a file manager app)
- Open the app and point it to the downloaded file
- Start chatting — no internet connection required
Recommended files for mobile:
| Device Type | Recommended File |
|---|---|
| Flagship (8+ Go RAM) | IQ4_XS-imat or Q3_K_M-imat |
| Mid-range (4–6 Go RAM) | Q3_K_S-imat or IQ3_S-imat |
| Low-end (3–4 Go RAM) | Q2_K-imat |
Chat Template
Gemma 4 uses the following conversation format. Make sure your client applies it correctly:
<start_of_turn>system
Your system prompt here.<end_of_turn>
<start_of_turn>user
User message here.<end_of_turn>
<start_of_turn>model
Most modern clients (llama.cpp, Ollama, LM Studio, etc.) handle this automatically when loading a Gemma 4 GGUF file.
Recommended sampling parameters:
| Parameter | Value |
|---|---|
| Temperature | 1.0 |
| Top-P | 0.95 |
| Top-K | 64 |
Model Capabilities
Gemma 4 E2B is a 2.3B effective parameter multimodal model (text + image input, text output). Key strengths:
- Multilingual — trained on 140+ languages, strong on French, English, Arabic, and more
- Reasoning — configurable thinking mode for step-by-step problem solving
- Coding — solid performance on code generation and completion
- Long context — up to 128K token context window
- Compact — designed from the ground up for on-device deployment
Note: Image input requires a multimodal-capable runtime. The GGUF files in this repo support text-only inference via llama.cpp.
Quantization Details
| Step | Tool | Notes |
|---|---|---|
| HF → GGUF | convert_hf_to_gguf.py |
F16 base file |
| Imatrix computation | llama-imatrix |
Calibration dataset |
| Final quantization | llama-quantize --imatrix |
Per variant |
Base model: google/gemma-4-E2B-it (Apache 2.0)
License
These quantized files inherit the license of the original model: Apache 2.0. See the Gemma 4 license for full terms.
- Downloads last month
- 363
2-bit
3-bit
4-bit