RedTeamLab/Gemma-4-E4B-Sol-Traces-v3
Gemma-4-E4B-Sol-Traces-v3
From-scratch coding-agent model fine-tuned from unsloth/gemma-4-E4B-it using LoRA on 608 real Hermes Agent session trajectories.
V3 is different from v1 and v2: It is trained from scratch (no continuation), on real Hermes Agent session data rather than deterministic reference trajectories, with a full 106-tool Hermes-native schema. This is the first Sol-Traces model trained exclusively on actual agent behavior rather than synthetic scenarios.
Sol Traces denotes tool-use traces compiled from Hermes Agent session logs; the traces do not originate from OpenCode.
Training Details
Dataset
v3 hermes-native (274 train / 34 val / 35 test)
Redacted Hermes Agent session logs from ~/.hermes/state.db. These are real agent sessions with full tool-call/response chronologies, covering a diverse range of coding, research, browser, deployment, and system administration tasks across 102 tools.
Source constraints:
- Source:
~/.hermes/state.dbonly - Sessions: CLI and TUI sources, ended and not archived
- Privacy: fully redacted (secrets, emails, paths →
<SECRET>,<EMAIL>,<ABS_PATH>) - Consent: owner-authorized Hermes sessions, no external data
v1 retention (200 train)
A sample of 200 v1 deterministic trajectories to maintain basic tool-schema familiarity for the 5 core repository tools (list_files, read_file, search_code, run_command, apply_patch).
Routing repair (134 train)
Synthetic routing repair examples targeting the tools that the frozen evaluation suite identified as weak in v1/v2:
- search_code — 45 examples (varied queries, paths)
- run_command — 60 examples (test runners, build tools, linters)
- apply_patch — 30 examples (bug fixes, config changes, import fixes)
- no-tool — 10 examples (correctly declining to act)
- Multi-tool sequences — 3 examples (search → read → patch chains)
Tool registry (106 tools)
The model was trained with a 106-tool Hermes-native schema including:
- File tools:
read_file,search_files,write_file,patch - Shell tools:
terminal,process,execute_code - Browser tools:
browser_navigate,browser_click,browser_snapshot,browser_console,browser_type,browser_vision,browser_scroll - MCP tools:
mcp_openrouter_*,mcp_leonardo_*,mcp_proxmox_*,mcp_porkbun_*,mcp_chrome_devtools_*,mcp_cloudflare_*,mcp_docker_* - Memory tools:
memory,mem0_search,mem0_conclude,fabric_recall,fabric_write - Task tools:
delegate_task,cronjob,todo,clarify - Search tools:
web_search,web_extract,session_search - Repository tools:
list_files,read_file,search_code,run_command,apply_patch
Files
Comparison with Sol-Traces v1/v2
Why is v3's loss higher? The v3 dataset is 35x smaller but 20x more diverse (106 tools vs 5). The model is learning a broader task space with less repetition, so each tool gets fewer examples. Higher loss reflects the harder learning problem, not a worse model.
Frozen routing evaluation
V3 matches v2's routing performance despite being trained from scratch on 35x fewer records — the hermes-native data is more efficient per-record than deterministic trajectories.
Usage (llama.cpp)
# Q4_K_M — one file, ready to go
llama-cli \
-m gemma-4-e4b-sol-traces-v3-Q4_K_M.gguf \
-ngl 99 \
--prompt "Find all Python files in the project"
# Server mode with tool support
llama-server \
-m gemma-4-e4b-sol-traces-v3-Q4_K_M.gguf \
-ngl 99 -c 4096 \
--host 127.0.0.1 --port 8096Usage (PEFT / Transformers)
from unsloth import FastModel
from peft import PeftModel
base = "unsloth/gemma-4-E4B-it"
model, tokenizer = FastModel.from_pretrained(
model_name=base, max_seq_length=8192,
dtype=torch.bfloat16, load_in_4bit=False,
)
model = PeftModel.from_pretrained(model, "./adapter/")Key Insights
From-scratch training works. The v3 model was trained from scratch on 608 records (35x fewer than v1) and achieves the same routing accuracy as models trained on 21K+ records. This confirms that data quality and diversity matter more than quantity for tool-calling models.
Real data beats synthetic data. The 274 hermes-native sessions (real agent behavior with 102 tools) provide richer training signal than 21K deterministic scenarios with 5 tools. Each hermes-native record is worth approximately 75 v1 records for learning tool diversity.
Weak areas persist. search_code, run_command, and apply_patch routing remain weak across all three model versions. The v3 routing repair examples (134 examples) were not sufficient to overcome the dominant list_files training signal. Future work should focus on these specific tool routing gaps.
Limitations
- Small training set: 608 records is the smallest Sol-Traces dataset. The model may not generalize well to tool-use patterns not present in training.
- Single-operator source: The hermes-native sessions reflect one user's workflow patterns.
- Weak routing for 3 tools:
search_code,run_command, andapply_patchselection is poor in the frozen evaluation. Use explicit prompting for these tools. - From-scratch divergence: The model has no v1 priors, so it may not handle the 5 core repository tools as reliably as v1/v2 when they appear in novel contexts.
- Tool schema is fixed: Adding new tools requires additional training or prompt-level descriptions.
