gemma-4-E2B-it-agent-posttrain-v1.1
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 |
|---|---|
adapter/adapter_config.json | 1162 B |
adapter/adapter_model.safetensors | 96.7 MB |
adapter/tokenizer.json | 32.2 MB |
adapter/tokenizer_config.json | 3729 B |
gguf/gemma-agent-Q3_K_M.gguf | 3.19 GB |
gguf/gemma-agent-Q4_K_M.gguf | 3.42 GB |
gguf/gemma-agent-f16.gguf | 9.27 GB |
merge_record.json | 2036 B |
merged-bf16/config.json | 5276 B |
merged-bf16/generation_config.json | 204 B |
merged-bf16/model-00001-of-00003.safetensors | 4.70 GB |
merged-bf16/model-00002-of-00003.safetensors | 3.98 GB |
merged-bf16/model-00003-of-00003.safetensors | 1.53 GB |
merged-bf16/model.safetensors.index.json | 200040 B |
merged-bf16/tokenizer.json | 32.2 MB |
merged-bf16/tokenizer_config.json | 3837 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. The tag v1.1 pins commit 9bed684, whose gguf/gemma-agent-Q4_K_M.gguf hashes to d17fcdda9948: that is the sft-41k build, so those weights stay downloadable by tag even though main now carries f09b13a88465.
Training
- base model:
google/gemma-4-E2B-it - method: 4-bit QLoRA (nf4, double quant)
- data: 41,317 supervised records
- sequence length: 2048, effective batch 16
- epochs 3.0, learning rate 0.0002, 7,749 steps
- final loss 0.0814
- LoRA r=16, alpha=32, dropout=0.05
- hardware: NVIDIA GeForce RTX 5090, 3.7 h
The chat template is applied with enable_thinking=False. The record reports a supervised median of 28 tokens against a median row of 395, which is consistent with the loss covering the completion and not the context; the recipe masks the prompt explicitly rather than relying on the data shape.
Evaluation
Measured with tools-pair-builder: every call is answered by a simulated
observation, so no command ran and the score cannot depend on what the model did.
| metric | value |
|---|---|
| pairs / rounds | 13 / 16 |
| round accuracy | 0.688 (11/16) |
| pair success | 0.769 |
| calls parsed | 1.000 |
| failures owned by the model | 5 |
| failures owned by the application | 0 |
| mean latency | 395 ms |
Failure labels: wrong_value 3, wrong_tool 2.
Lowest scoring capabilities:
| capability | rounds | accuracy |
|---|---|---|
| error_recovery | 6 | 0.167 |
| list_files | 1 | 1.000 |
| read_file | 1 | 1.000 |
| write_file | 1 | 1.000 |
The parse rate is 1.000, so every failure is a wrong tool or a wrong value rather than an unreadable reply. That is what makes the repair set worth training: the protocol already works and the semantics are what is missing.
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.
Repair pass in this repository
- base:
/workspace/posttrain/base/merged-bf16, continued from the preceding weights rather than restarted - rows: 102, steps: 52, final loss: 0.0016
- hardware: NVIDIA GeForce RTX 3090, wall time: 4.5 min
- measured before: round accuracy 0.375 (6/16), 10 failures owned by the model
- measured after: round accuracy 0.688 (11/16), 5 failures owned by the model
Build lineage
This repository serves the repair-v1 build, and the digest is what says so: gguf/gemma-agent-Q4_K_M.gguf hashes to f09b13a88465, the same file on this machine that the build table records as repair-v1. main received that build in commit 3651c71 on 2026-10-21.
| what | value |
|---|---|
| build served | repair-v1 |
gguf/gemma-agent-Q4_K_M.gguf | f09b13a884656e2a49914b14aa15baf06d1658e1edd31d199869355861026aff |
| rows / steps / final loss | 102 / 52 / 0.0016 |
| training hardware | RTX 3090 |
| facts read from | results/posttrain/repair-v1/training_record.json |
| local file with this digest | models/gemma-agent-Q4_K_M.gguf |
| measured cells on this build | 17 |
Recorded evaluations that loaded these bytes, one row per harness:
| harness | metric | recorded values |
|---|---|---|
| bfcl | round_accuracy | 0.147 (n=400), 0.497 (n=400), 0.5 (n=400), 0.008 (n=240), and 7 more |
| constraints | check_rate | 0.455 (n=11) |
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-25 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.