Inference: gemma4 tool/reasoning parsers; add flatclaw-inference-dev image#2
Merged
Merged
Conversation
Source-of-truth fix to match the parser flags that production has been running. Past session JSONLs show prod's deployed pod was already using --tool-call-parser gemma4 (125+ structured toolCall blocks captured, zero raw <|tool_call|> envelope leaks). The repo's infra/inference/entrypoint.sh had drifted to "pythonic" — wrong for Gemma 4, would have broken the next image republish. - infra/inference/entrypoint.sh: --tool-call-parser pythonic → gemma4, plus --reasoning-parser gemma4. Per SGLang's published Gemma 4 cookbook (PR sgl-project/sglang#21952). Thinking still defaults OFF in the chat template — callers must pass extra_body.chat_template_kwargs.enable_thinking=true to activate. - infra/inference-dev/{Dockerfile,entrypoint.sh}: new dev-inference image, mirrors the prod Dockerfile shape exactly. Same SGLang base, same crane-mutate publish pattern, same parser flags. Diverges only on dtype (bfloat16 vs fp8) and the GEMMA_DIR_NAME default (gemma-4-e4b-it vs gemma-4-31b-it). - .github/workflows/publish-inference-dev.yml: companion publish workflow for ghcr.io/<owner>/flatclaw-inference-dev:latest. Same shape as publish-inference.yml, runs on push-to-main when the inference-dev files change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
infra/inference/entrypoint.sh: `--tool-call-parser pythonic` → `gemma4`, plus `--reasoning-parser gemma4`. Source-of-truth fix to match what production has been running — past session JSONLs show prod's deployed pod was already using `gemma4` (125+ structured toolCall blocks captured, zero raw `<|tool_call|>` envelope leaks). The repo had drifted to "pythonic" which is wrong for Gemma 4 and would have broken the next image republish. See SGLang's Gemma 4 cookbook and sgl-project/sglang#21952.infra/inference-dev/{Dockerfile,entrypoint.sh}: new dev-inference image. Mirrors the prod Dockerfile/entrypoint shape exactly — same SGLang base, same crane-mutate publish pattern, same parser flags. Diverges only on dtype (`bfloat16` vs `fp8`) and the `GEMMA_DIR_NAME` default (`gemma-4-e4b-it` vs `gemma-4-31b-it`). Same plumbing both lanes; switching never breaks..github/workflows/publish-inference-dev.yml: companion publish workflow for `ghcr.io/skytruax/flatclaw-inference-dev:latest`. Same shape as `publish-inference.yml`, auto-runs on push-to-main when the inference-dev files change.Notes on thinking mode
Per Gemma 4's chat template, `enable_thinking` is OFF by default. Even with `--reasoning-parser gemma4` set, callers must pass `extra_body.chat_template_kwargs.enable_thinking=true` per request to activate it. openclaw's `thinkingDefault: "high"` config does not (today) translate to that extra_body field — that's a follow-up for the openclaw config plumbing, separate from this PR.
Test plan