Summary
Gemma 4 (31B, 26B) models do not work with tool calling when using the Nous Research inference API. The model outputs tool calls in text format, but they are not parsed into structured tool_calls on the API response.
Problem
When using Gemma 4 via Nous inference API (https://inference-api.nousresearch.com/v1):
- Request includes
tools= parameter (OpenAI-compatible)
- Gemma 4 generates tool calls in its native text format:
<|tool_call>call:search(query: "blockchain news")<tool_call|>
- API response returns
tool_calls: null — the text remains in content only
- Hermes Agent treats this as a final text response and does not execute the tool
Evidence
Tested with google/gemma-4-31b-it via Nous API:
# With native tools parameter → tool_calls is always None
payload = {"model": "google/gemma-4-31b-it", "tools": [...], "messages": [...]}
response.choices[0].message.tool_calls # None
response.choices[0].message.content # "<|tool_call>call:search(...)<tool_call|>"
# Same test with Qwen → tool_calls is populated correctly
payload = {"model": "qwen/qwen3.5-plus-02-15", "tools": [...], "messages": [...]}
response.choices[0].message.tool_calls # [{"function": {"name": "search", ...}}]
6 different prompt patterns tested (single arg, multi arg, nested dict, multi tool call, integer args, Unicode/Korean) — Gemma consistently outputs valid tool calls in content but tool_calls field is always None.
Request
Please add server-side parsing for Gemma 4's tool call format (<|tool_call>call:name(args)<tool_call|>) in the Nous inference API, similar to how Qwen's <tool_call> format is already parsed into structured tool_calls.
Related
Workaround
Currently using Qwen 3.5 as an alternative. A client-side parser has been submitted in #7449 for Phase 2 (vLLM) and RL training fallback, but Phase 1 (Nous API) requires server-side support.
Summary
Gemma 4 (31B, 26B) models do not work with tool calling when using the Nous Research inference API. The model outputs tool calls in text format, but they are not parsed into structured
tool_callson the API response.Problem
When using Gemma 4 via Nous inference API (
https://inference-api.nousresearch.com/v1):tools=parameter (OpenAI-compatible)tool_calls: null— the text remains incontentonlyEvidence
Tested with
google/gemma-4-31b-itvia Nous API:6 different prompt patterns tested (single arg, multi arg, nested dict, multi tool call, integer args, Unicode/Korean) — Gemma consistently outputs valid tool calls in content but
tool_callsfield is alwaysNone.Request
Please add server-side parsing for Gemma 4's tool call format (
<|tool_call>call:name(args)<tool_call|>) in the Nous inference API, similar to how Qwen's<tool_call>format is already parsed into structuredtool_calls.Related
Workaround
Currently using Qwen 3.5 as an alternative. A client-side parser has been submitted in #7449 for Phase 2 (vLLM) and RL training fallback, but Phase 1 (Nous API) requires server-side support.