7f806e0b927307d44d27a27ec632a5ba8edc488f
Round 2 tested the hypothesis that 26B's silent-stop was about write_file argument size. Result: refuted. - Patch-mode (apply_patch instead of write_file): 26B fails identically at iter 6. Tool-arg size is not the cause. - Truncation sweep on tool responses reveals the real trigger: cap at 800 or 1200 chars → 26B PASSES (1200-cap is 8.4s, fastest of any run). Cap at 1600, 2000, or unlimited → 26B silent-stops with eval=4. Revised understanding: 26B silent-stops when cumulative tool-response context crosses a shape threshold around 1200-1600 chars per response. Not a tool-arg bug, not a raw code-gen bug — 26B emits correct code fine in both one-shot and short-context settings. Production CLI agents (openclaw, open code, aider) typically truncate tool responses by default, so this failure may not surface in them. Custom harnesses should cap ≤1200 chars per tool response when targeting the 26B MoE. Updates GOTCHAS (rewritten entry with the truncation sweep table), SYNTHESIS model-selection row, CORPUS_cli_coding_agent.md pointer, docs/reference/bakeoff-2026-04-18.md with full Round 2 methodology and data. Adds harness_patch.py (apply_patch edit tool), harness_patch_truncated.py (env-configurable TOOL_RESULT_CAP), all 7 run logs, and a .secrets.baseline for detect-secrets false positives on JSON timestamps.
gemma4-research
Research corpus and implementation guidance for Google Gemma 4, based on production use in Seth's homelab.
Files
| File | What | When to Read |
|---|---|---|
SYNTHESIS.md |
Start here. Opinionated guide — how to build with Gemma 4 | Before any new Gemma 4 implementation |
GOTCHAS.md |
Known issues and workarounds, severity-ranked | When debugging Gemma 4 issues or starting a new project |
IMPLEMENTATIONS.md |
Patterns from Simon and AI_Visualizer | When designing a new Gemma 4 integration |
CORPUS_architecture.md |
Model architecture details (layers, attention, PLE, MoE) | When you need to understand WHY Gemma 4 behaves a certain way |
CORPUS_ollama_variants.md |
Available models, sizes, VRAM, Ollama settings | When choosing a model variant or configuring Ollama |
CORPUS_capabilities.md |
Modalities (vision, audio, video, tools), what it can/can't do | When scoping what Gemma 4 can handle |
CORPUS_benchmarks.md |
Full benchmark table vs Gemma 3, arena scores, agentic scores | When comparing Gemma 4 to alternatives |
CORPUS_tool_calling_format.md |
Native token format + JSON API format for function calling | When implementing tool calling |
CORPUS_cli_coding_agent.md |
Positioning Gemma 4 for CLI coding agent use (openclaw / open code / pi / hermes / aider style). Honest take on what Google did and didn't measure, head-to-head with qwen3-coder:30b, homelab setup pointer |
When scoping a CLI coding agent or deciding Gemma 4 vs Qwen3-Coder |
docs/reference/bakeoff-2026-04-18.md |
Raw results: CLI-coding-agent bakeoff of gemma4:26b / gemma4:31b / qwen3-coder:30b on steel141 3090 Ti. 31B clean, Qwen3-Coder correct but chatty, 26B reproducibly silent-stops at write_file. Harness at scripts/bakeoff/ |
When deciding which model to back a CLI agent with, or debugging a similar tool-call halt |
tooling/ |
Canonical upstream tooling — real scripts, notebooks, model cards, and configs pulled from Google / HF / framework maintainers (147 files). Subdirs: google-official/, huggingface/, inference-frameworks/, gemma-family/, fine-tuning/. See tooling/README.md for index and findings that update the older CORPUS_* docs |
When you need authoritative source material — model cards, chat templates, fine-tuning recipes, serving commands for vLLM / llama.cpp / MLX, or to scope a specialized sibling (ShieldGemma, EmbeddingGemma, etc.) |
Source Projects
- Simon (
~/bin/FreibergFamily/simon/) — Multi-turn chat agent with 6 tools, genealogy historian - AI Visualizer (
~/bin/AI_Visualizer/) — Music video generator, 4-stage Gemma pipeline + vision
Key Insight
Gemma 4 is ultra-compliant and highly capable but doesn't know who it is. It needs explicit system prompts, not hand-holding. Due to fast local inference, sequential tool calls beat long JSON requests.
Description
Languages
Jupyter Notebook
79.5%
HTML
12.5%
Python
7.5%
Jinja
0.4%