ollama/model
Devon Rifkin 8c8f8f3450
model/parsers: add gemma4 tool call repair (#15374)
The existing strict gemma4 tool parser is still the primary path, but if
this fails, we try to repair by fixing some of the most commonly seen
mistakes these models seem to make in practice.

We repair by building up a set of candidates, and use the first candidate
that parses.

Repairs cover:

- missing Gemma string delimiters
- single-quoted string values, including a dangling Gemma delimiter
- raw terminal string values (if the corresponding tool schema indicates
  it should be a string)
- missing object close only after a concrete repair

Add regression coverage for malformed tool calls from issue #15315 and
focused unit tests for the individual repair helpers and candidate
pipeline.
2026-04-06 18:47:17 -07:00
..
imageproc deepseekocr 2025-11-18 16:11:37 -08:00
input batch: use tensors for outputs (#12185) 2025-09-15 14:33:06 -07:00
models tokenizer: add byte fallback for SentencePiece BPE encoding (#15232) 2026-04-02 13:04:45 -07:00
parsers model/parsers: add gemma4 tool call repair (#15374) 2026-04-06 18:47:17 -07:00
renderers Add support for gemma4 (#15214) 2026-04-02 11:33:33 -07:00
model.go Add support for gemma4 (#15214) 2026-04-02 11:33:33 -07:00
model_test.go Add support for gemma4 (#15214) 2026-04-02 11:33:33 -07:00