HiramKHackenbacker commited on
Commit
23761c6
·
verified ·
1 Parent(s): 2489fa8

tiered-v3/ — an fp16 vocab path, seven rungs, prefill and verify

Browse files
Files changed (9) hide show
  1. .gitattributes +2 -0
  2. tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k.aimodel/main.hash +0 -0
  3. tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k.aimodel/main.mlirb +3 -0
  4. tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k.aimodel/metadata.json +5 -0
  5. tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/metadata.json +120 -0
  6. tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/tier_report.json +1148 -0
  7. tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/tokenizer/chat_template.jinja +390 -0
  8. tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/tokenizer/tokenizer.json +3 -0
  9. tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/tokenizer/tokenizer_config.json +120 -0
.gitattributes CHANGED
@@ -43,3 +43,5 @@ dense2in-int8/gemma4_12b_qat_decode_int8lin_pf64/gemma4_12b_qat_decode_int8lin_p
43
  dense2in-int8/gemma4_12b_qat_decode_int8lin_pf64/tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
44
  tiered/gemma4_12b_qat_decode_int4linsym_e4_msdpa_g8_wkv_stable_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/gemma4_12b_qat_decode_int4linsym_e4_msdpa_g8_wkv_stable_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
45
  tiered/gemma4_12b_qat_decode_int4linsym_e4_msdpa_g8_wkv_stable_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
 
 
 
43
  dense2in-int8/gemma4_12b_qat_decode_int8lin_pf64/tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
44
  tiered/gemma4_12b_qat_decode_int4linsym_e4_msdpa_g8_wkv_stable_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/gemma4_12b_qat_decode_int4linsym_e4_msdpa_g8_wkv_stable_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
45
  tiered/gemma4_12b_qat_decode_int4linsym_e4_msdpa_g8_wkv_stable_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
46
+ tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
47
+ tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k.aimodel/main.hash ADDED
Binary file (32 Bytes). View file
 
tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57bf5d507ca70e001c58bf72ea20308b232cb56835bfe3e5fcde13ac017cb34d
3
+ size 8158295378
tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k.aimodel/metadata.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "creationDate" : "20260828T150533Z",
3
+ "assetVersion" : "2.0",
4
+ "producer" : "coreai-core 1.0.0b2"
5
+ }
tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/metadata.json ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata_version": "0.2",
3
+ "kind": "llm",
4
+ "name": "gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k",
5
+ "assets": {
6
+ "main": "gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k.aimodel"
7
+ },
8
+ "language": {
9
+ "tokenizer": "google/gemma-4-12B-it-qat-q4_0-unquantized",
10
+ "vocab_size": 262144,
11
+ "max_context_length": 262144,
12
+ "embedded_tokenizer": true,
13
+ "function_map": {
14
+ "main": [
15
+ "main_c4096",
16
+ "main_c8192",
17
+ "main_c16384",
18
+ "main_c32768",
19
+ "main_c65536",
20
+ "main_c131072",
21
+ "main_c262144"
22
+ ],
23
+ "prefill": [
24
+ "prefill_c4096",
25
+ "prefill_c8192",
26
+ "prefill_c16384",
27
+ "prefill_c32768",
28
+ "prefill_c65536",
29
+ "prefill_c131072",
30
+ "prefill_c262144"
31
+ ]
32
+ },
33
+ "capacity_tiers": [
34
+ {
35
+ "function": "main_c4096",
36
+ "prefill_function": "prefill_c4096",
37
+ "prefill_block_tokens": 64,
38
+ "context_window_tokens": 4096,
39
+ "global_kv_bytes": 67108864,
40
+ "ring_kv_bytes": 335544320,
41
+ "total_kv_bytes": 402653184
42
+ },
43
+ {
44
+ "function": "main_c8192",
45
+ "prefill_function": "prefill_c8192",
46
+ "prefill_block_tokens": 64,
47
+ "context_window_tokens": 8192,
48
+ "global_kv_bytes": 134217728,
49
+ "ring_kv_bytes": 335544320,
50
+ "total_kv_bytes": 469762048
51
+ },
52
+ {
53
+ "function": "main_c16384",
54
+ "prefill_function": "prefill_c16384",
55
+ "prefill_block_tokens": 64,
56
+ "context_window_tokens": 16384,
57
+ "global_kv_bytes": 268435456,
58
+ "ring_kv_bytes": 335544320,
59
+ "total_kv_bytes": 603979776
60
+ },
61
+ {
62
+ "function": "main_c32768",
63
+ "prefill_function": "prefill_c32768",
64
+ "prefill_block_tokens": 64,
65
+ "context_window_tokens": 32768,
66
+ "global_kv_bytes": 536870912,
67
+ "ring_kv_bytes": 335544320,
68
+ "total_kv_bytes": 872415232
69
+ },
70
+ {
71
+ "function": "main_c65536",
72
+ "prefill_function": "prefill_c65536",
73
+ "prefill_block_tokens": 64,
74
+ "context_window_tokens": 65536,
75
+ "global_kv_bytes": 1073741824,
76
+ "ring_kv_bytes": 335544320,
77
+ "total_kv_bytes": 1409286144
78
+ },
79
+ {
80
+ "function": "main_c131072",
81
+ "prefill_function": "prefill_c131072",
82
+ "prefill_block_tokens": 64,
83
+ "context_window_tokens": 131072,
84
+ "global_kv_bytes": 2147483648,
85
+ "ring_kv_bytes": 335544320,
86
+ "total_kv_bytes": 2483027968
87
+ },
88
+ {
89
+ "function": "main_c262144",
90
+ "prefill_function": "prefill_c262144",
91
+ "prefill_block_tokens": 64,
92
+ "context_window_tokens": 262144,
93
+ "global_kv_bytes": 4294967296,
94
+ "ring_kv_bytes": 335544320,
95
+ "total_kv_bytes": 4630511616
96
+ }
97
+ ],
98
+ "capacity_tier_notes": {
99
+ "prefill_block_tokens": 64,
100
+ "prefill_contract": "prefill_c<N> takes input_ids/position_ids [1,64] with CONSECUTIVE absolute positions and returns the last row's logits [1,1,V]. It mutates the same states as main_c<N>. A final partial block must be PADDED to the block size: padding tokens land at slots the causal/implied-position mask excludes for every query that could read them, and are overwritten before they could ever be admitted. The host must NOT advance its logical length past the real token count.",
101
+ "global_kv_bytes_per_token": 16384,
102
+ "global_kv_bytes_per_token_fp16_equivalent": 16384,
103
+ "global_kv_dtype": "fp16",
104
+ "ring_is_capacity_invariant": true,
105
+ "sliding_window": 1024,
106
+ "shape_stable_decode": true,
107
+ "shape_stable_decode_gate": "gate_wkv_stable.py + gate_prefill_equiv.py",
108
+ "selection": "pick the highest tier whose total_kv_bytes the machine admits at load; every tier is individually shape-stable"
109
+ }
110
+ },
111
+ "source": {
112
+ "model_definition": "torch",
113
+ "hf_model_id": "google/gemma-4-12B-it-qat-q4_0-unquantized"
114
+ },
115
+ "compression": null,
116
+ "compilation": {
117
+ "date": "2026-08-28T15:05:41.192673+00:00",
118
+ "targets": []
119
+ }
120
+ }
tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/tier_report.json ADDED
@@ -0,0 +1,1148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k",
3
+ "tiers": [
4
+ 4096,
5
+ 8192,
6
+ 16384,
7
+ 32768,
8
+ 65536,
9
+ 131072,
10
+ 262144
11
+ ],
12
+ "entrypoints": [
13
+ "main_c4096",
14
+ "main_c8192",
15
+ "main_c16384",
16
+ "main_c32768",
17
+ "main_c65536",
18
+ "main_c131072",
19
+ "main_c262144"
20
+ ],
21
+ "prefill_entrypoints": [
22
+ "prefill_c4096",
23
+ "prefill_c8192",
24
+ "prefill_c16384",
25
+ "prefill_c32768",
26
+ "prefill_c65536",
27
+ "prefill_c131072",
28
+ "prefill_c262144"
29
+ ],
30
+ "prefill_block_tokens": 64,
31
+ "mlirb_bytes": 8158295378,
32
+ "global_kv_bytes_per_token": 16384,
33
+ "ring_kv_bytes": 335544320,
34
+ "states_per_entrypoint": {
35
+ "main_c4096": [
36
+ {
37
+ "name": "keyCache",
38
+ "shape": [
39
+ 8,
40
+ 1,
41
+ 1,
42
+ 4096,
43
+ 512
44
+ ],
45
+ "dtype": "f16",
46
+ "dynamic": false
47
+ },
48
+ {
49
+ "name": "valueCache",
50
+ "shape": [
51
+ 8,
52
+ 1,
53
+ 1,
54
+ 4096,
55
+ 512
56
+ ],
57
+ "dtype": "f16",
58
+ "dynamic": false
59
+ },
60
+ {
61
+ "name": "localKeyCache",
62
+ "shape": [
63
+ 40,
64
+ 1,
65
+ 8,
66
+ 1024,
67
+ 256
68
+ ],
69
+ "dtype": "f16",
70
+ "dynamic": false
71
+ },
72
+ {
73
+ "name": "localValueCache",
74
+ "shape": [
75
+ 40,
76
+ 1,
77
+ 8,
78
+ 1024,
79
+ 256
80
+ ],
81
+ "dtype": "f16",
82
+ "dynamic": false
83
+ }
84
+ ],
85
+ "main_c8192": [
86
+ {
87
+ "name": "keyCache",
88
+ "shape": [
89
+ 8,
90
+ 1,
91
+ 1,
92
+ 8192,
93
+ 512
94
+ ],
95
+ "dtype": "f16",
96
+ "dynamic": false
97
+ },
98
+ {
99
+ "name": "valueCache",
100
+ "shape": [
101
+ 8,
102
+ 1,
103
+ 1,
104
+ 8192,
105
+ 512
106
+ ],
107
+ "dtype": "f16",
108
+ "dynamic": false
109
+ },
110
+ {
111
+ "name": "localKeyCache",
112
+ "shape": [
113
+ 40,
114
+ 1,
115
+ 8,
116
+ 1024,
117
+ 256
118
+ ],
119
+ "dtype": "f16",
120
+ "dynamic": false
121
+ },
122
+ {
123
+ "name": "localValueCache",
124
+ "shape": [
125
+ 40,
126
+ 1,
127
+ 8,
128
+ 1024,
129
+ 256
130
+ ],
131
+ "dtype": "f16",
132
+ "dynamic": false
133
+ }
134
+ ],
135
+ "main_c16384": [
136
+ {
137
+ "name": "keyCache",
138
+ "shape": [
139
+ 8,
140
+ 1,
141
+ 1,
142
+ 16384,
143
+ 512
144
+ ],
145
+ "dtype": "f16",
146
+ "dynamic": false
147
+ },
148
+ {
149
+ "name": "valueCache",
150
+ "shape": [
151
+ 8,
152
+ 1,
153
+ 1,
154
+ 16384,
155
+ 512
156
+ ],
157
+ "dtype": "f16",
158
+ "dynamic": false
159
+ },
160
+ {
161
+ "name": "localKeyCache",
162
+ "shape": [
163
+ 40,
164
+ 1,
165
+ 8,
166
+ 1024,
167
+ 256
168
+ ],
169
+ "dtype": "f16",
170
+ "dynamic": false
171
+ },
172
+ {
173
+ "name": "localValueCache",
174
+ "shape": [
175
+ 40,
176
+ 1,
177
+ 8,
178
+ 1024,
179
+ 256
180
+ ],
181
+ "dtype": "f16",
182
+ "dynamic": false
183
+ }
184
+ ],
185
+ "main_c32768": [
186
+ {
187
+ "name": "keyCache",
188
+ "shape": [
189
+ 8,
190
+ 1,
191
+ 1,
192
+ 32768,
193
+ 512
194
+ ],
195
+ "dtype": "f16",
196
+ "dynamic": false
197
+ },
198
+ {
199
+ "name": "valueCache",
200
+ "shape": [
201
+ 8,
202
+ 1,
203
+ 1,
204
+ 32768,
205
+ 512
206
+ ],
207
+ "dtype": "f16",
208
+ "dynamic": false
209
+ },
210
+ {
211
+ "name": "localKeyCache",
212
+ "shape": [
213
+ 40,
214
+ 1,
215
+ 8,
216
+ 1024,
217
+ 256
218
+ ],
219
+ "dtype": "f16",
220
+ "dynamic": false
221
+ },
222
+ {
223
+ "name": "localValueCache",
224
+ "shape": [
225
+ 40,
226
+ 1,
227
+ 8,
228
+ 1024,
229
+ 256
230
+ ],
231
+ "dtype": "f16",
232
+ "dynamic": false
233
+ }
234
+ ],
235
+ "main_c65536": [
236
+ {
237
+ "name": "keyCache",
238
+ "shape": [
239
+ 8,
240
+ 1,
241
+ 1,
242
+ 65536,
243
+ 512
244
+ ],
245
+ "dtype": "f16",
246
+ "dynamic": false
247
+ },
248
+ {
249
+ "name": "valueCache",
250
+ "shape": [
251
+ 8,
252
+ 1,
253
+ 1,
254
+ 65536,
255
+ 512
256
+ ],
257
+ "dtype": "f16",
258
+ "dynamic": false
259
+ },
260
+ {
261
+ "name": "localKeyCache",
262
+ "shape": [
263
+ 40,
264
+ 1,
265
+ 8,
266
+ 1024,
267
+ 256
268
+ ],
269
+ "dtype": "f16",
270
+ "dynamic": false
271
+ },
272
+ {
273
+ "name": "localValueCache",
274
+ "shape": [
275
+ 40,
276
+ 1,
277
+ 8,
278
+ 1024,
279
+ 256
280
+ ],
281
+ "dtype": "f16",
282
+ "dynamic": false
283
+ }
284
+ ],
285
+ "main_c131072": [
286
+ {
287
+ "name": "keyCache",
288
+ "shape": [
289
+ 8,
290
+ 1,
291
+ 1,
292
+ 131072,
293
+ 512
294
+ ],
295
+ "dtype": "f16",
296
+ "dynamic": false
297
+ },
298
+ {
299
+ "name": "valueCache",
300
+ "shape": [
301
+ 8,
302
+ 1,
303
+ 1,
304
+ 131072,
305
+ 512
306
+ ],
307
+ "dtype": "f16",
308
+ "dynamic": false
309
+ },
310
+ {
311
+ "name": "localKeyCache",
312
+ "shape": [
313
+ 40,
314
+ 1,
315
+ 8,
316
+ 1024,
317
+ 256
318
+ ],
319
+ "dtype": "f16",
320
+ "dynamic": false
321
+ },
322
+ {
323
+ "name": "localValueCache",
324
+ "shape": [
325
+ 40,
326
+ 1,
327
+ 8,
328
+ 1024,
329
+ 256
330
+ ],
331
+ "dtype": "f16",
332
+ "dynamic": false
333
+ }
334
+ ],
335
+ "main_c262144": [
336
+ {
337
+ "name": "keyCache",
338
+ "shape": [
339
+ 8,
340
+ 1,
341
+ 1,
342
+ 262144,
343
+ 512
344
+ ],
345
+ "dtype": "f16",
346
+ "dynamic": false
347
+ },
348
+ {
349
+ "name": "valueCache",
350
+ "shape": [
351
+ 8,
352
+ 1,
353
+ 1,
354
+ 262144,
355
+ 512
356
+ ],
357
+ "dtype": "f16",
358
+ "dynamic": false
359
+ },
360
+ {
361
+ "name": "localKeyCache",
362
+ "shape": [
363
+ 40,
364
+ 1,
365
+ 8,
366
+ 1024,
367
+ 256
368
+ ],
369
+ "dtype": "f16",
370
+ "dynamic": false
371
+ },
372
+ {
373
+ "name": "localValueCache",
374
+ "shape": [
375
+ 40,
376
+ 1,
377
+ 8,
378
+ 1024,
379
+ 256
380
+ ],
381
+ "dtype": "f16",
382
+ "dynamic": false
383
+ }
384
+ ],
385
+ "prefill_c4096": [
386
+ {
387
+ "name": "keyCache",
388
+ "shape": [
389
+ 8,
390
+ 1,
391
+ 1,
392
+ 4096,
393
+ 512
394
+ ],
395
+ "dtype": "f16",
396
+ "dynamic": false
397
+ },
398
+ {
399
+ "name": "valueCache",
400
+ "shape": [
401
+ 8,
402
+ 1,
403
+ 1,
404
+ 4096,
405
+ 512
406
+ ],
407
+ "dtype": "f16",
408
+ "dynamic": false
409
+ },
410
+ {
411
+ "name": "localKeyCache",
412
+ "shape": [
413
+ 40,
414
+ 1,
415
+ 8,
416
+ 1024,
417
+ 256
418
+ ],
419
+ "dtype": "f16",
420
+ "dynamic": false
421
+ },
422
+ {
423
+ "name": "localValueCache",
424
+ "shape": [
425
+ 40,
426
+ 1,
427
+ 8,
428
+ 1024,
429
+ 256
430
+ ],
431
+ "dtype": "f16",
432
+ "dynamic": false
433
+ }
434
+ ],
435
+ "prefill_c8192": [
436
+ {
437
+ "name": "keyCache",
438
+ "shape": [
439
+ 8,
440
+ 1,
441
+ 1,
442
+ 8192,
443
+ 512
444
+ ],
445
+ "dtype": "f16",
446
+ "dynamic": false
447
+ },
448
+ {
449
+ "name": "valueCache",
450
+ "shape": [
451
+ 8,
452
+ 1,
453
+ 1,
454
+ 8192,
455
+ 512
456
+ ],
457
+ "dtype": "f16",
458
+ "dynamic": false
459
+ },
460
+ {
461
+ "name": "localKeyCache",
462
+ "shape": [
463
+ 40,
464
+ 1,
465
+ 8,
466
+ 1024,
467
+ 256
468
+ ],
469
+ "dtype": "f16",
470
+ "dynamic": false
471
+ },
472
+ {
473
+ "name": "localValueCache",
474
+ "shape": [
475
+ 40,
476
+ 1,
477
+ 8,
478
+ 1024,
479
+ 256
480
+ ],
481
+ "dtype": "f16",
482
+ "dynamic": false
483
+ }
484
+ ],
485
+ "prefill_c16384": [
486
+ {
487
+ "name": "keyCache",
488
+ "shape": [
489
+ 8,
490
+ 1,
491
+ 1,
492
+ 16384,
493
+ 512
494
+ ],
495
+ "dtype": "f16",
496
+ "dynamic": false
497
+ },
498
+ {
499
+ "name": "valueCache",
500
+ "shape": [
501
+ 8,
502
+ 1,
503
+ 1,
504
+ 16384,
505
+ 512
506
+ ],
507
+ "dtype": "f16",
508
+ "dynamic": false
509
+ },
510
+ {
511
+ "name": "localKeyCache",
512
+ "shape": [
513
+ 40,
514
+ 1,
515
+ 8,
516
+ 1024,
517
+ 256
518
+ ],
519
+ "dtype": "f16",
520
+ "dynamic": false
521
+ },
522
+ {
523
+ "name": "localValueCache",
524
+ "shape": [
525
+ 40,
526
+ 1,
527
+ 8,
528
+ 1024,
529
+ 256
530
+ ],
531
+ "dtype": "f16",
532
+ "dynamic": false
533
+ }
534
+ ],
535
+ "prefill_c32768": [
536
+ {
537
+ "name": "keyCache",
538
+ "shape": [
539
+ 8,
540
+ 1,
541
+ 1,
542
+ 32768,
543
+ 512
544
+ ],
545
+ "dtype": "f16",
546
+ "dynamic": false
547
+ },
548
+ {
549
+ "name": "valueCache",
550
+ "shape": [
551
+ 8,
552
+ 1,
553
+ 1,
554
+ 32768,
555
+ 512
556
+ ],
557
+ "dtype": "f16",
558
+ "dynamic": false
559
+ },
560
+ {
561
+ "name": "localKeyCache",
562
+ "shape": [
563
+ 40,
564
+ 1,
565
+ 8,
566
+ 1024,
567
+ 256
568
+ ],
569
+ "dtype": "f16",
570
+ "dynamic": false
571
+ },
572
+ {
573
+ "name": "localValueCache",
574
+ "shape": [
575
+ 40,
576
+ 1,
577
+ 8,
578
+ 1024,
579
+ 256
580
+ ],
581
+ "dtype": "f16",
582
+ "dynamic": false
583
+ }
584
+ ],
585
+ "prefill_c65536": [
586
+ {
587
+ "name": "keyCache",
588
+ "shape": [
589
+ 8,
590
+ 1,
591
+ 1,
592
+ 65536,
593
+ 512
594
+ ],
595
+ "dtype": "f16",
596
+ "dynamic": false
597
+ },
598
+ {
599
+ "name": "valueCache",
600
+ "shape": [
601
+ 8,
602
+ 1,
603
+ 1,
604
+ 65536,
605
+ 512
606
+ ],
607
+ "dtype": "f16",
608
+ "dynamic": false
609
+ },
610
+ {
611
+ "name": "localKeyCache",
612
+ "shape": [
613
+ 40,
614
+ 1,
615
+ 8,
616
+ 1024,
617
+ 256
618
+ ],
619
+ "dtype": "f16",
620
+ "dynamic": false
621
+ },
622
+ {
623
+ "name": "localValueCache",
624
+ "shape": [
625
+ 40,
626
+ 1,
627
+ 8,
628
+ 1024,
629
+ 256
630
+ ],
631
+ "dtype": "f16",
632
+ "dynamic": false
633
+ }
634
+ ],
635
+ "prefill_c131072": [
636
+ {
637
+ "name": "keyCache",
638
+ "shape": [
639
+ 8,
640
+ 1,
641
+ 1,
642
+ 131072,
643
+ 512
644
+ ],
645
+ "dtype": "f16",
646
+ "dynamic": false
647
+ },
648
+ {
649
+ "name": "valueCache",
650
+ "shape": [
651
+ 8,
652
+ 1,
653
+ 1,
654
+ 131072,
655
+ 512
656
+ ],
657
+ "dtype": "f16",
658
+ "dynamic": false
659
+ },
660
+ {
661
+ "name": "localKeyCache",
662
+ "shape": [
663
+ 40,
664
+ 1,
665
+ 8,
666
+ 1024,
667
+ 256
668
+ ],
669
+ "dtype": "f16",
670
+ "dynamic": false
671
+ },
672
+ {
673
+ "name": "localValueCache",
674
+ "shape": [
675
+ 40,
676
+ 1,
677
+ 8,
678
+ 1024,
679
+ 256
680
+ ],
681
+ "dtype": "f16",
682
+ "dynamic": false
683
+ }
684
+ ],
685
+ "prefill_c262144": [
686
+ {
687
+ "name": "keyCache",
688
+ "shape": [
689
+ 8,
690
+ 1,
691
+ 1,
692
+ 262144,
693
+ 512
694
+ ],
695
+ "dtype": "f16",
696
+ "dynamic": false
697
+ },
698
+ {
699
+ "name": "valueCache",
700
+ "shape": [
701
+ 8,
702
+ 1,
703
+ 1,
704
+ 262144,
705
+ 512
706
+ ],
707
+ "dtype": "f16",
708
+ "dynamic": false
709
+ },
710
+ {
711
+ "name": "localKeyCache",
712
+ "shape": [
713
+ 40,
714
+ 1,
715
+ 8,
716
+ 1024,
717
+ 256
718
+ ],
719
+ "dtype": "f16",
720
+ "dynamic": false
721
+ },
722
+ {
723
+ "name": "localValueCache",
724
+ "shape": [
725
+ 40,
726
+ 1,
727
+ 8,
728
+ 1024,
729
+ 256
730
+ ],
731
+ "dtype": "f16",
732
+ "dynamic": false
733
+ }
734
+ ],
735
+ "verify_c262144": [
736
+ {
737
+ "name": "keyCache",
738
+ "shape": [
739
+ 8,
740
+ 1,
741
+ 1,
742
+ 262144,
743
+ 512
744
+ ],
745
+ "dtype": "f16",
746
+ "dynamic": false
747
+ },
748
+ {
749
+ "name": "valueCache",
750
+ "shape": [
751
+ 8,
752
+ 1,
753
+ 1,
754
+ 262144,
755
+ 512
756
+ ],
757
+ "dtype": "f16",
758
+ "dynamic": false
759
+ },
760
+ {
761
+ "name": "localKeyCache",
762
+ "shape": [
763
+ 40,
764
+ 1,
765
+ 8,
766
+ 1024,
767
+ 256
768
+ ],
769
+ "dtype": "f16",
770
+ "dynamic": false
771
+ },
772
+ {
773
+ "name": "localValueCache",
774
+ "shape": [
775
+ 40,
776
+ 1,
777
+ 8,
778
+ 1024,
779
+ 256
780
+ ],
781
+ "dtype": "f16",
782
+ "dynamic": false
783
+ }
784
+ ]
785
+ },
786
+ "io_per_entrypoint": {
787
+ "main_c4096": {
788
+ "inputs": [
789
+ [
790
+ "1",
791
+ "1"
792
+ ],
793
+ [
794
+ "1",
795
+ "1"
796
+ ]
797
+ ],
798
+ "outputs": [
799
+ [],
800
+ [],
801
+ [],
802
+ [],
803
+ [
804
+ "1",
805
+ "1",
806
+ "262144"
807
+ ]
808
+ ],
809
+ "symbolic_extents": 0
810
+ },
811
+ "main_c8192": {
812
+ "inputs": [
813
+ [
814
+ "1",
815
+ "1"
816
+ ],
817
+ [
818
+ "1",
819
+ "1"
820
+ ]
821
+ ],
822
+ "outputs": [
823
+ [],
824
+ [],
825
+ [],
826
+ [],
827
+ [
828
+ "1",
829
+ "1",
830
+ "262144"
831
+ ]
832
+ ],
833
+ "symbolic_extents": 0
834
+ },
835
+ "main_c16384": {
836
+ "inputs": [
837
+ [
838
+ "1",
839
+ "1"
840
+ ],
841
+ [
842
+ "1",
843
+ "1"
844
+ ]
845
+ ],
846
+ "outputs": [
847
+ [],
848
+ [],
849
+ [],
850
+ [],
851
+ [
852
+ "1",
853
+ "1",
854
+ "262144"
855
+ ]
856
+ ],
857
+ "symbolic_extents": 0
858
+ },
859
+ "main_c32768": {
860
+ "inputs": [
861
+ [
862
+ "1",
863
+ "1"
864
+ ],
865
+ [
866
+ "1",
867
+ "1"
868
+ ]
869
+ ],
870
+ "outputs": [
871
+ [],
872
+ [],
873
+ [],
874
+ [],
875
+ [
876
+ "1",
877
+ "1",
878
+ "262144"
879
+ ]
880
+ ],
881
+ "symbolic_extents": 0
882
+ },
883
+ "main_c65536": {
884
+ "inputs": [
885
+ [
886
+ "1",
887
+ "1"
888
+ ],
889
+ [
890
+ "1",
891
+ "1"
892
+ ]
893
+ ],
894
+ "outputs": [
895
+ [],
896
+ [],
897
+ [],
898
+ [],
899
+ [
900
+ "1",
901
+ "1",
902
+ "262144"
903
+ ]
904
+ ],
905
+ "symbolic_extents": 0
906
+ },
907
+ "main_c131072": {
908
+ "inputs": [
909
+ [
910
+ "1",
911
+ "1"
912
+ ],
913
+ [
914
+ "1",
915
+ "1"
916
+ ]
917
+ ],
918
+ "outputs": [
919
+ [],
920
+ [],
921
+ [],
922
+ [],
923
+ [
924
+ "1",
925
+ "1",
926
+ "262144"
927
+ ]
928
+ ],
929
+ "symbolic_extents": 0
930
+ },
931
+ "main_c262144": {
932
+ "inputs": [
933
+ [
934
+ "1",
935
+ "1"
936
+ ],
937
+ [
938
+ "1",
939
+ "1"
940
+ ]
941
+ ],
942
+ "outputs": [
943
+ [],
944
+ [],
945
+ [],
946
+ [],
947
+ [
948
+ "1",
949
+ "1",
950
+ "262144"
951
+ ]
952
+ ],
953
+ "symbolic_extents": 0
954
+ },
955
+ "prefill_c4096": {
956
+ "inputs": [
957
+ [
958
+ "1",
959
+ "64"
960
+ ],
961
+ [
962
+ "1",
963
+ "64"
964
+ ]
965
+ ],
966
+ "outputs": [
967
+ [],
968
+ [],
969
+ [],
970
+ [],
971
+ [
972
+ "1",
973
+ "1",
974
+ "262144"
975
+ ]
976
+ ],
977
+ "symbolic_extents": 0
978
+ },
979
+ "prefill_c8192": {
980
+ "inputs": [
981
+ [
982
+ "1",
983
+ "64"
984
+ ],
985
+ [
986
+ "1",
987
+ "64"
988
+ ]
989
+ ],
990
+ "outputs": [
991
+ [],
992
+ [],
993
+ [],
994
+ [],
995
+ [
996
+ "1",
997
+ "1",
998
+ "262144"
999
+ ]
1000
+ ],
1001
+ "symbolic_extents": 0
1002
+ },
1003
+ "prefill_c16384": {
1004
+ "inputs": [
1005
+ [
1006
+ "1",
1007
+ "64"
1008
+ ],
1009
+ [
1010
+ "1",
1011
+ "64"
1012
+ ]
1013
+ ],
1014
+ "outputs": [
1015
+ [],
1016
+ [],
1017
+ [],
1018
+ [],
1019
+ [
1020
+ "1",
1021
+ "1",
1022
+ "262144"
1023
+ ]
1024
+ ],
1025
+ "symbolic_extents": 0
1026
+ },
1027
+ "prefill_c32768": {
1028
+ "inputs": [
1029
+ [
1030
+ "1",
1031
+ "64"
1032
+ ],
1033
+ [
1034
+ "1",
1035
+ "64"
1036
+ ]
1037
+ ],
1038
+ "outputs": [
1039
+ [],
1040
+ [],
1041
+ [],
1042
+ [],
1043
+ [
1044
+ "1",
1045
+ "1",
1046
+ "262144"
1047
+ ]
1048
+ ],
1049
+ "symbolic_extents": 0
1050
+ },
1051
+ "prefill_c65536": {
1052
+ "inputs": [
1053
+ [
1054
+ "1",
1055
+ "64"
1056
+ ],
1057
+ [
1058
+ "1",
1059
+ "64"
1060
+ ]
1061
+ ],
1062
+ "outputs": [
1063
+ [],
1064
+ [],
1065
+ [],
1066
+ [],
1067
+ [
1068
+ "1",
1069
+ "1",
1070
+ "262144"
1071
+ ]
1072
+ ],
1073
+ "symbolic_extents": 0
1074
+ },
1075
+ "prefill_c131072": {
1076
+ "inputs": [
1077
+ [
1078
+ "1",
1079
+ "64"
1080
+ ],
1081
+ [
1082
+ "1",
1083
+ "64"
1084
+ ]
1085
+ ],
1086
+ "outputs": [
1087
+ [],
1088
+ [],
1089
+ [],
1090
+ [],
1091
+ [
1092
+ "1",
1093
+ "1",
1094
+ "262144"
1095
+ ]
1096
+ ],
1097
+ "symbolic_extents": 0
1098
+ },
1099
+ "prefill_c262144": {
1100
+ "inputs": [
1101
+ [
1102
+ "1",
1103
+ "64"
1104
+ ],
1105
+ [
1106
+ "1",
1107
+ "64"
1108
+ ]
1109
+ ],
1110
+ "outputs": [
1111
+ [],
1112
+ [],
1113
+ [],
1114
+ [],
1115
+ [
1116
+ "1",
1117
+ "1",
1118
+ "262144"
1119
+ ]
1120
+ ],
1121
+ "symbolic_extents": 0
1122
+ },
1123
+ "verify_c262144": {
1124
+ "inputs": [
1125
+ [
1126
+ "1",
1127
+ "8"
1128
+ ],
1129
+ [
1130
+ "1",
1131
+ "8"
1132
+ ]
1133
+ ],
1134
+ "outputs": [
1135
+ [],
1136
+ [],
1137
+ [],
1138
+ [],
1139
+ [
1140
+ "1",
1141
+ "8",
1142
+ "262144"
1143
+ ]
1144
+ ],
1145
+ "symbolic_extents": 0
1146
+ }
1147
+ }
1148
+ }
tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/tokenizer/chat_template.jinja ADDED
@@ -0,0 +1,390 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {#
2
+ Template: Google Gemma 4 Canonical Chat Template
3
+ Author: Google Gemma Engineering Team
4
+ Published: 2026-07-09
5
+ Context: Fixed tool-calling loops, turn closures, and thinking content-ordering.
6
+ #}
7
+ {%- macro format_parameters(properties, required, filter_keys=false) -%}
8
+ {%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
9
+ {%- set ns = namespace(found_first=false) -%}
10
+ {%- for key, value in properties | dictsort -%}
11
+ {%- set add_comma = false -%}
12
+ {%- if not filter_keys or key not in standard_keys -%}
13
+ {%- if ns.found_first %},{% endif -%}
14
+ {%- set ns.found_first = true -%}
15
+ {{ key }}:{
16
+ {%- if value['description'] -%}
17
+ description:<|"|>{{ value['description'] }}<|"|>
18
+ {%- set add_comma = true -%}
19
+ {%- endif -%}
20
+ {%- if value['type'] | upper == 'STRING' -%}
21
+ {%- if value['enum'] -%}
22
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
23
+ enum:{{ format_argument(value['enum']) }}
24
+ {%- endif -%}
25
+ {%- elif value['type'] | upper == 'ARRAY' -%}
26
+ {%- if value['items'] is mapping and value['items'] -%}
27
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
28
+ items:{
29
+ {%- set ns_items = namespace(found_first=false) -%}
30
+ {%- for item_key, item_value in value['items'] | dictsort -%}
31
+ {%- if item_value is not none -%}
32
+ {%- if ns_items.found_first %},{% endif -%}
33
+ {%- set ns_items.found_first = true -%}
34
+ {%- if item_key == 'properties' -%}
35
+ properties:{
36
+ {%- if item_value is mapping -%}
37
+ {{- format_parameters(item_value, value['items']['required'] | default([])) -}}
38
+ {%- endif -%}
39
+ }
40
+ {%- elif item_key == 'required' -%}
41
+ required:[
42
+ {%- for req_item in item_value -%}
43
+ <|"|>{{- req_item -}}<|"|>
44
+ {%- if not loop.last %},{% endif -%}
45
+ {%- endfor -%}
46
+ ]
47
+ {%- elif item_key == 'type' -%}
48
+ {%- if item_value is string -%}
49
+ type:{{ format_argument(item_value | upper) }}
50
+ {%- else -%}
51
+ type:{{ format_argument(item_value | map('upper') | list) }}
52
+ {%- endif -%}
53
+ {%- else -%}
54
+ {{ item_key }}:{{ format_argument(item_value) }}
55
+ {%- endif -%}
56
+ {%- endif -%}
57
+ {%- endfor -%}
58
+ }
59
+ {%- endif -%}
60
+ {%- endif -%}
61
+ {%- if value['nullable'] %}
62
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
63
+ nullable:true
64
+ {%- endif -%}
65
+ {%- if value['type'] | upper == 'OBJECT' -%}
66
+ {%- if value['properties'] is defined and value['properties'] is mapping -%}
67
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
68
+ properties:{
69
+ {{- format_parameters(value['properties'], value['required'] | default([])) -}}
70
+ }
71
+ {%- elif value is mapping -%}
72
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
73
+ properties:{
74
+ {{- format_parameters(value, value['required'] | default([]), filter_keys=true) -}}
75
+ }
76
+ {%- endif -%}
77
+ {%- if value['required'] -%}
78
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
79
+ required:[
80
+ {%- for item in value['required'] | default([]) -%}
81
+ <|"|>{{- item -}}<|"|>
82
+ {%- if not loop.last %},{% endif -%}
83
+ {%- endfor -%}
84
+ ]
85
+ {%- endif -%}
86
+ {%- endif -%}
87
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
88
+ type:<|"|>{{ value['type'] | upper }}<|"|>}
89
+ {%- endif -%}
90
+ {%- endfor -%}
91
+ {%- endmacro -%}
92
+ {%- macro format_function_declaration(tool_data) -%}
93
+ declaration:{{- tool_data['function']['name'] -}}{description:<|"|>{{- tool_data['function']['description'] -}}<|"|>
94
+ {%- set params = tool_data['function']['parameters'] -%}
95
+ {%- if params -%}
96
+ ,parameters:{
97
+ {%- if params['properties'] -%}
98
+ properties:{ {{- format_parameters(params['properties'], params['required']) -}} },
99
+ {%- endif -%}
100
+ {%- if params['required'] -%}
101
+ required:[
102
+ {%- for item in params['required'] -%}
103
+ <|"|>{{- item -}}<|"|>
104
+ {{- ',' if not loop.last -}}
105
+ {%- endfor -%}
106
+ ],
107
+ {%- endif -%}
108
+ {%- if params['type'] -%}
109
+ type:<|"|>{{- params['type'] | upper -}}<|"|>}
110
+ {%- endif -%}
111
+ {%- endif -%}
112
+ {%- if 'response' in tool_data['function'] -%}
113
+ {%- set response_declaration = tool_data['function']['response'] -%}
114
+ ,response:{
115
+ {%- if response_declaration['description'] -%}
116
+ description:<|"|>{{- response_declaration['description'] -}}<|"|>,
117
+ {%- endif -%}
118
+ {%- if response_declaration['type'] | upper == 'OBJECT' -%}
119
+ type:<|"|>{{- response_declaration['type'] | upper -}}<|"|>}
120
+ {%- endif -%}
121
+ {%- endif -%}
122
+ }
123
+ {%- endmacro -%}
124
+ {%- macro format_argument(argument, escape_keys=True) -%}
125
+ {%- if argument is none -%}
126
+ {{- 'null' -}}
127
+ {%- elif argument is string -%}
128
+ {{- '<|"|>' + argument + '<|"|>' -}}
129
+ {%- elif argument is boolean -%}
130
+ {{- 'true' if argument else 'false' -}}
131
+ {%- elif argument is mapping -%}
132
+ {{- '{' -}}
133
+ {%- set ns = namespace(found_first=false) -%}
134
+ {%- for key, value in argument | dictsort -%}
135
+ {%- if ns.found_first %},{% endif -%}
136
+ {%- set ns.found_first = true -%}
137
+ {%- if escape_keys -%}
138
+ {{- '<|"|>' + key + '<|"|>' -}}
139
+ {%- else -%}
140
+ {{- key -}}
141
+ {%- endif -%}
142
+ :{{- format_argument(value, escape_keys=escape_keys) -}}
143
+ {%- endfor -%}
144
+ {{- '}' -}}
145
+ {%- elif argument is sequence -%}
146
+ {{- '[' -}}
147
+ {%- for item in argument -%}
148
+ {{- format_argument(item, escape_keys=escape_keys) -}}
149
+ {%- if not loop.last %},{% endif -%}
150
+ {%- endfor -%}
151
+ {{- ']' -}}
152
+ {%- else -%}
153
+ {{- argument -}}
154
+ {%- endif -%}
155
+ {%- endmacro -%}
156
+ {%- macro strip_thinking(text) -%}
157
+ {%- set ns = namespace(result='') -%}
158
+ {%- for part in text.split('<channel|>') -%}
159
+ {%- if '<|channel>' in part -%}
160
+ {%- set ns.result = ns.result + part.split('<|channel>')[0] -%}
161
+ {%- else -%}
162
+ {%- set ns.result = ns.result + part -%}
163
+ {%- endif -%}
164
+ {%- endfor -%}
165
+ {{- ns.result | trim -}}
166
+ {%- endmacro -%}
167
+
168
+ {%- macro format_tool_response_block(tool_name, response) -%}
169
+ {{- '<|tool_response>' -}}
170
+ {%- if response is mapping -%}
171
+ {{- 'response:' + tool_name + '{' -}}
172
+ {%- for key, value in response | dictsort -%}
173
+ {{- key -}}:{{- format_argument(value, escape_keys=False) -}}
174
+ {%- if not loop.last %},{% endif -%}
175
+ {%- endfor -%}
176
+ {{- '}' -}}
177
+ {%- else -%}
178
+ {{- 'response:' + tool_name + '{value:' + format_argument(response, escape_keys=False) + '}' -}}
179
+ {%- endif -%}
180
+ {{- '<tool_response|>' -}}
181
+ {%- endmacro -%}
182
+
183
+ {#- ===== SETUP ===== -#}
184
+ {%- set ns = namespace(prev_message_type=None, prev_non_tool_role=None) -%}
185
+ {%- set loop_messages = messages -%}
186
+ {%- set enable_thinking = enable_thinking | default(false) -%}
187
+ {%- set preserve_thinking = preserve_thinking | default(false) -%}
188
+ {{- bos_token -}}
189
+ {#- Handle System/Tool Definitions Block -#}
190
+ {%- if enable_thinking or tools or (messages and messages[0]['role'] in ['system', 'developer']) -%}
191
+ {{- '<|turn>system\n' -}}
192
+ {#- Inject Thinking token at the very top of the FIRST system turn -#}
193
+ {%- if enable_thinking -%}
194
+ {{- '<|think|>\n' -}}
195
+ {%- set ns.prev_message_type = 'think' -%}
196
+ {%- endif -%}
197
+ {%- if messages and messages[0]['role'] in ['system', 'developer'] -%}
198
+ {%- if messages[0]['content'] is string -%}
199
+ {{- messages[0]['content'] | trim -}}
200
+ {%- elif messages[0]['content'] is sequence -%}
201
+ {%- for item in messages[0]['content'] -%}
202
+ {{- item['text'] | trim + ' '-}}
203
+ {%- endfor -%}
204
+ {%- endif -%}
205
+ {%- set loop_messages = messages[1:] -%}
206
+ {%- endif -%}
207
+ {%- if tools -%}
208
+ {%- for tool in tools %}
209
+ {{- '<|tool>' -}}
210
+ {{- format_function_declaration(tool) | trim -}}
211
+ {{- '<tool|>' -}}
212
+ {%- endfor %}
213
+ {%- set ns.prev_message_type = 'tool' -%}
214
+ {%- endif -%}
215
+ {{- '<turn|>\n' -}}
216
+ {%- endif %}
217
+
218
+ {#- Pre-scan: find last user message index for reasoning guard -#}
219
+ {%- set ns_turn = namespace(last_user_idx=-1) -%}
220
+ {%- for i in range(loop_messages | length) -%}
221
+ {%- if loop_messages[i]['role'] == 'user' -%}
222
+ {%- set ns_turn.last_user_idx = i -%}
223
+ {%- endif -%}
224
+ {%- endfor -%}
225
+
226
+ {#- Loop through messages -#}
227
+ {%- for message in loop_messages -%}
228
+ {%- if message['role'] != 'tool' -%}
229
+ {%- set ns.prev_message_type = None -%}
230
+ {%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%}
231
+ {#- Detect continuation using tracked state — O(1) instead of O(n) backward scan -#}
232
+ {%- set continue_same_model_turn = (role == 'model' and ns.prev_non_tool_role == 'assistant') -%}
233
+ {%- if not continue_same_model_turn -%}
234
+ {{- '<|turn>' + role + '\n' }}
235
+
236
+ {%- endif -%}
237
+
238
+ {#- Render reasoning/reasoning_content as thinking channel -#}
239
+ {%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%}
240
+ {%- set thinking_gate = (loop.index0 > ns_turn.last_user_idx) or (preserve_thinking and message.get('tool_calls')) -%}
241
+ {%- if thinking_text and thinking_gate -%}
242
+ {{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
243
+ {%- endif -%}
244
+
245
+ {%- if message.get('tool_calls') -%}
246
+ {%- for tool_call in message.get('tool_calls') -%}
247
+ {%- set function = tool_call['function'] -%}
248
+ {{- '<|tool_call>call:' + function['name'] + '{' -}}
249
+ {%- if function['arguments'] is mapping -%}
250
+ {%- set ns_args = namespace(found_first=false) -%}
251
+ {%- for key, value in function['arguments'] | dictsort -%}
252
+ {%- if ns_args.found_first %},{% endif -%}
253
+ {%- set ns_args.found_first = true -%}
254
+ {{- key -}}:{{- format_argument(value, escape_keys=False) -}}
255
+ {%- endfor -%}
256
+ {%- elif function['arguments'] is none -%}
257
+ {%- else -%}
258
+ {{- raise_exception(
259
+ "chat_template: tool_calls[].function.arguments must be a "
260
+ "JSON object (mapping), not a string. Deserialize arguments "
261
+ "before passing to the template."
262
+ ) -}}
263
+ {%- endif -%}
264
+ {{- '}<tool_call|>' -}}
265
+ {%- endfor -%}
266
+ {%- set ns.prev_message_type = 'tool_call' -%}
267
+ {%- endif -%}
268
+
269
+ {%- set ns_tr_out = namespace(flag=false) -%}
270
+ {%- if message.get('tool_responses') -%}
271
+ {#- Legacy: tool_responses embedded on the assistant message (Google/Gemma native) -#}
272
+ {%- for tool_response in message.get('tool_responses') -%}
273
+ {{- format_tool_response_block(tool_response['name'] | default('unknown', true), tool_response['response']) -}}
274
+ {%- set ns_tr_out.flag = true -%}
275
+ {%- set ns.prev_message_type = 'tool_response' -%}
276
+ {%- endfor -%}
277
+ {%- elif message.get('tool_calls') -%}
278
+ {#- OpenAI Chat Completions: forward-scan consecutive role:tool messages -#}
279
+ {%- set ns_tool_scan = namespace(stopped=false) -%}
280
+ {%- for k in range(loop.index0 + 1, loop_messages | length) -%}
281
+ {%- if ns_tool_scan.stopped -%}
282
+ {%- elif loop_messages[k]['role'] != 'tool' -%}
283
+ {%- set ns_tool_scan.stopped = true -%}
284
+ {%- else -%}
285
+ {%- set follow = loop_messages[k] -%}
286
+ {#- Resolve tool_call_id to function name -#}
287
+ {%- set ns_tname = namespace(name=follow.get('name') or 'unknown') -%}
288
+ {%- for tc in message.get('tool_calls') -%}
289
+ {%- if tc.get('id') == follow.get('tool_call_id') -%}
290
+ {%- set ns_tname.name = tc['function']['name'] -%}
291
+ {%- endif -%}
292
+ {%- endfor -%}
293
+ {#- Handle content as string or content-parts array -#}
294
+ {%- set tool_body = follow.get('content') -%}
295
+ {%- if tool_body is string -%}
296
+ {{- format_tool_response_block(ns_tname.name, tool_body) -}}
297
+ {%- elif tool_body is sequence and tool_body is not string -%}
298
+ {%- set ns_txt = namespace(s='') -%}
299
+ {%- for part in tool_body -%}
300
+ {%- if part.get('type') == 'text' -%}
301
+ {%- set ns_txt.s = ns_txt.s + (part.get('text') | default('')) -%}
302
+ {%- endif -%}
303
+ {%- endfor -%}
304
+ {{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
305
+ {%- for part in tool_body -%}
306
+ {%- if part.get('type') in ['image', 'image_url'] -%}
307
+ {{- '<|image|>' -}}
308
+ {%- elif part.get('type') in ['audio', 'input_audio'] -%}
309
+ {{- '<|audio|>' -}}
310
+ {%- elif part.get('type') == 'video' -%}
311
+ {{- '<|video|>' -}}
312
+ {%- endif -%}
313
+ {%- endfor -%}
314
+ {%- else -%}
315
+ {{- format_tool_response_block(ns_tname.name, tool_body) -}}
316
+ {%- endif -%}
317
+ {%- set ns_tr_out.flag = true -%}
318
+ {%- set ns.prev_message_type = 'tool_response' -%}
319
+ {%- endif -%}
320
+ {%- endfor -%}
321
+ {%- endif -%}
322
+
323
+ {%- set captured_content -%}
324
+ {%- if message.get('content') is string -%}
325
+ {%- if role == 'model' -%}
326
+ {{- strip_thinking(message['content']) -}}
327
+ {%- else -%}
328
+ {{- message['content'] | trim -}}
329
+ {%- endif -%}
330
+ {%- elif message.get('content') is sequence -%}
331
+ {%- for item in message['content'] -%}
332
+ {%- if item.get('type') == 'text' -%}
333
+ {%- if role == 'model' -%}
334
+ {{- strip_thinking(item['text']) -}}
335
+ {%- else -%}
336
+ {{- item['text'] | trim -}}
337
+ {%- endif -%}
338
+ {%- elif item.get('type') in ['image', 'image_url'] -%}
339
+ {{- '<|image|>' -}}
340
+ {%- elif item.get('type') in ['audio', 'input_audio'] -%}
341
+ {{- '<|audio|>' -}}
342
+ {%- elif item.get('type') == 'video' -%}
343
+ {{- '<|video|>' -}}
344
+ {%- endif -%}
345
+ {%- endfor -%}
346
+ {%- endif -%}
347
+ {%- endset -%}
348
+
349
+ {{- captured_content -}}
350
+ {%- set has_content = captured_content | trim | length > 0 -%}
351
+
352
+ {#- Forward-scan: find next non-tool message role for continuation detection -#}
353
+ {%- set next_nt = namespace(role=None, found=false) -%}
354
+ {%- for j in range(loop.index0 + 1, loop_messages | length) -%}
355
+ {%- if not next_nt.found -%}
356
+ {%- if loop_messages[j]['role'] != 'tool' -%}
357
+ {%- set next_nt.role = loop_messages[j]['role'] -%}
358
+ {%- set next_nt.found = true -%}
359
+ {%- endif -%}
360
+ {%- endif -%}
361
+ {%- endfor -%}
362
+
363
+ {%- set continues_into_next = (
364
+ role == 'model'
365
+ and next_nt.role == 'assistant'
366
+ and (not message.get('tool_calls') or ns_tr_out.flag)
367
+ ) -%}
368
+
369
+ {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
370
+ {{- '<|tool_response>' -}}
371
+ {%- elif continues_into_next -%}
372
+ {%- elif not (ns_tr_out.flag and not has_content and not next_nt.found) -%}
373
+ {{- '<turn|>\n' -}}
374
+ {%- endif -%}
375
+
376
+ {#- Track previous non-tool role for next iteration (avoids O(n) backward scan) -#}
377
+ {%- set ns.prev_non_tool_role = message['role'] -%}
378
+ {%- endif -%}
379
+ {%- endfor -%}
380
+
381
+ {%- if add_generation_prompt -%}
382
+ {%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
383
+ {{- '<|turn>model\n' -}}
384
+ {%- if not enable_thinking -%}
385
+ {{- '<|channel>thought\n<channel|>' -}}
386
+ {%- endif -%}
387
+ {%- elif ns.prev_message_type == 'tool_response' and enable_thinking -%}
388
+ {{- '<|channel>thought\n' -}}
389
+ {%- endif -%}
390
+ {%- endif -%}
tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/tokenizer/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc8d3a0ce36466ccc1278bf987df5f71db1719b9ca6b4118264f45cb627bfe0f
3
+ size 32169626
tiered-v3/gemma4_12b_qat_decode_int4linsym_hf16_msdpa_g8_wkv_stable_pf64_tiered_c4k_c8k_c16k_c32k_c64k_c128k_c256k/tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "audio_token": "<|audio|>",
3
+ "backend": "tokenizers",
4
+ "boa_token": "<|audio>",
5
+ "boi_token": "<|image>",
6
+ "bos_token": "<bos>",
7
+ "eoa_token": "<audio|>",
8
+ "eoc_token": "<channel|>",
9
+ "eoi_token": "<image|>",
10
+ "eos_token": "<turn|>",
11
+ "eot_token": "<turn|>",
12
+ "escape_token": "<|\"|>",
13
+ "etc_token": "<tool_call|>",
14
+ "etd_token": "<tool|>",
15
+ "etr_token": "<tool_response|>",
16
+ "extra_special_tokens": [
17
+ "<|video|>"
18
+ ],
19
+ "image_token": "<|image|>",
20
+ "mask_token": "<mask>",
21
+ "model_max_length": 1000000000000000019884624838656,
22
+ "pad_token": "<pad>",
23
+ "padding_side": "left",
24
+ "processor_class": "Gemma4UnifiedProcessor",
25
+ "response_schema": {
26
+ "properties": {
27
+ "content": {
28
+ "type": "string"
29
+ },
30
+ "role": {
31
+ "const": "assistant"
32
+ },
33
+ "thinking": {
34
+ "type": "string"
35
+ },
36
+ "tool_calls": {
37
+ "items": {
38
+ "properties": {
39
+ "function": {
40
+ "properties": {
41
+ "arguments": {
42
+ "additionalProperties": {},
43
+ "type": "object",
44
+ "x-parser": "gemma4-tool-call"
45
+ },
46
+ "name": {
47
+ "type": "string"
48
+ }
49
+ },
50
+ "type": "object",
51
+ "x-regex": "call\\:(?P<name>\\w+)(?P<arguments>\\{.*\\})"
52
+ },
53
+ "type": {
54
+ "const": "function"
55
+ }
56
+ },
57
+ "type": "object"
58
+ },
59
+ "type": "array",
60
+ "x-regex-iterator": "<\\|tool_call>(.*?)<tool_call\\|>"
61
+ }
62
+ },
63
+ "type": "object",
64
+ "x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?P<content>(?:(?!\\<turn\\|\\>)(?!\\<\\|tool_response\\>).)+)?(?:\\<turn\\|\\>|\\<\\|tool_response\\>)?"
65
+ },
66
+ "response_template": {
67
+ "defaults": {
68
+ "role": "assistant"
69
+ },
70
+ "fields": {
71
+ "content": {
72
+ "close": [
73
+ "<turn|>",
74
+ "<|tool_response>",
75
+ "<eos>"
76
+ ],
77
+ "content": "text"
78
+ },
79
+ "thinking": {
80
+ "close": "<channel|>",
81
+ "content": "text",
82
+ "open": "<|channel>thought\n"
83
+ },
84
+ "tool_calls": {
85
+ "close": "<tool_call|>",
86
+ "content": "json",
87
+ "content_args": {
88
+ "string_delims": [
89
+ [
90
+ "<|\"|>",
91
+ "<|\"|>"
92
+ ]
93
+ ],
94
+ "unquoted_keys": true
95
+ },
96
+ "open_pattern": "<\\|tool_call>call:(?P<name>\\w+)",
97
+ "repeats": true,
98
+ "transform": {
99
+ "function": {
100
+ "arguments": "{content}",
101
+ "name": "{name}"
102
+ },
103
+ "type": "function"
104
+ }
105
+ }
106
+ },
107
+ "start_anchor": [
108
+ "<|turn>model\n",
109
+ "<tool_response|>"
110
+ ]
111
+ },
112
+ "soc_token": "<|channel>",
113
+ "sot_token": "<|turn>",
114
+ "stc_token": "<|tool_call>",
115
+ "std_token": "<|tool>",
116
+ "str_token": "<|tool_response>",
117
+ "think_token": "<|think|>",
118
+ "tokenizer_class": "GemmaTokenizer",
119
+ "unk_token": "<unk>"
120
+ }