Text Generation
Safetensors
GGUF
Czech
English
gemma4
czech
stem
physics
chemistry
biology
mathematics
programming
lora
self-distillation
conversational
Instructions to use KucLab/kuclab-hertz-0.4 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 KucLab/kuclab-hertz-0.4 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 KucLab/kuclab-hertz-0.4:Q4_K_M # Run inference directly in the terminal: llama cli -hf KucLab/kuclab-hertz-0.4:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf KucLab/kuclab-hertz-0.4:Q4_K_M # Run inference directly in the terminal: llama cli -hf KucLab/kuclab-hertz-0.4: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 KucLab/kuclab-hertz-0.4:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf KucLab/kuclab-hertz-0.4: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 KucLab/kuclab-hertz-0.4:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf KucLab/kuclab-hertz-0.4:Q4_K_M
Use Docker
docker model run hf.co/KucLab/kuclab-hertz-0.4:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use KucLab/kuclab-hertz-0.4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KucLab/kuclab-hertz-0.4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KucLab/kuclab-hertz-0.4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/KucLab/kuclab-hertz-0.4:Q4_K_M
- Ollama
How to use KucLab/kuclab-hertz-0.4 with Ollama:
ollama run hf.co/KucLab/kuclab-hertz-0.4:Q4_K_M
- Unsloth Desktop
- Pi
How to use KucLab/kuclab-hertz-0.4 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KucLab/kuclab-hertz-0.4: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": "KucLab/kuclab-hertz-0.4:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use KucLab/kuclab-hertz-0.4 with Docker Model Runner:
docker model run hf.co/KucLab/kuclab-hertz-0.4:Q4_K_M
- Lemonade
How to use KucLab/kuclab-hertz-0.4 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull KucLab/kuclab-hertz-0.4:Q4_K_M
Run and chat with the model
lemonade run user.kuclab-hertz-0.4-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use KucLab/kuclab-hertz-0.4 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KucLab/kuclab-hertz-0.4: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 KucLab/kuclab-hertz-0.4:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use KucLab/kuclab-hertz-0.4 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KucLab/kuclab-hertz-0.4: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 "KucLab/kuclab-hertz-0.4: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"
| license: apache-2.0 | |
| base_model: google/gemma-4-12B-it | |
| language: | |
| - cs | |
| - en | |
| tags: | |
| - gemma4 | |
| - czech | |
| - stem | |
| - physics | |
| - chemistry | |
| - biology | |
| - mathematics | |
| - programming | |
| - lora | |
| - self-distillation | |
| pipeline_tag: text-generation | |
| # KucLab Hertz 0.4 | |
| A Czech/English STEM + programming assistant built by [KucLab](https://kuclab.org) on top of **google/gemma-4-12B-it**, fine-tuned toward physics, chemistry, biology, mathematics and programming in Czech, while keeping the base model's native 256k-token context and tool-calling. | |
| ## What this is | |
| Hertz 0.4 is a **LoRA fine-tune** (r=8, merged into the base weights) trained on a self-distilled corpus of Czech/English STEM concepts, worked problems, programming exercises, and formatting examples. Training data was generated by prompting **Qwen3.8-27B** (Alibaba/Tongyi, Apache 2.0) as a data-generation teacher — it never trains itself, only produces answers used to fine-tune the actual model that ships here — with a system instruction asking for direct, confident answers over hedged ones. | |
| - **Base:** google/gemma-4-12B-it (11.95B params, Apache 2.0) | |
| - **Method:** QLoRA, r=8 / alpha=16, merged to bf16 then quantized | |
| - **Context:** 262144 tokens natively (no context-extension hack needed — unlike Hertz 0.3's Qwen2.5-14B base, this model ships long context out of the box). Deployed here with a default `num_ctx` of 65536; the model can go higher, this is a practical default, not a hard limit. | |
| - **Training data:** 744 rows — 497 newly self-distilled (STEM concepts/terms/problems, a new programming category, formatting), plus 234 rows reused as-is from Hertz 0.3's corpus. | |
| - **Format available:** GGUF (q4_k_m, ~7.4GB) for `llama.cpp`/Ollama, plus the raw LoRA adapter. | |
| Gemma-4 has its own native thinking mechanism (channel-based, gated by an `enable_thinking` flag). Training data deliberately does **not** replicate that token syntax — `output` is plain text with visible step-by-step reasoning, same choice as Hertz 0.3. This doesn't disable native thinking mode, it just means the fine-tune doesn't touch it either way. | |
| ## Quickstart (Ollama) | |
| **Important:** `ollama pull hf.co/...` alone does NOT apply this model's system prompt (identity + personality) — Ollama only fetches the raw GGUF from Hugging Face, it does not read a repo's `Modelfile`. Without the system prompt, the model falls back to identifying as a generic Gemma model. Use `ollama create` with the Modelfile below instead — it pulls the weights AND applies the system prompt in one step: | |
| ```bash | |
| curl -O https://huggingface.co/KucLab/kuclab-hertz-0.4/resolve/main/Modelfile | |
| ollama create kuclab-hertz-0.4 -f Modelfile | |
| ollama run kuclab-hertz-0.4 | |
| ``` | |
| (The Modelfile's `FROM` line points at `hf.co/KucLab/kuclab-hertz-0.4:Q4_K_M`, so this pulls the same GGUF automatically — no separate download needed.) | |
| ## Example | |
| > **Q:** Kolik je 17 × 23? Ukaž postup. | |
| > | |
| > **A:** Výsledek: 391 — pak krok za krokem 17×(20+3) = 340+51 = 391. | |
| > **Q:** Napiš v Pythonu funkci pro binární vyhledávání. | |
| > | |
| > **A:** *(correct, idiomatic implementation with type hints and a docstring)* | |
| ## Benchmarks — and an honest complication | |
| Measured against the same base model (`google/gemma-4-12B-it`, Q4_K_M via Ollama), same prompts, same grading code, both models cold. | |
| **MMLU-Pro STEM** (240 held-out questions, this project's own curated subset) | |
| | | base | Hertz 0.4 | Δ | | |
| |---|---|---|---| | |
| | Biology | 86.7% | 76.7% | −10.0pp | | |
| | Chemistry | 55.0% | 45.0% | −10.0pp | | |
| | Math | 85.0% | 76.7% | −8.3pp | | |
| | Physics | 63.3% | 56.7% | −6.6pp | | |
| | **Total** | **72.5%** | **63.7%** | **−8.8pp** | | |
| **We do not trust this number at face value, and you shouldn't either.** Both models — base and fine-tuned — tend to work through every multiple-choice option individually with detailed reasoning before giving a final answer, and a meaningful fraction of responses got cut off by our grading harness's token budget before reaching the final answer letter (18% unparsed for base, 23% for Hertz 0.4). The drop is uniform across all four subjects, which points to a harness/verbosity artifact rather than genuine domain-knowledge loss, but we have not yet re-run this with a larger token budget to confirm. Until we do, **treat this MMLU-Pro number as unverified and likely pessimistic for both models** — we're publishing it anyway because we'd rather show a confusing number with an honest explanation than hide it. | |
| Czech terminology benchmark: not yet run for this release. | |
| ## Honest status | |
| - ✅ Coherent, correct Czech and English output (spot-checked: arithmetic, physics, code, terminology — one wrong term found: "smělná odchylka" instead of "směrodatná odchylka" for standard deviation) | |
| - ✅ Correctly identifies as a KucLab model, not as "Gemma" (LoRA + system prompt) | |
| - ✅ 256k native context (inherited from base, not independently long-context-tested by us yet) | |
| - ⚠️ MMLU-Pro STEM comparison run but confounded by a benchmark-harness token-budget issue (see above) — re-run pending | |
| - ⏳ Czech terminology benchmark not yet run for this release | |
| - ⏳ Tool-calling fine-tuning — base supports it natively, this fine-tune didn't add tool-use training examples | |
| - ⏳ No uncensoring/decensoring pass — safety behavior inherited from the base model as-is | |
| If you're deciding whether this fits your use case: treat it as "gemma-4-12B-it, nudged toward Czech STEM/programming fluency and KucLab identity," with an open question mark on general STEM benchmark performance until we re-verify it. | |
| ## License | |
| Apache 2.0, inherited from google/gemma-4-12B-it (per Google's official Hugging Face listing). Qwen3.8-27B (used only to generate training data, never trained or redistributed here) is separately licensed under Apache 2.0 by Alibaba/Tongyi. | |
| ## Credits | |
| - Base model: [google/gemma-4-12B-it](https://huggingface.co/google/gemma-4-12B-it) (Google, Apache 2.0) | |
| - Training-data teacher: [Qwen/Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B) (Alibaba/Tongyi, Apache 2.0) | |
| - Fine-tuning, dataset construction, and packaging: [KucLab](https://kuclab.org) | |