Views
No views yet
unsloth/gemma-4-26B-A4B-it trained on the tau2-bench
banking_knowledge v2 data (Claude Opus/Sonnet + GPT-5.2 trajectories with
reasoning traces).training/axolotl/gemma4_banking.yaml in Monte-Inc/tau2-banking-sft{q,k,v,o,up,down,gate}_proj regex + MoE expert
3D fused params (experts.gate_up_proj, experts.down_proj)adapter_model.safetensors (3.96 GB) — PEFT LoRA weightsadapter_config.json — target_parameters: [experts.gate_up_proj, experts.down_proj]chat_template.jinja — Google's native 347-line Gemma 4 template (renders
reasoning_content as <|channel>thought\n...<channel|>) — not the older
266-line template shipped with unsloth/gemma-4-26B-A4B-it/tokenizer_config.jsontokenizer.json, tokenizer_config.json, config.json, processor_config.json1# Requires axolotl 0.16.1 + transformers 5.5.0 in a dedicated venv
2# (vllm 0.19.0 pins transformers<5 which breaks the merge)
3python -m venv ~/merge-venv
4~/merge-venv/bin/pip install axolotl==0.16.1
5export AXOLOTL_DO_NOT_TRACK=1 # axolotl 0.16.1 wheel is missing whitelist.yaml
6# Use a merge yaml with: adapter=lora, load_in_4bit=false, quantize_moe_experts removed
7~/merge-venv/bin/axolotl merge-lora /tmp/merge.yaml1# vllm 0.19.0 has Gemma 4 in its own registry but still needs transformers
2# to resolve the AutoConfig, so force transformers 5.5.0 via --no-deps:
3~/vllm-venv/bin/pip install --no-deps transformers==5.5.0
4~/vllm-venv/bin/pip install --upgrade huggingface_hub # → 1.10+
5
6vllm serve /path/to/merged-gemma4-sft \
7 --served-model-name gemma4-banking-sft \
8 --host 0.0.0.0 --port 8000 \
9 --dtype bfloat16 \
10 --max-model-len 100000 \
11 --gpu-memory-utilization 0.90 \
12 --tool-call-parser gemma4 \
13 --reasoning-parser gemma4 \
14 --enable-auto-tool-choice \
15 --default-chat-template-kwargs '{"enable_thinking":true}'tool_calls[].function.arguments as a JSON
string, but the template's string branch just echoes it, producing
{{"account_id":"A1"}} (double braces) instead of the Gemma format
{account_id:<|"|>A1<|"|>}. Fix: in chat_template.jinja, replace the
tool_call arguments block with:1{%- set args = function['arguments'] -%}
2{%- if args is string -%}
3 {%- set args = args | fromjson -%}
4{%- endif -%}
5{%- if args is mapping -%}
6 {%- set ns_args = namespace(found_first=false) -%}
7 {%- for key, value in args | dictsort -%}
8 {%- if ns_args.found_first %},{% endif -%}
9 {%- set ns_args.found_first = true -%}
10 {{- key -}}:{{- format_argument(value, escape_keys=False) -}}
11 {%- endfor -%}
12{%- endif -%}fromjson filter in transformers' chat template utils:1# in transformers/utils/chat_template_utils.py, near where tojson is set:
2jinja_env.filters["fromjson"] = lambda x: __import__("json").loads(x) if isinstance(x, str) else x<|tool_call>. Symptom: model loops on
the same tool call indefinitely (hits max_steps). Fix: in the
generation-prompt block of chat_template.jinja, force <|channel>thought\n
on both the initial turn and continuation after tool responses when
enable_thinking=True:1{%- if add_generation_prompt -%}
2 {%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
3 {{- '<|turn>model\n' -}}
4 {%- if enable_thinking | default(false) -%}
5 {{- '<|channel>thought\n' -}}
6 {%- else -%}
7 {{- '<|channel>thought\n<channel|>' -}}
8 {%- endif -%}
9 {%- elif ns.prev_message_type == 'tool_response' and enable_thinking | default(false) -%}
10 {#- force thinking on continuation to avoid tool-call loops -#}
11 {{- '<|channel>thought\n' -}}
12 {%- endif -%}
13{%- endif -%}| Run | Pass rate (banking_knowledge, gpt-5.2 user, terminal_use) |
|---|---|
| Gemma 4 26B MoE base (thinking) | 13.9% (53/382) |
| Qwen v6 SFT (thinking) | 13.8% |
1tau2 run --domain banking_knowledge \
2 --agent-llm openai/gemma4-banking-sft \
3 --agent-llm-args '{"api_base":"http://localhost:8000/v1","temperature":0.0}' \
4 --user-llm gpt-5.2 \
5 --retrieval-config terminal_use \
6 --max-concurrency 10 --num-trials 4 --max-steps 200 \
7 --seed 42 --max-retries 3 \
8 --save-to gemma4-sft-v3-4t-test