Entropic 2.11.1
Local-first agentic inference engine
Loading...
Searching...
No Matches
gemma4_adapter.h File Reference

Gemma4Adapter — the fallback parse path for Gemma-4 tiers (gh#108). More...

Include dependency graph for gemma4_adapter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  entropic::Gemma4Adapter
 Fallback adapter for Gemma-4 tiers; owns the <|channel> markers. More...
 

Namespaces

namespace  entropic
 Activate model on GPU (WARM → ACTIVE).
 

Detailed Description

Gemma4Adapter — the fallback parse path for Gemma-4 tiers (gh#108).

Why this exists
Gemma-4 tool calls are parsed by llama.cpp's dedicated PEG_GEMMA4 grammar, which is why adapter_registry deliberately had no gemma4 entry. But that path is gated on common_chat_parse_reliable(), which requires a TOOLED render to have captured a parser arena. A toolless generate — a bare entropic.ask, a validator critique, any consumer not staging tools — has no arena, falls through to the adapter branch, and before v2.10.3 landed on GenericAdapter. Generic strips <think>, a marker Gemma-4 never emits, and left <|channel>…<channel|> fully intact, so raw reasoning reached consumers and conversation history on every path: plain, streaming, MTP, batch.

So this adapter is a fallback, not a replacement for the template path. Tool-call extraction still defers to the base tagged/bare-JSON primitives — PEG_GEMMA4 remains primary whenever an arena exists. What this class exists to own is the family's reasoning delimiters, declared once via thinking_markers() and consumed by both the buffered strip and the live StreamThinkFilter.

Version
2.10.3

Definition in file gemma4_adapter.h.