Text Generation
GGUF
English
Chinese
Arabic
gemma4
gemma
gemma-4
quantized
q4-k-m
llama-cpp
ollama
fine-tuned
rag
offlineaid
australian-consumer-safety
anti-scam
disaster-response
conversational
Instructions to use helenk/gemma-4-E4B-finetune-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 helenk/gemma-4-E4B-finetune-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 helenk/gemma-4-E4B-finetune-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf helenk/gemma-4-E4B-finetune-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 helenk/gemma-4-E4B-finetune-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf helenk/gemma-4-E4B-finetune-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 helenk/gemma-4-E4B-finetune-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf helenk/gemma-4-E4B-finetune-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 helenk/gemma-4-E4B-finetune-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf helenk/gemma-4-E4B-finetune-GGUF:Q4_K_M
Use Docker
docker model run hf.co/helenk/gemma-4-E4B-finetune-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use helenk/gemma-4-E4B-finetune-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "helenk/gemma-4-E4B-finetune-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": "helenk/gemma-4-E4B-finetune-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/helenk/gemma-4-E4B-finetune-GGUF:Q4_K_M
- Ollama
How to use helenk/gemma-4-E4B-finetune-GGUF with Ollama:
ollama run hf.co/helenk/gemma-4-E4B-finetune-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use helenk/gemma-4-E4B-finetune-GGUF with Docker Model Runner:
docker model run hf.co/helenk/gemma-4-E4B-finetune-GGUF:Q4_K_M
- Lemonade
How to use helenk/gemma-4-E4B-finetune-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull helenk/gemma-4-E4B-finetune-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.gemma-4-E4B-finetune-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Add model card with Tier A eval results + Ollama/llama.cpp usage
Browse files
README.md
CHANGED
|
@@ -1,31 +1,97 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
tags:
|
| 3 |
-
-
|
| 4 |
-
-
|
| 5 |
-
-
|
| 6 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
-
#
|
| 10 |
|
| 11 |
-
|
| 12 |
|
| 13 |
-
**
|
| 14 |
-
-
|
| 15 |
-
-
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
##
|
| 18 |
-
- `gemma-4-e4b-it.Q4_K_M.gguf`
|
| 19 |
-
- `gemma-4-e4b-it.F16-mmproj.gguf`
|
| 20 |
|
| 21 |
-
|
| 22 |
-
**Important:** Ollama currently does not support separate mmproj files for vision models.
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: unsloth/gemma-4-E4B-it
|
| 3 |
+
library_name: gguf
|
| 4 |
+
license: gemma
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
- zh
|
| 9 |
+
- ar
|
| 10 |
tags:
|
| 11 |
+
- gemma
|
| 12 |
+
- gemma-4
|
| 13 |
+
- gguf
|
| 14 |
+
- quantized
|
| 15 |
+
- q4-k-m
|
| 16 |
+
- llama-cpp
|
| 17 |
+
- ollama
|
| 18 |
+
- fine-tuned
|
| 19 |
+
- rag
|
| 20 |
+
- offlineaid
|
| 21 |
+
- australian-consumer-safety
|
| 22 |
+
- anti-scam
|
| 23 |
+
- disaster-response
|
| 24 |
+
datasets:
|
| 25 |
+
- helenkwok/offlineaid
|
| 26 |
---
|
| 27 |
|
| 28 |
+
# OfflineAid — Gemma 4 E4B fine-tune (Q4_K_M GGUF)
|
| 29 |
|
| 30 |
+
Q4_K_M-quantized GGUF of the [OfflineAid](https://github.com/helenkwok/offlineaid) Stage-1 fine-tune. Drop-in for `llama.cpp` and Ollama.
|
| 31 |
|
| 32 |
+
- **Base:** [`unsloth/gemma-4-E4B-it`](https://huggingface.co/unsloth/gemma-4-E4B-it)
|
| 33 |
+
- **LoRA:** [`helenk/gemma-4-E4B-lora`](https://huggingface.co/helenk/gemma-4-E4B-lora) — Unsloth fine-tune on Kaggle T4
|
| 34 |
+
- **Merged fp16 source:** [`helenk/gemma-4-E4B-finetune`](https://huggingface.co/helenk/gemma-4-E4B-finetune)
|
| 35 |
+
- **Quantize chain:** `peft.merge_and_unload` → `llama.cpp/convert_hf_to_gguf.py` → `llama-quantize Q4_K_M`
|
| 36 |
+
- **File size:** ~5.0 GB
|
| 37 |
|
| 38 |
+
## Tier A held-out eval (vs stock + RAG)
|
|
|
|
|
|
|
| 39 |
|
| 40 |
+
Held-out: 111 rows stratified per-language (37 EN + 37 ZH + 37 AR) from the 1,113-row [`helenkwok/offlineaid`](https://huggingface.co/datasets/helenkwok/offlineaid) corpus, seed=3407. Both models served by Ollama (Q4_K_M). Greedy decoding, explicit "Answer in {language}" directive.
|
|
|
|
| 41 |
|
| 42 |
+
| Language | Metric | stock + RAG | ft + RAG | Δ |
|
| 43 |
+
|----------|---------------|------------:|---------:|---:|
|
| 44 |
+
| EN | ROUGE-L F1 | 0.688 | **0.699** | +0.011 |
|
| 45 |
+
| EN | Format-OK % | 91.9% | **94.6%** | +2.7 pp |
|
| 46 |
+
| ZH | Format-OK % | 45.9% | **62.2%** | **+16.3 pp** |
|
| 47 |
+
| AR | ROUGE-L F1 | 0.085 | **0.139** | **+63%** |
|
| 48 |
+
| AR | Format-OK % | 21.6% | **54.1%** | **+32.4 pp (2.5×)** |
|
| 49 |
+
| **all** | ROUGE-L F1 | 0.334 | **0.355** | +0.021 |
|
| 50 |
+
| **all** | Format-OK % | 53.2% | **70.3%** | **+17.0 pp** |
|
| 51 |
|
| 52 |
+
The fine-tune's value lives in **multilingual robustness, especially Arabic** (format-OK 21.6% → 54.1%, ROUGE-L +63%). Reproducible via `bash scripts/tier_a_pipeline_eval_only.sh` in the [OfflineAid repo](https://github.com/helenkwok/offlineaid).
|
| 53 |
+
|
| 54 |
+
## Use with Ollama
|
| 55 |
+
|
| 56 |
+
```
|
| 57 |
+
ollama pull hf.co/helenk/gemma-4-E4B-finetune-GGUF
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
Or via a local `Modelfile`:
|
| 61 |
+
|
| 62 |
+
```
|
| 63 |
+
FROM /path/to/gemma-4-E4B-offlineaid-Q4_K_M.gguf
|
| 64 |
+
RENDERER gemma4
|
| 65 |
+
PARSER gemma4
|
| 66 |
+
PARAMETER num_ctx 32768
|
| 67 |
+
PARAMETER stop "<turn|>"
|
| 68 |
+
PARAMETER temperature 0.0
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
```
|
| 72 |
+
ollama create offlineaid-e4b -f Modelfile
|
| 73 |
+
ollama run offlineaid-e4b
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
## Use with llama.cpp
|
| 77 |
+
|
| 78 |
+
```
|
| 79 |
+
./llama-cli \
|
| 80 |
+
-m gemma-4-E4B-offlineaid-Q4_K_M.gguf \
|
| 81 |
+
-p "Answer in Simplified Chinese.\n\nQUESTION: ..." \
|
| 82 |
+
--temp 0.0 -n 256
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
## Intended use
|
| 86 |
+
|
| 87 |
+
Stage 3 of the OfflineAid pipeline — Mac-side pack-builder agent loop. Pixel 7 production deployment uses *stock* Gemma 4 E2B + retrieval, not this fine-tune; see [the project writeup](https://github.com/helenkwok/offlineaid) for the architectural rationale.
|
| 88 |
+
|
| 89 |
+
## License
|
| 90 |
+
|
| 91 |
+
Inherits Google's [Gemma Terms of Use](https://ai.google.dev/gemma/terms). Training data ([`helenkwok/offlineaid`](https://huggingface.co/datasets/helenkwok/offlineaid)) is CC-BY-4.0.
|
| 92 |
+
|
| 93 |
+
## Sibling repos
|
| 94 |
+
|
| 95 |
+
- Merged fp16 safetensors (~16 GB): [`helenk/gemma-4-E4B-finetune`](https://huggingface.co/helenk/gemma-4-E4B-finetune)
|
| 96 |
+
- LoRA adapter (~50 MB): [`helenk/gemma-4-E4B-lora`](https://huggingface.co/helenk/gemma-4-E4B-lora)
|
| 97 |
+
- Smaller E2B variant: [`helenk/gemma-4-E2B-finetune-GGUF`](https://huggingface.co/helenk/gemma-4-E2B-finetune-GGUF)
|