Instructions to use eaddario/gemma-4-E4B-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 eaddario/gemma-4-E4B-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 eaddario/gemma-4-E4B-it-GGUF:F16 # Run inference directly in the terminal: llama cli -hf eaddario/gemma-4-E4B-it-GGUF:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf eaddario/gemma-4-E4B-it-GGUF:F16 # Run inference directly in the terminal: llama cli -hf eaddario/gemma-4-E4B-it-GGUF:F16
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 eaddario/gemma-4-E4B-it-GGUF:F16 # Run inference directly in the terminal: ./llama-cli -hf eaddario/gemma-4-E4B-it-GGUF:F16
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 eaddario/gemma-4-E4B-it-GGUF:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf eaddario/gemma-4-E4B-it-GGUF:F16
Use Docker
docker model run hf.co/eaddario/gemma-4-E4B-it-GGUF:F16
- LM Studio
- Jan
- Ollama
How to use eaddario/gemma-4-E4B-it-GGUF with Ollama:
ollama run hf.co/eaddario/gemma-4-E4B-it-GGUF:F16
- Unsloth Desktop
- Pi
How to use eaddario/gemma-4-E4B-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 eaddario/gemma-4-E4B-it-GGUF:F16
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": "eaddario/gemma-4-E4B-it-GGUF:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use eaddario/gemma-4-E4B-it-GGUF with Docker Model Runner:
docker model run hf.co/eaddario/gemma-4-E4B-it-GGUF:F16
- Lemonade
How to use eaddario/gemma-4-E4B-it-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull eaddario/gemma-4-E4B-it-GGUF:F16
Run and chat with the model
lemonade run user.gemma-4-E4B-it-GGUF-F16
List all available models
lemonade list
- Hermes Agent
How to use eaddario/gemma-4-E4B-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 eaddario/gemma-4-E4B-it-GGUF:F16
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 eaddario/gemma-4-E4B-it-GGUF:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use eaddario/gemma-4-E4B-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 eaddario/gemma-4-E4B-it-GGUF:F16
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 "eaddario/gemma-4-E4B-it-GGUF:F16" \ --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"
Update README.md
Browse files
README.md
CHANGED
|
@@ -69,7 +69,7 @@ For testing and comparison, I use models produced by [Bartowski][btk] (see credi
|
|
| 69 |
All experimental versions were generated using an appropriate imatrix created from datasets available at [eaddario/imatrix-calibration][ical]. In `llama.cpp`, an imatrix is a calibration file derived from running representative text through the model and collecting activation statistics. It is used to weight quantization error so that error in more “important” directions (as estimated from activations) is penalized more heavily.
|
| 70 |
|
| 71 |
The process to generate these models is roughly as follows:
|
| 72 |
-
1. Convert the original model's [safetensors][sfts] to [GGUF][ggf] F16
|
| 73 |
2. Estimate the [Perplexity][ppl] score for the F16 model (baseline) using the [wikitext-2-raw-v1][wki-dat] dataset, and save the [logits][lgt]
|
| 74 |
3. Generate an [imatrix][imx-dat] from the most appropriate [calibration dataset][ical]
|
| 75 |
4. Quantize the baseline model targeting a bpw average (e.g. `llama-quantize --target-bpw 4.5678 --state-file --imatrix imatrix.gguf baseline-model-F16.gguf 12`)
|
|
@@ -77,7 +77,20 @@ The process to generate these models is roughly as follows:
|
|
| 77 |
6. Keep version with the best 𝜌PPL and μKLD scores
|
| 78 |
7. Repeat until all desired quants are created
|
| 79 |
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
# Advantages and disadvantages of the global target bits‑per‑weight quantization process
|
| 83 |
### Advantages
|
|
|
|
| 69 |
All experimental versions were generated using an appropriate imatrix created from datasets available at [eaddario/imatrix-calibration][ical]. In `llama.cpp`, an imatrix is a calibration file derived from running representative text through the model and collecting activation statistics. It is used to weight quantization error so that error in more “important” directions (as estimated from activations) is penalized more heavily.
|
| 70 |
|
| 71 |
The process to generate these models is roughly as follows:
|
| 72 |
+
1. Convert the original model's [safetensors][sfts] to [GGUF][ggf] F16
|
| 73 |
2. Estimate the [Perplexity][ppl] score for the F16 model (baseline) using the [wikitext-2-raw-v1][wki-dat] dataset, and save the [logits][lgt]
|
| 74 |
3. Generate an [imatrix][imx-dat] from the most appropriate [calibration dataset][ical]
|
| 75 |
4. Quantize the baseline model targeting a bpw average (e.g. `llama-quantize --target-bpw 4.5678 --state-file --imatrix imatrix.gguf baseline-model-F16.gguf 12`)
|
|
|
|
| 77 |
6. Keep version with the best 𝜌PPL and μKLD scores
|
| 78 |
7. Repeat until all desired quants are created
|
| 79 |
|
| 80 |
+
### Misconceptions about BF16 to F16 Conversion
|
| 81 |
+
A common concern when converting BFloat16 ([BF16][bf16]) models to Float16 (F16) is the potential for accuracy loss. Specifically:
|
| 82 |
+
- Weight Clipping (Overflow): Clipping, or overflow, is often feared but only occurs if a model's weights exceed the range of ±65,503. This is a relatively rare issue in practice.
|
| 83 |
+
- Subnormal Zeroing (Underflow): A more frequent occurrence is underflow, where weights smaller than approximately 5.96x10⁻⁸ are converted to zero.
|
| 84 |
+
|
| 85 |
+
Crucially, when the F16 model is subsequently used for quantization, the resulting degradation in metrics like Perplexity ([PPL][ppl]) or Kullback–Leibler Divergence ([KLD][kld]) is minimal. Any variations are typically restricted to the hundreds or thousandths decimal places compared to the BF16 model.
|
| 86 |
+
|
| 87 |
+
However, considering that weight clipping presents a more substantial risk to model integrity, every BF16 base model undergoes validation prior to the conversion process. Consequently, no models hosted in this repository exhibit performance degradation due to overflow clipping.
|
| 88 |
+
|
| 89 |
+
While BF16 offers precision benefits, performance remains a key factor.
|
| 90 |
+
- Conversion Speed: Tests, such as timing `convert_hf_to_gguf.py`, show a notable performance difference, with conversion to BF16 being 15–30% slower than to F16.
|
| 91 |
+
- Inference Speed: A less pronounced but still present difference (3–6%) is observed during inference. Although native BF support has been introduced by many chip manufacturers, the slower performance **may** stem from the entire software and hardware stack (firmware, libraries, etc.) not being fully optimized yet.
|
| 92 |
+
|
| 93 |
+
The choice to prioritize F16 over BF16 is driven by a focus on maximizing performance in specific deployment environments. My primary objective is not large-scale quantization production, a domain where others like [Bartowski][btk] and [Unsloth][ust] excel at, but rather optimizing inference performance for resource-constrained environments. Since BF16 support is not yet widespread in areas like mobile, edge, and embedded devices, using F16 ensures broader compatibility and easier optimization for these use cases.
|
| 94 |
|
| 95 |
# Advantages and disadvantages of the global target bits‑per‑weight quantization process
|
| 96 |
### Advantages
|