Gemma-4-26B-A4B agentic LoRA — run4 (OpenCode format)
A small LoRA for google/gemma-4-26B-A4B-it that nudges it toward agentic coding, trained on coding-agent trajectories rewritten into OpenCode's tool vocabulary, system prompt and tool-result formats. Applied at low strength with thinking off, it keeps the model's score on an agentic coding benchmark.
Sibling: run2 — the same trajectories in their original OpenHands format. run2 measured better, even inside OpenCode, and is the one to try first; run4 is published as the OpenCode-format counterpart.
Files
| file | what |
|---|---|
gemma4-agentic-run4-tok5M-lora-bf16.gguf |
the adapter for llama.cpp (74 MB) |
tok5M/adapter_model.safetensors, adapter_config.json |
the PEFT adapter (for transformers / merging) |
tok5M/optimizer.pt, train_state.json |
optimizer state, to resume training |
Use it with llama.cpp — at strength 0.15–0.25, thinking off
llama-server -m gemma-4-26B-A4B-it-Q8_0.gguf \
--lora-scaled gemma4-agentic-run4-tok5M-lora-bf16.gguf:0.25 \
--jinja --chat-template-file chat_template.jinja --reasoning off \
--ctx-size 131072 --parallel 1 -ngl 999 \
--temp 1.0 --top-p 0.95 --top-k 64
- Keep the strength low. Use
--lora-scaled …:0.15to:0.25, not--lora(which applies 1.0). It degrades quickly above that: 40/42 at 0.5, 26/42 at 0.75. - Thinking off. It was trained and measured with thinking disabled; with thinking on it measured the same as stock Gemma (no benefit, no harm).
chat_template.jinjais the one shipped in the base instruct repo. Any GGUF of the instruct model works; the numbers below are on Q8_0.
With transformers/PEFT: PeftModel.from_pretrained(base, "Myric/gemma4-26b-a4b-agentic-lora-run4", subfolder="tok5M"),
then scale the adapter (or merge at 0.25). The config's base_model_name_or_path is a local path — pass the base
model yourself.
Measured
42-task agentic coding suite (a real OpenCode tool loop, graded by hidden pytest), thinking off, DGX Spark:
| tasks passed | output tokens | |
|---|---|---|
| stock Gemma-4-26B-A4B-it (3 runs) | 42 / 41 / 41 | 85k / 118k / 119k |
| + run4 @ 0.15 (2 runs) | 41 / 41 | 58k / 110k |
| + run4 @ 0.25 | 42 | 103k |
| + run4 @ 0.5 | 40 | 131k |
| + run4 @ 0.75 | 26 | 168k |
At 0.15–0.25 it matches stock's score; its token counts sit inside stock's range, so unlike run2 there is no clear token saving. Token counts vary a lot between identical runs (the two 0.15 runs differ by 2x), so treat single-run figures as indicative.
Training
- Adapted: attention
q/k/v/o_projand each layer's dense MLPgate/up/down_proj; LoRA rank 32, alpha 64, no dropout (37.2 M parameters). The 128 routed experts are frozen. - Data: ~5 M tokens (89 steps) of a mix: 45% agentic — resolved
nebius/SWE-rebench-openhands-trajectories, windowed to ~10k tokens and re-expressed in OpenCode 1.18.31's tools, system prompt and result formats; 35% general chat and 20% tool calls fromHuggingFaceTB/smoltalk+Team-ACE/ToolACE, with refusals filtered out. - Loss only on tokens the model generates, rendered with the instruct repo's own chat template and tool tokens.
- Trained on one DGX Spark (GB10).
License
Use is subject to the Gemma Terms of Use. Training data: SWE-rebench OpenHands trajectories (CC-BY-4.0, Nebius), SmolTalk (Apache-2.0, Hugging Face), ToolACE (Apache-2.0).