From 66d2d7090e76c9fec04481aac40e8b36ec1fa64c Mon Sep 17 00:00:00 2001 From: Feranmi <89228157+Feranmi10@users.noreply.github.com> Date: Wed, 22 Apr 2026 22:56:54 +0100 Subject: [PATCH] fix(model_metadata): add gemma-4 and gemma4 context length entries Fixes #12976 The generic "gemma": 8192 fallback was incorrectly matching gemma4:31b-cloud before the more specific Gemma 4 entries could match, causing Hermes to assign only 8K context instead of 262K. Added "gemma-4" and "gemma4" entries before the fallback to correctly handle Gemma 4 model naming conventions. --- agent/model_metadata.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/agent/model_metadata.py b/agent/model_metadata.py index 8a14ca2218..335d02bd6f 100644 --- a/agent/model_metadata.py +++ b/agent/model_metadata.py @@ -133,6 +133,8 @@ DEFAULT_CONTEXT_LENGTHS = { # Google "gemini": 1048576, # Gemma (open models served via AI Studio) + "gemma-4": 256000, # Gemma 4 family + "gemma4": 256000, # Ollama-style naming (e.g. gemma4:31b-cloud) "gemma-4-31b": 256000, "gemma-3": 131072, "gemma": 8192, # fallback for older gemma models