Downloads · 30 days
32
15% of all-time downloads
JBrussee/gemma-4-31B-caveman-lora
gemma-4-31B-caveman-lora is a text generation model from JBrussee. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as gemma.
LoRA adapter that makes google/gemma-4-31B-it speak caveman-mode natively.
Downloads · 30 days
32
15% of all-time downloads
All-time downloads
209
Public
Repo size
818 MB
Likes
6
Public
Click a slice to open those files.
.safetensors1.1 GB · 77%
From the Hugging Face model README
LoRA adapter that makes google/gemma-4-31B-it speak caveman-mode natively.
Drops articles, filler, pleasantries, hedging. Allows fragments. Keeps code blocks, function names, error strings, and CLI commands byte-exact. Pattern: [thing] [action] [reason]. [next step].
For the convenience-bundled merged variant see JBrussee/gemma-4-31B-caveman (62 GB).
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
base = AutoModelForCausalLM.from_pretrained(
"google/gemma-4-31B-it",
torch_dtype=torch.bfloat16,
device_map="auto",
)
tok = AutoTokenizer.from_pretrained("google/gemma-4-31B-it")
model = PeftModel.from_pretrained(base, "JBrussee/gemma-4-31B-caveman-lora")
msgs = [{"role": "user", "content": "Explain database connection pooling."}]
ids = tok.apply_chat_template(msgs, return_tensors="pt", add_generation_prompt=True).to(model.device)
out = model.generate(ids, max_new_tokens=300, do_sample=False)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))
adapter_model.safetensors (~534 MB)q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_projcompletion_only_loss=True| Category | n | compression | article density | code_fence_match | semantic_sim |
|---|---|---|---|---|---|
| dialogue | 28 | 0.59 | 0.020 | 1.000 | 0.91 |
| debug | 34 | 0.92 | 0.009 | 0.995 | 0.98 |
| refactor | 27 | 0.92 | 0.005 | 0.963 | 0.98 |
| qa | 104 | 0.65 | 0.007 | 1.000 | 0.92 |
Code preservation 96-100%, article density 0.5-2%, semantic preservation 91-98%. Compression ~10-40% (weaker than gold's 50-70%).
Full code, data pipeline, and configs: https://github.com/JuliusBrussee/finetune-caveman
Inherits the Gemma Prohibited Use Policy. Apache 2.0 base + Gemma terms apply to all outputs. Repository code is MIT. The caveman style ruleset is MIT (https://github.com/JuliusBrussee/caveman).