Skip to content

Feat/gemma4#272

Merged
cubist38 merged 4 commits intomainfrom
feat/gemma4
Apr 4, 2026
Merged

Feat/gemma4#272
cubist38 merged 4 commits intomainfrom
feat/gemma4

Conversation

@cubist38
Copy link
Copy Markdown
Owner

@cubist38 cubist38 commented Apr 4, 2026

Summary

Add reasoning and tool call parsers for Gemma 4 series models.

  • Reasoning parser (Gemma4ReasoningParser): Extracts thinking content wrapped in <|channel>thought\n...<channel|>. Supports enable_thinking flag.
  • Tool call parser (Gemma4ToolParser): Parses tool calls in <|tool_call>call:func_name{key:value}<tool_call|> format with a recursive descent parser for Gemma 4's custom value serialization (<|"|> string delimiters, bare keys, nested objects/arrays).
  • Both parsers registered under the "gemma4" key in the parser registry.

Usage

mlx-openai-server launch \
  --model-path mlx-community/gemma-4-26b-a4b-it-mxfp8 \
  --model-type multimodal \
  --debug \
  --reasoning-parser gemma4 \
  --tool-call-parser gemma4

cubist38 and others added 4 commits April 3, 2026 21:09
- Introduced Gemma4ReasoningParser and Gemma4ToolParser to handle reasoning and tool calls for Gemma 4 models.
- Updated REASONING_PARSER_MAP and TOOL_PARSER_MAP to include new parsers.
- Enhanced __all__ exports to include Gemma4 parsers for better accessibility.
- Updated the docstring to use raw string notation for better handling of escape sequences.
- Adjusted the line break in the example to ensure proper formatting.
@cubist38 cubist38 merged commit ae44769 into main Apr 4, 2026
2 checks passed
@cubist38 cubist38 mentioned this pull request Apr 4, 2026
@cubist38 cubist38 deleted the feat/gemma4 branch April 4, 2026 03:57
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.

1 participant