Text Generation
GGUF
English
llama.cpp
unsloth
qlora
gemma
gemma-4
e4b
edge
calendar
scheduling
structured-output
multimodal
vision
conversational
Instructions to use ParetoOptimal/gemma-cal-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 ParetoOptimal/gemma-cal-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 ParetoOptimal/gemma-cal-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf ParetoOptimal/gemma-cal-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 ParetoOptimal/gemma-cal-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf ParetoOptimal/gemma-cal-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 ParetoOptimal/gemma-cal-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ParetoOptimal/gemma-cal-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 ParetoOptimal/gemma-cal-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ParetoOptimal/gemma-cal-gguf:Q4_K_M
Use Docker
docker model run hf.co/ParetoOptimal/gemma-cal-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ParetoOptimal/gemma-cal-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ParetoOptimal/gemma-cal-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": "ParetoOptimal/gemma-cal-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ParetoOptimal/gemma-cal-gguf:Q4_K_M
- Ollama
How to use ParetoOptimal/gemma-cal-gguf with Ollama:
ollama run hf.co/ParetoOptimal/gemma-cal-gguf:Q4_K_M
- Unsloth Desktop
- Pi
How to use ParetoOptimal/gemma-cal-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ParetoOptimal/gemma-cal-gguf:Q4_K_M
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": "ParetoOptimal/gemma-cal-gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ParetoOptimal/gemma-cal-gguf with Docker Model Runner:
docker model run hf.co/ParetoOptimal/gemma-cal-gguf:Q4_K_M
- Lemonade
How to use ParetoOptimal/gemma-cal-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ParetoOptimal/gemma-cal-gguf:Q4_K_M
Run and chat with the model
lemonade run user.gemma-cal-gguf-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use ParetoOptimal/gemma-cal-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 ParetoOptimal/gemma-cal-gguf:Q4_K_M
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 ParetoOptimal/gemma-cal-gguf:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ParetoOptimal/gemma-cal-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ParetoOptimal/gemma-cal-gguf:Q4_K_M
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 "ParetoOptimal/gemma-cal-gguf:Q4_K_M" \ --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"
Duplicate served gemma-cal (E4B + mmproj) from build-small-hackathon org copy
Browse files- .gitattributes +5 -0
- README.md +149 -0
- gemma-cal-e4b-Q4_K_M.gguf +3 -0
- mmproj-F16.gguf +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
gemma-cal-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
mmproj-F16.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
gemma-cal-staging-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
gemma-cal-e4b-staging-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
gemma-cal-e4b-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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+
- unsloth
|
| 12 |
+
- qlora
|
| 13 |
+
- gemma
|
| 14 |
+
- gemma-4
|
| 15 |
+
- e4b
|
| 16 |
+
- edge
|
| 17 |
+
- calendar
|
| 18 |
+
- scheduling
|
| 19 |
+
- structured-output
|
| 20 |
+
- multimodal
|
| 21 |
+
- vision
|
| 22 |
+
built_buy:
|
| 23 |
+
- ParetoOptimal
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
# gemma-cal E4B β a calendar-native edge LLM (GGUF)
|
| 27 |
+
|
| 28 |
+
**`gemma-cal-e4b-Q4_K_M.gguf`** is a QLoRA fine-tune of **Gemma-4 E4B** (~4B effective
|
| 29 |
+
parameters, ~5.3 GB at Q4_K_M) built for exactly one job: reading a messy human conversation β
|
| 30 |
+
or a photo of a flyer/invite β and emitting a single validated **ActionPlan**: events with exact
|
| 31 |
+
ISO datetimes, calendar conflicts, proposed alternatives, a drafted reply, and a clarifying
|
| 32 |
+
question when the plan is too vague to schedule.
|
| 33 |
+
|
| 34 |
+
It is the **production model of [OffGridSchedula](https://huggingface.co/spaces/ParetoOptimal/OffGridSchedula)**
|
| 35 |
+
serving on a 16 GB T4 via [llama.cpp](https://github.com/ggml-org/llama.cpp), fully local, no
|
| 36 |
+
cloud AI APIs. **Vision** (screenshots/flyers) works by pairing it with the base E4B's projector:
|
| 37 |
+
`unsloth/gemma-4-E4B-it-GGUF / mmproj-F16.gguf`.
|
| 38 |
+
|
| 39 |
+
## Why an edge fine-tune
|
| 40 |
+
|
| 41 |
+
- **Edge-sized by design:** runs on a ~$0.40/hr T4, a gaming GPU, or an Apple-silicon laptop β
|
| 42 |
+
local-first as a parameter count, not a tagline.
|
| 43 |
+
- **Schema-bulletproof:** 100% schema validity on the project eval **even with no system
|
| 44 |
+
prompt**, with stronger no-event discipline (doesn't invent events from "thanks!") and a higher
|
| 45 |
+
rate of *asking* when a date is TBD.
|
| 46 |
+
- **Convention-trained:** learns the product's date semantics ("next Tuesday" = next week's
|
| 47 |
+
Tuesday; weekday-anchored relative dates) instead of generic internet priors.
|
| 48 |
+
- **Eval-gated:** every retrain must clear a 60-example task eval (start-exact datetime matching,
|
| 49 |
+
F1, validity, clarification) before it can be published β the pipeline has rejected eight
|
| 50 |
+
regressed models to date. Full scorecard: the project's `docs/eval-roadmap.md`.
|
| 51 |
+
|
| 52 |
+
## How to run
|
| 53 |
+
|
| 54 |
+
```bash
|
| 55 |
+
# text + vision via llama.cpp server (OpenAI-compatible API on :8080/v1)
|
| 56 |
+
MODEL=$(python -c "from huggingface_hub import hf_hub_download as d; print(d('ParetoOptimal/gemma-4-cal-gguf','gemma-cal-e4b-Q4_K_M.gguf'))")
|
| 57 |
+
MMPROJ=$(python -c "from huggingface_hub import hf_hub_download as d; print(d('unsloth/gemma-4-E4B-it-GGUF','mmproj-F16.gguf'))")
|
| 58 |
+
llama-server -m "$MODEL" --mmproj "$MMPROJ" -ngl 999 -c 8192 --jinja --port 8080
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
Use the explicit filename rather than the `-hf repo:Q4_K_M` shorthand β this repo also stores
|
| 62 |
+
legacy training artifacts at the same quant.
|
| 63 |
+
|
| 64 |
+
The model is trained to answer with **only** an ActionPlan JSON object. Typical user turn:
|
| 65 |
+
|
| 66 |
+
```
|
| 67 |
+
Current datetime: Monday, 2026-09-14T09:00:00
|
| 68 |
+
Existing calendar: (none provided)
|
| 69 |
+
|
| 70 |
+
Conversation:
|
| 71 |
+
Room parent: Picture day is Thursday β photos at 9am, wear the green shirt!
|
| 72 |
+
Me: thanks!
|
| 73 |
+
|
| 74 |
+
Return the ActionPlan JSON now.
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
β
|
| 78 |
+
|
| 79 |
+
```json
|
| 80 |
+
{
|
| 81 |
+
"reasoning": "School picture day Thursday Sep 17 at 9am; wear green shirt.",
|
| 82 |
+
"events": [{"title": "School picture day", "start": "2026-09-17T09:00:00",
|
| 83 |
+
"end": null, "location": "School", "attendees": [],
|
| 84 |
+
"reminder_minutes": 720, "notes": "Wear green class shirt"}],
|
| 85 |
+
"conflicts": [], "proposed_times": [],
|
| 86 |
+
"reply_draft": "Got it β green shirt Thursday!", "needs_clarification": null
|
| 87 |
+
}
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
## Honest evaluation
|
| 91 |
+
|
| 92 |
+
Scored on the project's 60-example held-out eval (50 gold events; start-exact datetime matching;
|
| 93 |
+
temp 0; same constrained-JSON call production uses):
|
| 94 |
+
|
| 95 |
+
| with system prompt | stock E4B | **gemma-cal E4B** |
|
| 96 |
+
| --- | --- | --- |
|
| 97 |
+
| schema validity | 1.0 | 1.0 |
|
| 98 |
+
| event F1 | 0.97 | 0.97 |
|
| 99 |
+
| start-exact recall | 0.96 | 0.96 |
|
| 100 |
+
| clarification recall | 1.0 | 1.0 |
|
| 101 |
+
|
| 102 |
+
| bare (no system prompt) | stock E4B | **gemma-cal E4B** |
|
| 103 |
+
| --- | --- | --- |
|
| 104 |
+
| schema validity | 0.967 | **1.0** |
|
| 105 |
+
| no-event accuracy | 0.70 | **0.80** |
|
| 106 |
+
| clarification recall | 0.50 | **0.625** |
|
| 107 |
+
| event F1 | **0.682** | 0.644 |
|
| 108 |
+
|
| 109 |
+
i.e. **parity with stock under the engineered prompt** (identical error counts) and **better
|
| 110 |
+
schema validity and discipline with no prompt at all**. Published after six eval-gated training
|
| 111 |
+
iterations; the publish-at-parity call was an explicit owner decision (the auto-gate requires
|
| 112 |
+
strict dominance).
|
| 113 |
+
|
| 114 |
+
## Training
|
| 115 |
+
|
| 116 |
+
- **Base:** `google/gemma-4-E4B-it`
|
| 117 |
+
- **Method:** QLoRA (4-bit) with [Unsloth](https://github.com/unslothai/unsloth); LoRA r=16,
|
| 118 |
+
alpha=16, targets q/k/v/o/gate/up/down; merged to 16-bit before GGUF conversion.
|
| 119 |
+
- **Recipe details that mattered:** trained on Gemma-4's **native chat template**
|
| 120 |
+
(`<|turn>role β¦ <turn|>` β the same template embedded in the GGUF and served by
|
| 121 |
+
`llama-server --jinja`), loss masked to the assistant turn only, LR 5e-5, 1 epoch.
|
| 122 |
+
- **Data:** 139 hand-authored thread-style examples (4Γ upsampled) + 2,000 examples converted
|
| 123 |
+
from **SMCalFlow** (CC BY-SA 4.0 β *Semantic Machines et al., "Task-Oriented Dialogue as
|
| 124 |
+
Dataflow Synthesis," TACL 2020*), with LISP date/time programs resolved against per-example
|
| 125 |
+
reference datetimes and convention-conflicting rows filtered out.
|
| 126 |
+
- **Hardware:** single A100-80GB on Modal; `convert_hf_to_gguf.py` + `llama-quantize` for export.
|
| 127 |
+
|
| 128 |
+
Reproduce / retrain (eval-gated): `training/gated_retrain.py` in the
|
| 129 |
+
[project repo](https://github.com/n8mauer/imessage-calendar-agent).
|
| 130 |
+
|
| 131 |
+
## Files in this repo
|
| 132 |
+
|
| 133 |
+
| File | Size | Status |
|
| 134 |
+
| --- | --- | --- |
|
| 135 |
+
| **`gemma-cal-e4b-Q4_K_M.gguf`** | ~5.3 GB | **The model.** Production edge fine-tune (this card). |
|
| 136 |
+
| `gemma-cal-Q4_K_M.gguf` | ~18.7 GB | Legacy 31B training artifact from earlier iterations; not served. |
|
| 137 |
+
| `mmproj-F16.gguf` | ~1.2 GB | Legacy projector for the 31B artifact. For the E4B, use `unsloth/gemma-4-E4B-it-GGUF / mmproj-F16.gguf`. |
|
| 138 |
+
|
| 139 |
+
## Limitations & responsible use
|
| 140 |
+
|
| 141 |
+
- Specialized: scheduling extraction only β not general chat, Q&A, or code.
|
| 142 |
+
- English only; expects the reference datetime (with weekday) supplied in the prompt.
|
| 143 |
+
- Q4_K_M quantization; verify extracted dates before trusting blindly (the app surfaces
|
| 144 |
+
everything for review before saving).
|
| 145 |
+
- Derivative of Gemma-4 β use is subject to Google's
|
| 146 |
+
[Gemma Terms of Use](https://ai.google.dev/gemma/terms).
|
| 147 |
+
|
| 148 |
+
*Base model: Google Gemma-4 E4B. Tooling: Unsloth (training), llama.cpp (conversion + serving).
|
| 149 |
+
Training data includes SMCalFlow (CC BY-SA 4.0, Semantic Machines et al.).*
|
gemma-cal-e4b-Q4_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a1d6d5c51beaae4b314394a69ca99c8dbc5b3aa338ee766e11b8dc33d20e3c68
|
| 3 |
+
size 5335290304
|
mmproj-F16.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6edcca228213c28d3567a35d22f849eea52d8360875093851959adf5d2f270eb
|
| 3 |
+
size 1198957024
|