Skip to content

Gemma 4 tool calling support (parser availability & required configuration) #6626

@spprod35

Description

@spprod35

Hello,

I am currently integrating Gemma 4 (via vLLM) with Hermes Agent and encountering issues with tool calling parsing.

Context

Setup:

  • Model: google/gemma-4-E4B-it

  • Runtime: vLLM (vllm-openai:gemma4)

  • Flags:

    • --tool-call-parser gemma4
    • --enable-auto-tool-choice
  • Hermes Agent (latest version)

Observed behavior

Gemma 4 produces tool calls in the following format:

<|tool_call>call:search_files{pattern:<|"|>/var/log<|"|>,target:<|"|>files<|"|>}<tool_call|>

However:

  • The tool_calls field is empty
  • The tool call remains embedded in message.content
  • Hermes does not execute the tool, as it relies on message.tool_calls

This results in a silent failure of tool execution.

This behavior appears consistent with other reports where:

  • Gemma outputs valid tool calls
  • but parsers fail to extract them into structured fields ([GitHub]1)

Questions

  1. Does Hermes Agent currently support a native Gemma parser?

    • I could not find any gemma parser in environments/tool_call_parsers
    • Is this planned or already available under another name?
  2. Is there a recommended parser for Gemma 4?

    • pythonic seems partially compatible with call:func{...} formats
    • but Gemma 4 uses <|tool_call> ... <tool_call|> tokens
  3. Is a custom chat_template required for Gemma?

    • vLLM documentation suggests that only some models have built-in tool templates
    • Gemma appears to require explicit formatting ([vLLM]2)
  4. Is Hermes expected to handle raw tool call text as fallback?

    • Currently Hermes only checks message.tool_calls
    • Would a fallback parsing mechanism (from content) be considered?

Goal

Clarify the recommended way to use Gemma 4 + vLLM with Hermes, and whether first-class support is planned.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/agentCore agent loop, run_agent.py, prompt builderprovider/geminiGoogle Gemini (AI Studio, Cloud Code)type/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions