gemma-4-E2B-it-agent-posttrain-v1.4
A Gemma 4 E2B instruct model post-trained to emit one machine-readable tool call per turn against a fixed surface of ten simulated tools. It answers with an action object, the runtime parses it, and the tool result is fed back as an observation.
This is a research artifact for a single harness. It is not a general chat model and it should not be used where an unparsed reply would be acted on.
What is in the repository
| path | size |
|---|---|
README.md | 6961 B |
adapter/README.md | 5250 B |
adapter/adapter_config.json | 1189 B |
adapter/adapter_model.safetensors | 96.7 MB |
adapter/chat_template.jinja | 18569 B |
adapter/tokenizer.json | 32.2 MB |
adapter/tokenizer_config.json | 3838 B |
adapter/training_args.bin | 4792 B |
gguf/gemma-agent-Q2_K.gguf | 2.98 GB |
gguf/gemma-agent-Q3_K_M.gguf | 3.19 GB |
gguf/gemma-agent-Q4_K_M.gguf | 3.42 GB |
gguf/gemma-agent-Q5_K_M.gguf | 3.62 GB |
gguf/gemma-agent-Q6_K.gguf | 3.83 GB |
gguf/gemma-agent-Q8_0.gguf | 4.95 GB |
gguf/gemma-agent-f16.gguf | 9.27 GB |
merged-bf16/chat_template.jinja | 18569 B |
merged-bf16/config.json | 4538 B |
merged-bf16/generation_config.json | 204 B |
merged-bf16/merge_record.json | 346 B |
merged-bf16/model.safetensors | 10.21 GB |
merged-bf16/tokenizer.json | 32.2 MB |
merged-bf16/tokenizer_config.json | 3838 B |
training-log.json | 63707 B |
merged-bf16 is the model in Transformers form, adapter is the LoRA adapter, and gguf holds the quantized files for llama.cpp. The checkpoint directories are omitted from this table for length and are present in the repository.
The repository holds one version at a time and the files above are the current one. This repository carries no tag, so main is the only address for its weights: a later upload replaces the files above rather than adding beside them.
Training
- base model:
XcaliburMoon/gemma-4-E2B-it-agent-posttrain-v1.3 - method: 4-bit QLoRA (nf4, double quant), continued from v1.1 merged weights
- data: 10,000 supervised records
- sequence length: 1312, effective batch 8
- epochs 2.0, learning rate 0.0001, 626 steps
- final loss 0.8449
- LoRA r=16, alpha=32, dropout=0.05
- hardware: NVIDIA A40, NVIDIA A40, NVIDIA A40, NVIDIA A40, 0.7 h
The chat template is applied with enable_thinking=False. This release's card carries no token-length record, so the loss cannot be checked against the completion length from it; the recipe masks the prompt explicitly rather than relying on the data shape.
Holdout score
The adapter scored on rows it never trained on: greedy decode, one card, and the
same three checks the served evaluation makes - one JSON object, the same tool,
every gold argument present and equal. Argument equality is compared after
whitespace, quote style and a leading ./ are normalised away; a command that
says something different still fails.
| metric | value |
|---|---|
| held-out rows | 200 |
| calls matched | 97 (48.5%) |
| passes earned by normalisation | 1 |
| comparison | normalised |
| tool | matched | rows | accuracy |
|---|---|---|---|
| write_file | 1 | 16 | 0.062 |
| append_file | 1 | 10 | 0.100 |
| run_command | 10 | 34 | 0.294 |
| sql_incubator | 5 | 14 | 0.357 |
| search_files | 7 | 19 | 0.368 |
| finish | 12 | 22 | 0.545 |
| make_directory | 4 | 6 | 0.667 |
| read_file | 32 | 46 | 0.696 |
| delete_file | 5 | 7 | 0.714 |
| list_files | 20 | 26 | 0.769 |
Misses: content differs 16, command differs 14, path differs 9, pattern differs 8, args differs 6, answer overlap 6 and 25 rarer reasons.
This number is measured on merged-bf16 with the adapter applied, not on the
quantized file, so a reader who deploys the Q4 should re-measure that file.
Training log
training-log.json in this repository is the chronological record: every
training, dataset, evaluation and publish event with its loss curve, round
accuracy and per-capability results. It is written by tools/posttrain/timeline.py
from the run records, not typed by hand, and the same file feeds the notes app.
How to run it
With llama.cpp and the Q4 file:
llama-server -m gguf/gemma-agent-Q4_K_M.gguf --port 8080 --ctx-size 4096
The model expects the system prompt the harness sends: the offered tools as a
menu, then the instruction to reply with exactly one JSON object such as
{"action": "tool", "tool": "read_file", "args": {"path": "notes.txt"}}.
tools-pair-builder in the source repository builds that prompt and measures the
reply without executing anything.
Limitations
- Trained on one tool surface. A tool that is not in the menu is not in the model.
- Supervised fine-tuning only. No preference stage was run, and the measured failures are wrong-tool and wrong-value choices on tools whose descriptions look alike, which is exactly the failure a preference stage addresses.
- English only, short tasks, one call per turn.
- Observations during training were fixtures. The model never saw a real shell output, so it can be confidently wrong about what a command returned.
- Quantized files are lossy relative to
merged-bf16; evaluate the quant you intend to deploy, not the one that looks best in this table.
License
The base model is Google Gemma and this derivative carries the Gemma Terms of Use. Review them before redistribution or commercial deployment.
Card rendered 2026-10-26 from the records in
the source repository: training_record.json, publish_manifest.json and the
benchmark run directory. Numbers in this card are copied from those files, not
restated from memory.