Skip to content

Backport Gemma4 tool parser fixes to 2026.4 - #4511

Open
DassaultFalconKing wants to merge 2 commits into
openvinotoolkit:main-2026.4from
DassaultFalconKing:backport/gemma4-tool-parser-2026.4
Open

Backport Gemma4 tool parser fixes to 2026.4#4511
DassaultFalconKing wants to merge 2 commits into
openvinotoolkit:main-2026.4from
DassaultFalconKing:backport/gemma4-tool-parser-2026.4

Conversation

@DassaultFalconKing

Copy link
Copy Markdown

Summary

This matches what is already on main:

Without this backport, Gemma4 native tool markup can leak into OpenAI message.content instead of message.tool_calls.

Test plan

  • Windows OVMS 2026.4 RC1 (530dc63f) with this parser: Gemma4OutputParserTest.* — 43 tests PASSED
  • Live serve of Gemma4 26B INT4 + OpenAI /v1/chat/completions with tool_choice=auto: tool call exposed as message.tool_calls (get_weather, arguments {"city":"Berlin"}), not raw tool markup in content
  • Linux CI Gemma4OutputParserTest.*

…inotoolkit#4493)

Moving towards convention "if we can emit correct output, do it, even if
it's not completely in line with expected structure".
This approach is more forgiving if model skips some closures. It also
helps if model reaches `max_tokens` limit mid generation and is in
general more live-streaming kind of approach.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants