過去24時間でさらにGemma 4の修正が追加

Reddit r/LocalLLaMA / 2026/4/11

📰 ニュースDeveloper Stack & InfrastructureTools & Practical UsageModels & Research

要点

  • この記事では、llama.cpp リポジトリに統合された「reasoning budget fix(推論予算の修正)」を含む、GoogleのGemma 4モデルに関する最近の修正内容が取り上げられている。
  • Googleは複数のGemma 4バリアント(31B、27B、E4B、E2B)向けに、新しいJinjaチャットテンプレートを提供している。これは特にツール呼び出しの挙動改善を目的としている。
  • 新しく更新されたテンプレート(さらに、まだ更新されていない場合は対応する更新済みのGGUF/モデル成果物)を、古いデフォルトに頼るのではなく使用することを推奨している。
  • 投稿では、llama.cppで `--chat-template-file` コマンドライン引数により特定のテンプレートを適用する方法を示し、VRAMが限られた環境で26Bモデルを実行する例も提示している。
  • llama.cpp/llama-serverのパラメータ一式の例が含まれており、特定のモデルモードで「thinking(思考)」を有効化し、さらに `reasoning_budget` の値を設定する内容が挙げられている。

推論バジェット修正(統合済み): https://github.com/ggml-org/llama.cpp/pull/21697

ツール呼び出しを修正するためのGoogleによる新しいチャットテンプレート:

31B: https://huggingface.co/google/gemma-4-31B-it/blob/main/chat_template.jinja

27B: https://huggingface.co/google/gemma-4-26B-A4B-it/blob/main/chat_template.jinja

E4B: https://huggingface.co/google/gemma-4-E4B-it/blob/main/chat_template.jinja

E2B: https://huggingface.co/google/gemma-4-E2B-it/blob/main/chat_template.jinja

私の理解が間違っていたら訂正してください。でも、新しいGGUFを再ダウンロードして、それが過去24時間のうちに新しいテンプレートで更新されているのでない限り、これらの新しいテンプレートを使うべきです。

llama.cppでは、コマンド引数で特定のテンプレートを指定できます:

--chat-template-file /models/gemma4/gemma4_chat_template_26B.jinja 

現在の llama-swap/llama.cpp 設定 26B の例(VRAM 16GBでのテストなのでコンテキストウィンドウは制限されています):

"Gemma4-26B-IQ4_XS": ttl: 300 # 自動的に5分間の非アクティブ後にアンロード cmd: > /usr/local/bin/llama-server --port ${PORT} --host 127.0.0.1 --model /models/gemma4/gemma-4-26B-A4B-it-UD-IQ4_XS.gguf --mmproj /models/gemma4/gemma-4-26B-A4B-it.mmproj-q8_0.gguf --chat-template-file /models/gemma4/gemma4_chat_template_26B_09APR2026.jinja --cache-type-k q8_0 --cache-type-v q8_0 --n-gpu-layers 99 --parallel 1 --batch-size 2048 --ubatch-size 512 --ctx-size 16384 --image-min-tokens 300 --image-max-tokens 512 --flash-attn on --jinja --cache-ram 2048 -ctxcp 2 filters: stripParams: "temperature, top_p, top_k, min_p, presence_penalty, repeat_penalty" setParamsByID: "${MODEL_ID}:thinking": chat_template_kwargs: enable_thinking: true reasoning_budget: 4096 temperature: 1.0 top_p: 0.95 top_k: 64 min_p: 0.0 presence_penalty: 0.0 repeat_penalty: 1.0 "${MODEL_ID}:thinking-coding": chat_template_kwargs: enable_thinking: true reasoning_budget: 4096 temperature: 1.5 top_p: 0.95 top_k: 65 min_p: 0.0 presence_penalty: 0.0 repeat_penalty: 1.0 "${MODEL_ID}:instruct": chat_template_kwargs: enable_thinking: false temperature: 1.0 top_p: 0.95 top_k: 64 min_p: 0.0 presence_penalty: 0.0 repeat_penalty: 1.0" 
投稿者 /u/andy2na
[リンク] [コメント]