File size: 3,051 Bytes
9548411
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a9a5798
 
 
 
9548411
a9a5798
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9548411
 
 
 
 
 
 
 
a9a5798
9548411
a9a5798
 
 
 
9548411
 
 
a9a5798
 
9548411
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
license: apache-2.0
task_categories:
  - text-generation
tags:
  - function-calling
  - tool-use
  - evaluation
  - gemma4
pretty_name: Gemma-4 Coder  tool-calling gate suite
configs:
  - config_name: default
    data_files: tool_eval_cases.jsonl
---

# Gemma-4 Coder — tool-calling gate suite

The 8-case eval behind the **tool-call pass rate** in our model cards' `model-index`:
positive prompts where the model must emit a structured tool call, plus a no-tool
**abstain** case (it must answer directly, not hallucinate a call). Use it to measure
any local tool-calling model the same way we do — or to reproduce our numbers.

```python
from datasets import load_dataset
cases = load_dataset("tpls/gemma4-coder-tool-eval", split="train")   # each: {name, user, tools, expect}
```

## Scoring a model

Serve a GGUF on `llama.cpp` (`llama-server --jinja`), send each case's `user` + `tools`
the normal OpenAI way, and check the reply against `expect`. **Two rates**, because
`llama.cpp --jinja` doesn't recognise gemma-4's native tool-call markup:

- **raw** — llama.cpp's native parse. For gemma-4 it *structurally undercounts* (blind to the format).
- **shim** — the same outputs re-parsed for the native markup. This is the number that reflects training.

The shim is a tiny serve-side post-processor — ready-to-use (drop-in litellm callback +
a standalone parser, Apache-2.0) at **[`tpls/gemma4-tool-shim`](https://huggingface.co/tpls/gemma4-tool-shim)**,
where the recovery algorithm is also documented so you can re-implement it.

```python
# sketch: per case, POST to your OpenAI-compatible endpoint, then
#   raw_ok  = response had a structured tool_call (or correctly abstained)
#   shim_ok = same, after running the reply through the shim parser
# pass_rate = mean(ok over the 8 cases). expect == [] means "must NOT call a tool".
```

## Files

| File | What |
|------|------|
| `tool_eval_cases.jsonl` | one case/line: `{name, user, tools, expect}` |
| `tool_calib.txt` | imatrix calibration text (code + tool-call markup) used when quantizing |

## Scope & license

Authored by us, fully permissive (apache-2.0). This is an **eval** set, not training data —
our training mix is a derivative of public datasets and is **not** redistributed (its
reproducible recipe lives on each model card). Pairs with the
[`tpls/gemma4-tool-shim`](https://huggingface.co/tpls/gemma4-tool-shim) helper and the models below.

## Used by

- [`tpls/Huihui-gemma-4-12B-coder-fable5-composer2.5-v1-abliterated-GGUF`](https://huggingface.co/tpls/Huihui-gemma-4-12B-coder-fable5-composer2.5-v1-abliterated-GGUF)
- [`tpls/gemma-4-12B-coder-fable5-composer2.5-v1-abliterated-GGUF`](https://huggingface.co/tpls/gemma-4-12B-coder-fable5-composer2.5-v1-abliterated-GGUF)
- [`tpls/gemma-4-12B-coder-fable5-composer2.5-v1-sft-v5`](https://huggingface.co/tpls/gemma-4-12B-coder-fable5-composer2.5-v1-sft-v5)
- [`tpls/gemma-4-12B-coder-fable5-composer2.5-v1-sft-v5-GGUF`](https://huggingface.co/tpls/gemma-4-12B-coder-fable5-composer2.5-v1-sft-v5-GGUF)