Text Generation
GGUF
English
Korean
llama.cpp
gemma4
gemma-4
unsloth
lora
qlora
physics
education
particle-simulation
ollama
kaggle-gemma-4-good-hackathon
conversational
Eval Results (legacy)
Instructions to use U2DIA/gemma4-particle-edu-e4b 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 U2DIA/gemma4-particle-edu-e4b 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 U2DIA/gemma4-particle-edu-e4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf U2DIA/gemma4-particle-edu-e4b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf U2DIA/gemma4-particle-edu-e4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf U2DIA/gemma4-particle-edu-e4b: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 U2DIA/gemma4-particle-edu-e4b:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf U2DIA/gemma4-particle-edu-e4b: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 U2DIA/gemma4-particle-edu-e4b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf U2DIA/gemma4-particle-edu-e4b:Q4_K_M
Use Docker
docker model run hf.co/U2DIA/gemma4-particle-edu-e4b:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use U2DIA/gemma4-particle-edu-e4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "U2DIA/gemma4-particle-edu-e4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "U2DIA/gemma4-particle-edu-e4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/U2DIA/gemma4-particle-edu-e4b:Q4_K_M
- Ollama
How to use U2DIA/gemma4-particle-edu-e4b with Ollama:
ollama run hf.co/U2DIA/gemma4-particle-edu-e4b:Q4_K_M
- Unsloth Studio
How to use U2DIA/gemma4-particle-edu-e4b 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 U2DIA/gemma4-particle-edu-e4b 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 U2DIA/gemma4-particle-edu-e4b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for U2DIA/gemma4-particle-edu-e4b to start chatting
- Pi
How to use U2DIA/gemma4-particle-edu-e4b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf U2DIA/gemma4-particle-edu-e4b: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": "U2DIA/gemma4-particle-edu-e4b:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use U2DIA/gemma4-particle-edu-e4b with Docker Model Runner:
docker model run hf.co/U2DIA/gemma4-particle-edu-e4b:Q4_K_M
- Lemonade
How to use U2DIA/gemma4-particle-edu-e4b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull U2DIA/gemma4-particle-edu-e4b:Q4_K_M
Run and chat with the model
lemonade run user.gemma4-particle-edu-e4b-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use U2DIA/gemma4-particle-edu-e4b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf U2DIA/gemma4-particle-edu-e4b: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 U2DIA/gemma4-particle-edu-e4b:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use U2DIA/gemma4-particle-edu-e4b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf U2DIA/gemma4-particle-edu-e4b: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 "U2DIA/gemma4-particle-edu-e4b: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"
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- ko
|
| 5 |
+
license: apache-2.0
|
| 6 |
+
library_name: llama.cpp
|
| 7 |
+
base_model: google/gemma-3-4b-it
|
| 8 |
+
tags:
|
| 9 |
+
- gemma-4
|
| 10 |
+
- unsloth
|
| 11 |
+
- lora
|
| 12 |
+
- qlora
|
| 13 |
+
- physics
|
| 14 |
+
- education
|
| 15 |
+
- particle-simulation
|
| 16 |
+
- gguf
|
| 17 |
+
- ollama
|
| 18 |
+
- kaggle-gemma-4-good-hackathon
|
| 19 |
+
pipeline_tag: text-generation
|
| 20 |
+
model-index:
|
| 21 |
+
- name: gemma4-particle-edu-e4b
|
| 22 |
+
results:
|
| 23 |
+
- task:
|
| 24 |
+
type: text-generation
|
| 25 |
+
name: Physics Simulation JSON Generation
|
| 26 |
+
metrics:
|
| 27 |
+
- type: json_parse_rate
|
| 28 |
+
value: 70
|
| 29 |
+
name: JSON parse rate (%)
|
| 30 |
+
- type: physics_accuracy
|
| 31 |
+
value: 77
|
| 32 |
+
name: Physics accuracy (%)
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
# Gemma 4 Particle Edu — E4B Fine-tuned (Q4_K_M GGUF)
|
| 36 |
+
|
| 37 |
+
Fine-tuned **Gemma 4 E4B (4.5B active)** for physics simulation parameter generation. Part of the [Gemma 4 Particle Edu](https://github.com/U2SY26/gemma4-particle-edu) Kaggle Good Hackathon submission.
|
| 38 |
+
|
| 39 |
+
## What this model does
|
| 40 |
+
|
| 41 |
+
Given a natural language physics scenario (e.g., "DNA double helix at body temperature"), this model outputs a JSON simulation specification with SI-unit physics parameters:
|
| 42 |
+
|
| 43 |
+
```json
|
| 44 |
+
{
|
| 45 |
+
"simulation": {
|
| 46 |
+
"prompt": "dna",
|
| 47 |
+
"title": "DNA Double Helix",
|
| 48 |
+
"domain": "biology",
|
| 49 |
+
"physics": {
|
| 50 |
+
"gravity": 0,
|
| 51 |
+
"damping": 0.99,
|
| 52 |
+
"springStiffness": 30,
|
| 53 |
+
"particleCount": 22000,
|
| 54 |
+
"temperature": 310,
|
| 55 |
+
"density": 1700
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
}
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
## Training details
|
| 62 |
+
|
| 63 |
+
- **Method**: Unsloth QLoRA (r=16)
|
| 64 |
+
- **Base**: Gemma 4 E4B (4.5B active parameters)
|
| 65 |
+
- **Dataset**: 907 Alpaca-format physics simulation pairs
|
| 66 |
+
- **Hardware**: Lambda A10 (24GB)
|
| 67 |
+
- **Cost**: **$0.55**
|
| 68 |
+
- **Quantization**: llama.cpp Q4_K_M (CPU-only conversion)
|
| 69 |
+
|
| 70 |
+
## Benchmark vs other Gemma 4 sizes
|
| 71 |
+
|
| 72 |
+
All 4 sizes fine-tuned on the same 907-pair dataset:
|
| 73 |
+
|
| 74 |
+
| Model | Type | JSON parse | Physics | Time | Cost |
|
| 75 |
+
|-------|------|------------|---------|------|------|
|
| 76 |
+
| Base Gemma 4 9B | Dense | 30% | 0% | 12.7s | - |
|
| 77 |
+
| **E4B FT (this model)** | **QLoRA r=16** | **70%** | **77%** | **8.9s** | **$0.55** |
|
| 78 |
+
| Base Gemma 4 26B MoE | MoE | 95% | 22% | 9.3s | - |
|
| 79 |
+
| 26B FT | QLoRA r=8 | 90% | 31% | 9.3s | $2.40 |
|
| 80 |
+
| Base Gemma 4 31B | Dense | 100% | 21% | 20.6s | - |
|
| 81 |
+
| 31B shallow FT | r=8, 1ep | 100% | 18% | 21.1s | $2.55 |
|
| 82 |
+
| 31B deep FT | r=64, 3ep | 100% | 18% | 20.0s | $2.55 |
|
| 83 |
+
|
| 84 |
+
**Finding**: E4B QLoRA is cost-optimal — $0.55 delivers +40%p JSON success and +77%p physics accuracy over the 9B base. Larger bases (26B/31B) already achieve 95-100% JSON parsing, so the 907-pair dataset cannot move them further.
|
| 85 |
+
|
| 86 |
+
## How to use
|
| 87 |
+
|
| 88 |
+
### Ollama (recommended)
|
| 89 |
+
|
| 90 |
+
```bash
|
| 91 |
+
# Pull this repo and register with Ollama
|
| 92 |
+
huggingface-cli download U2DIA/gemma4-particle-edu-e4b --local-dir ./gemma4-e4b
|
| 93 |
+
cd gemma4-e4b
|
| 94 |
+
ollama create gemma4-physics-edu -f Modelfile
|
| 95 |
+
ollama run gemma4-physics-edu
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
### llama.cpp
|
| 99 |
+
|
| 100 |
+
```bash
|
| 101 |
+
./llama-cli -m gemma4-physics-edu-Q4_K_M.gguf -p "Simulate a DNA double helix"
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
## Files
|
| 105 |
+
|
| 106 |
+
| File | Size | Description |
|
| 107 |
+
|------|------|-------------|
|
| 108 |
+
| `gemma4-physics-edu-Q4_K_M.gguf` | 5.3 GB | Merged Q4_K_M quantized weights |
|
| 109 |
+
| `config.json` | 6 KB | Hugging Face model config |
|
| 110 |
+
| `tokenizer.json` | 31 MB | Tokenizer |
|
| 111 |
+
| `Modelfile` | 241 B | Ollama Modelfile |
|
| 112 |
+
|
| 113 |
+
## Related resources
|
| 114 |
+
|
| 115 |
+
- **GitHub**: https://github.com/U2SY26/gemma4-particle-edu
|
| 116 |
+
- **Live Demo**: https://gemma4-particle-edu.vercel.app
|
| 117 |
+
- **Kaggle Writeup**: https://www.kaggle.com/competitions/gemma-4-good-hackathon/writeups/gemma-4-particle-edu-free-3d-physics-simulation-v
|
| 118 |
+
- **Kaggle Benchmark Dataset**: https://www.kaggle.com/datasets/syu21125/gemma4-particle-edu-benchmark-300
|
| 119 |
+
- **Kaggle Ollama Live Demo**: https://www.kaggle.com/code/syu21125/gemma-4-particle-edu-ollama-live-demo
|
| 120 |
+
- **3dweb (production app, 8,470 installs)**: https://play.google.com/store/apps/details?id=com.sciencelab.science_lab_flutter
|
| 121 |
+
|
| 122 |
+
## Limitations
|
| 123 |
+
|
| 124 |
+
- 70% JSON parse rate means ~30% of outputs need retry or fallback
|
| 125 |
+
- Physics accuracy was measured on 20 scenarios; full 300-scenario benchmark requires the 31B model
|
| 126 |
+
- Fine-tuned on English prompts; Korean prompts fall back to the base model's multilingual capability
|
| 127 |
+
- Not suitable for production medical, safety-critical, or regulatory-compliant simulations
|
| 128 |
+
|
| 129 |
+
## Competition
|
| 130 |
+
|
| 131 |
+
Submitted to [Kaggle Gemma 4 Good Hackathon](https://www.kaggle.com/competitions/gemma-4-good-hackathon) (2026-05-18 deadline).
|
| 132 |
+
|
| 133 |
+
Tracks: Impact (Education) + Special Technology (Ollama + Unsloth)
|
| 134 |
+
|
| 135 |
+
## Citation
|
| 136 |
+
|
| 137 |
+
```bibtex
|
| 138 |
+
@misc{gemma4-particle-edu-e4b,
|
| 139 |
+
author = {Yun (U2DIA)},
|
| 140 |
+
title = {Gemma 4 Particle Edu — E4B Fine-tuned},
|
| 141 |
+
year = {2026},
|
| 142 |
+
publisher = {HuggingFace},
|
| 143 |
+
url = {https://huggingface.co/U2DIA/gemma4-particle-edu-e4b}
|
| 144 |
+
}
|
| 145 |
+
```
|