Downloads · 30 days
163
53% of all-time downloads
RedTeamLab/Gemma-4-E4B-Sol-Traces-v3
Gemma-4-E4B-Sol-Traces-v3 is a machine learning model from RedTeamLab. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for gguf. The card lists the license as gemma.
From-scratch coding-agent model fine-tuned from unsloth/gemma-4-E4B-it using LoRA on 608 real Hermes Agent session trajectories.
Downloads · 30 days
163
53% of all-time downloads
All-time downloads
307
Public
Repo size
20.5 GB
Likes
0
Public
Click a slice to open those files.
.gguf20.4 GB · 100%
From the Hugging Face model README
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.
| Parameter | Value |
|---|---|
| Base model | unsloth/gemma-4-E4B-it (MoE, 4 active experts, vision encoder) |
| Training type | From scratch (not continuation) |
| Fine-tuning | LoRA (r=16, alpha=16, dropout=0) |
| Target modules | Language + attention only (k/q/v/o/gate/up/down projection) |
| Dataset | 608 train / 58 val / 45 test |
| Dataset provenance | hermes-log-full + v1-sampled + synthetic-routing |
| Tool schema | 106 tools (Hermes-native, including browser, MCP, memory, etc.) |
| Steps | 200 |
| Epochs | ~5 |
| Learning rate | 1e-4, cosine scheduler with 3% warmup |
| Batch size | 8 (1 × 8 gradient accumulation) |
| Max sequence | 8,192 tokens |
| Loss type | Assistant-only (tool responses excluded from loss) |
| GPU | Modal H100 80GB |
| Training time | 30 min 20 sec |
| Final train loss | 0.184 |
| Validation loss | 1.330 |
| Peak VRAM | 27.0 GiB / 80 GiB |
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:
~/.hermes/state.db only<SECRET>, <EMAIL>, <ABS_PATH>)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).
Synthetic routing repair examples targeting the tools that the frozen evaluation suite identified as weak in v1/v2:
The model was trained with a 106-tool Hermes-native schema including:
read_file, search_files, write_file, patchterminal, process, execute_codebrowser_navigate, browser_click, browser_snapshot, browser_console, browser_type, browser_vision, browser_scrollmcp_openrouter_*, mcp_leonardo_*, mcp_proxmox_*, mcp_porkbun_*, mcp_chrome_devtools_*, mcp_cloudflare_*, mcp_docker_*memory, mem0_search, mem0_conclude, fabric_recall, fabric_writedelegate_task, cronjob, todo, clarifyweb_search, web_extract, session_searchlist_files, read_file, search_code, run_command, apply_patch| File | Size | Description |
|---|---|---|
gemma-4-e4b-sol-traces-v3-Q4_K_M.gguf | 4.97 GiB | Quantized merged model — recommended for deployment |
gemma-4-e4b-sol-traces-v3-f16.gguf | 14.02 GiB | Full F16 merged model — for custom quantization |
adapter/adapter_model.safetensors | 35 MiB | LoRA adapter weights (for PEFT-based loading) |
adapter/adapter_config.json | — | LoRA configuration (r=16, alpha=16) |
training_stats.json | — | Full training metrics |
| Metric | v1 | v2 | v3 |
|---|---|---|---|
| Training type | From scratch | Continuation from v1 | From scratch |
| Training records | 21,174 | 21,438 | 608 |
| Tool schema | 5 tools | 99 tools | 106 tools |
| Training loss | 0.0096 | 0.0255 | 0.184 |
| Eval loss | 0.0235 | 0.0528 | 1.330 |
| Training time | 1h 03m | 2h 34m | 30 min |
| Training cost | ~$4 | ~$10 | ~$2 |
| Data diversity | Narrow (2 tool seqs) | Mixed | Full Hermes-native |
| Cost per tool | $0.80/tool | $0.10/tool | $0.02/tool |
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.
| Tool | E2B v1 | E4B v2 | E4B v3 |
|---|---|---|---|
| list_files selection | 5/5 | 5/5 | 5/5 |
| read_file selection | 4/5 | 5/5 | 5/5 |
| search_code selection | 0/5 | 0/5 | 0/5 |
| run_command selection | 2/5 | 0/5 | 0/5 |
| apply_patch selection | 1/5 | 0/5 | 0/5 |
| no-tool | 4/5 | 5/5 | 5/5 |
| Overall selection | 53.3% | 50.0% | 50.0% |
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.
# 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 8096
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/")
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.
search_code, run_command, and apply_patch selection is poor in the frozen evaluation. Use explicit prompting for these tools.