{
  "id": "litert/gemma-4-e2b-it",
  "runtime": {
    "modelType": "gemma4",
    "architecture": {
      "numLayers": 35,
      "hiddenSize": 1536,
      "intermediateSize": 6144,
      "numAttentionHeads": 8,
      "numKeyValueHeads": 1,
      "headDim": 256,
      "vocabSize": 262144,
      "maxSeqLen": 131072,
      "linearNumKeyHeads": null,
      "linearNumValueHeads": null,
      "linearKeyHeadDim": null,
      "linearValueHeadDim": null,
      "linearConvKernelDim": null,
      "hiddenSizePerLayerInput": 256,
      "vocabSizePerLayerInput": 262144,
      "globalHeadDim": 512,
      "numKvSharedLayers": 20
    },
    "rawConfig": {
      "architectures": [
        "Gemma4ForConditionalGeneration"
      ],
      "model_type": "gemma4",
      "text_config": {
        "architectures": [
          "Gemma4ForCausalLM"
        ],
        "model_type": "gemma4_text"
      },
      "eos_token_id": [
        1,
        106,
        50
      ],
      "image_token_id": 258880,
      "audio_token_id": 258881,
      "video_token_id": 258884,
      "vision_config": {
        "model_type": "gemma4_vision",
        "vision_architecture": "gemma4",
        "hidden_size": 768,
        "num_attention_heads": 12,
        "num_hidden_layers": 16,
        "num_key_value_heads": 12,
        "head_dim": 64,
        "intermediate_size": 3072,
        "patch_size": 16,
        "pooling_kernel_size": 3,
        "position_embedding_size": 10240,
        "default_output_length": 280,
        "rms_norm_eps": 0.000001,
        "hidden_activation": "gelu_pytorch_tanh",
        "use_clipped_linears": true,
        "standardize": false,
        "rope_parameters": {
          "rope_theta": 100
        }
      },
      "audio_config": {
        "model_type": "gemma4_audio",
        "audio_architecture": "gemma4",
        "num_hidden_layers": 12,
        "hidden_size": 1024,
        "num_attention_heads": 8,
        "conv_kernel_size": 5,
        "subsampling_conv_channels": [
          128,
          32
        ],
        "output_proj_dims": 1536,
        "attention_context_left": 13,
        "attention_context_right": 0,
        "attention_chunk_size": 12,
        "attention_logit_cap": 50,
        "attention_invalid_logits_value": -1000000000,
        "residual_weight": 0.5,
        "rms_norm_eps": 0.000001,
        "hidden_act": "silu",
        "use_clipped_linears": true
      }
    },
    "manifestConfig": {
      "visionConfig": {
        "vision_architecture": "gemma4",
        "hidden_size": 768,
        "num_attention_heads": 12,
        "num_hidden_layers": 16,
        "num_key_value_heads": 12,
        "head_dim": 64,
        "intermediate_size": 3072,
        "patch_size": 16,
        "pooling_kernel_size": 3,
        "position_embedding_size": 10240,
        "default_output_length": 280,
        "rms_norm_eps": 0.000001,
        "hidden_activation": "gelu_pytorch_tanh",
        "use_clipped_linears": true,
        "standardize": false,
        "rope_parameters": {
          "rope_theta": 100
        }
      },
      "audioConfig": {
        "audio_architecture": "gemma4",
        "num_hidden_layers": 12,
        "hidden_size": 1024,
        "num_attention_heads": 8,
        "conv_kernel_size": 5,
        "subsampling_conv_channels": [
          128,
          32
        ],
        "output_proj_dims": 1536,
        "attention_context_left": 13,
        "attention_context_right": 0,
        "attention_chunk_size": 12,
        "attention_logit_cap": 50,
        "attention_invalid_logits_value": -1000000000,
        "residual_weight": 0.5,
        "rms_norm_eps": 0.000001,
        "hidden_act": "silu",
        "use_clipped_linears": true
      }
    },
    "manifestInference": {
      "schema": "doppler.execution/v1",
      "attention": {
        "queryPreAttnScalar": 1,
        "attnLogitSoftcapping": null,
        "slidingWindow": 512,
        "queryKeyNorm": true,
        "valueNorm": true,
        "causal": true,
        "attentionBias": false,
        "attentionOutputGate": false
      },
      "normalization": {
        "rmsNormEps": 0.000001,
        "rmsNormWeightOffset": false,
        "postAttentionNorm": true,
        "preFeedforwardNorm": true,
        "postFeedforwardNorm": true
      },
      "ffn": {
        "activation": "gelu",
        "gatedActivation": true,
        "branchMode": "auto",
        "useDoubleWideMlp": true,
        "swigluLimit": null
      },
      "rope": {
        "ropeTheta": 1000000,
        "ropeLocalTheta": 10000,
        "ropeInterleaved": false,
        "mropeInterleaved": false,
        "mropeSection": null,
        "partialRotaryFactor": 0.25,
        "ropeLocalPartialRotaryFactor": null,
        "ropeFrequencyBaseDim": 512,
        "ropeLocalFrequencyBaseDim": null,
        "ropeScalingType": null,
        "ropeScalingFactor": 1,
        "ropeLocalScalingType": null,
        "ropeLocalScalingFactor": 1,
        "yarnBetaFast": null,
        "yarnBetaSlow": null,
        "yarnOriginalMaxPos": null,
        "ropeLocalYarnBetaFast": null,
        "ropeLocalYarnBetaSlow": null,
        "ropeLocalYarnOriginalMaxPos": null
      },
      "output": {
        "finalLogitSoftcapping": 30,
        "tieWordEmbeddings": true,
        "scaleEmbeddings": true,
        "embeddingTranspose": false,
        "embeddingVocabSize": null,
        "embeddingPostprocessor": null
      },
      "layerPattern": {
        "type": "every_n",
        "globalPattern": null,
        "period": 5,
        "offset": 4,
        "layerTypes": null
      },
      "chatTemplate": {
        "type": "gemma4",
        "enabled": true
      },
      "pipeline": null,
      "session": {
        "compute": {
          "defaults": {
            "activationDtype": "f32",
            "mathDtype": "f32",
            "accumDtype": "f32",
            "outputDtype": "f32"
          }
        },
        "kvcache": {
          "kvDtype": "f16",
          "layout": "contiguous",
          "pageSize": 256,
          "tiering": {
            "mode": "off",
            "hotWindow": 1024,
            "coldPageSize": 256,
            "coldDtype": "f16",
            "compression": {
              "mode": "none",
              "blockSize": 1,
              "bitWidth": 4,
              "prodMode": false
            },
            "gating": {
              "mode": "auto",
              "minAluBwRatio": 0
            }
          },
          "quantization": {
            "mode": "none",
            "bitWidth": 4,
            "prodMode": false
          }
        },
        "decodeLoop": {
          "batchSize": 8,
          "stopCheckMode": "batch",
          "readbackInterval": 8,
          "readbackMode": "overlapped",
          "ringTokens": 2,
          "ringStop": 1,
          "ringStaging": 2,
          "disableCommandBatching": false
        },
        "perLayerInputs": {
          "materialization": "range_backed",
          "rowCache": {
            "mode": "lru",
            "maxRows": 512,
            "maxBytes": 268435456,
            "decodedDtype": "f32"
          },
          "prefetch": {
            "mode": "next_token",
            "rowsAhead": 1
          },
          "gpuUpload": {
            "mode": "per_step_slices",
            "stagingRows": 2
          },
          "hotCache": {
            "mode": "prepared_tokens",
            "maxTokens": 4096,
            "maxBytes": 268435456,
            "outputDtype": "f32"
          }
        }
      },
      "execution": {
        "kernels": {
          "embed": {
            "kernel": "gather_split8_f16_vec4_f32_out.wgsl",
            "entry": "gather_vec4_f32_out",
            "digest": "sha256:bc88d2106f80121ccb1f91f1ee0980173fe88bec5fe04cc941bdbc59b28e8ae1"
          },
          "rmsnorm": {
            "kernel": "rmsnorm.wgsl",
            "entry": "main",
            "digest": "sha256:4f4d144735bdff86b8567346ba7ea7b82fe68a2ac9656ba1577106158af9bc7c"
          },
          "final_norm_stable": {
            "kernel": "rmsnorm.wgsl",
            "entry": "main",
            "digest": "sha256:4f4d144735bdff86b8567346ba7ea7b82fe68a2ac9656ba1577106158af9bc7c",
            "precision": {
              "inputDtype": "f32",
              "outputDtype": "f32"
            }
          },
          "gemv": {
            "kernel": "matmul_gemv_subgroup.wgsl",
            "entry": "main_vec4",
            "digest": "sha256:2ea9aea659367210fbf61d922c0d4ee17cdac68ffb506b3bc5516e498071e011"
          },
          "rope": {
            "kernel": "rope.wgsl",
            "entry": "main",
            "digest": "sha256:923f9a96c941aee94119ecf04fa5b1508c77b7d927a7e6044ce6588b2d51a416"
          },
          "attn_decode": {
            "kernel": "attention_decode_online_f16kv.wgsl",
            "entry": "main",
            "digest": "sha256:c6d9f8c614a2a088cb533958007896391efb3e348377dc8095c409944c562912",
            "precision": {
              "kvDtype": "f16"
            }
          },
          "residual": {
            "kernel": "residual.wgsl",
            "entry": "main",
            "digest": "sha256:4dbfb0a9ca0fb6047a01618f0374b445c243774d039407acdf41b0711ea8eaf4"
          },
          "gelu": {
            "kernel": "gelu.wgsl",
            "entry": "main",
            "digest": "sha256:db864455ec72070d7d8729c8744e2eac377a4939a9bc2ecb26eb086d866e16b0",
            "constants": {
              "HAS_GATE": true
            }
          },
          "tiled": {
            "kernel": "matmul_f16w_f32a.wgsl",
            "entry": "main",
            "digest": "sha256:027a8f1cd9713cbe0b0ada160bd175e0542bb90896ad85441b023522d9a1befc"
          },
          "attn_stream": {
            "kernel": "attention_streaming_f16kv.wgsl",
            "entry": "main",
            "digest": "sha256:c3ec920699a81ee6df04a64eb0ea2477bec168ebb809af29f2d4b0924a4bdf8f",
            "precision": {
              "kvDtype": "f16"
            }
          },
          "attn_small": {
            "kernel": "attention_small_f16kv.wgsl",
            "entry": "main",
            "digest": "sha256:ad3bb913c17167eb28fefc6abd24602ea0f148bc22a2b5f437eeffcc6f7fc668",
            "precision": {
              "kvDtype": "f16"
            }
          },
          "lm_head_gemv": {
            "kernel": "matmul_gemv_subgroup.wgsl",
            "entry": "main_multicol",
            "digest": "sha256:e41f94574d5ac54dd2710036da5d5acc643a483b79b2d74b86825efdaaa7438f",
            "constants": {
              "MULTICOL_COLS_PER_WG": 64,
              "MULTICOL_THREADS_PER_COL": 4
            }
          },
          "lm_head_gemv_stable": {
            "kernel": "matmul_gemv_subgroup.wgsl",
            "entry": "main_multicol",
            "digest": "sha256:e41f94574d5ac54dd2710036da5d5acc643a483b79b2d74b86825efdaaa7438f",
            "constants": {
              "MULTICOL_COLS_PER_WG": 64,
              "MULTICOL_THREADS_PER_COL": 4
            },
            "precision": {
              "inputDtype": "f32",
              "outputDtype": "f32"
            }
          },
          "lm_head_prefill_stable": {
            "kernel": "matmul_f16w_f32a.wgsl",
            "entry": "main",
            "digest": "sha256:027a8f1cd9713cbe0b0ada160bd175e0542bb90896ad85441b023522d9a1befc",
            "precision": {
              "inputDtype": "f32",
              "outputDtype": "f32"
            }
          },
          "sample": {
            "kernel": "sample.wgsl",
            "entry": "sample_single_pass",
            "digest": "sha256:f2377b2a58c2eeb695a6f6f7ad877630bdba5e74d5dc1a8d919cd73b360d4870"
          }
        },
        "preLayer": [
          [
            "embed",
            "embed",
            "embed_tokens"
          ]
        ],
        "decode": [
          [
            "input_norm",
            "rmsnorm"
          ],
          [
            "q_proj",
            "gemv",
            "layer.{L}.self_attn.q_proj"
          ],
          [
            "k_proj",
            "gemv",
            "layer.{L}.self_attn.k_proj"
          ],
          [
            "v_proj",
            "gemv",
            "layer.{L}.self_attn.v_proj"
          ],
          [
            "rope_q",
            "rope"
          ],
          [
            "rope_k",
            "rope"
          ],
          [
            "attention",
            "attn_decode"
          ],
          [
            "o_proj",
            "gemv",
            "layer.{L}.self_attn.o_proj"
          ],
          [
            "attn_residual",
            "residual"
          ],
          [
            "post_attn_norm",
            "rmsnorm"
          ],
          [
            "ffn",
            "gelu"
          ],
          [
            "ffn_residual",
            "residual"
          ]
        ],
        "prefill": [
          {
            "layers": [
              0,
              1,
              2,
              3,
              5,
              6,
              7,
              8,
              10,
              11,
              12,
              13,
              15,
              16,
              17,
              18,
              20,
              21,
              22,
              23,
              25,
              26,
              27,
              28,
              30,
              31,
              32,
              33
            ],
            "steps": [
              [
                "input_norm",
                "rmsnorm"
              ],
              [
                "q_proj",
                "tiled",
                "layer.{L}.self_attn.q_proj"
              ],
              [
                "k_proj",
                "tiled",
                "layer.{L}.self_attn.k_proj"
              ],
              [
                "v_proj",
                "tiled",
                "layer.{L}.self_attn.v_proj"
              ],
              [
                "rope_q",
                "rope"
              ],
              [
                "rope_k",
                "rope"
              ],
              [
                "attention",
                "attn_small"
              ],
              [
                "o_proj",
                "tiled",
                "layer.{L}.self_attn.o_proj"
              ],
              [
                "attn_residual",
                "residual"
              ],
              [
                "post_attn_norm",
                "rmsnorm"
              ],
              [
                "ffn",
                "gelu"
              ],
              [
                "ffn_residual",
                "residual"
              ]
            ]
          },
          {
            "layers": [
              4,
              9,
              14,
              19,
              24,
              29,
              34
            ],
            "steps": [
              [
                "input_norm",
                "rmsnorm"
              ],
              [
                "q_proj",
                "tiled",
                "layer.{L}.self_attn.q_proj"
              ],
              [
                "k_proj",
                "tiled",
                "layer.{L}.self_attn.k_proj"
              ],
              [
                "v_proj",
                "tiled",
                "layer.{L}.self_attn.v_proj"
              ],
              [
                "rope_q",
                "rope"
              ],
              [
                "rope_k",
                "rope"
              ],
              [
                "attention",
                "attn_stream"
              ],
              [
                "o_proj",
                "tiled",
                "layer.{L}.self_attn.o_proj"
              ],
              [
                "attn_residual",
                "residual"
              ],
              [
                "post_attn_norm",
                "rmsnorm"
              ],
              [
                "ffn",
                "gelu"
              ],
              [
                "ffn_residual",
                "residual"
              ]
            ]
          }
        ],
        "postLayer": [
          [
            "final_norm",
            "final_norm_stable"
          ],
          [
            "lm_head",
            "lm_head_gemv_stable",
            "lm_head"
          ],
          [
            "lm_head_prefill",
            "lm_head_prefill_stable",
            "lm_head"
          ],
          [
            "sample",
            "sample"
          ]
        ],
        "policies": {
          "unsupportedPrecision": "error",
          "dtypeTransition": "require_cast_step",
          "unresolvedKernel": "error"
        }
      }
    },
    "tokenizer": {
      "task": {
        "sentencepieceModel": "TOKENIZER_MODEL",
        "vocabSize": 262144,
        "padTokenId": 0,
        "eosTokenId": 1,
        "eosTokens": [
          1,
          106,
          50
        ],
        "bosTokenId": 2,
        "unkTokenId": 3,
        "addBosToken": false,
        "addEosToken": false
      },
      "litertlm": {
        "sentencepieceModel": "TOKENIZER_MODEL",
        "vocabSize": 262144,
        "padTokenId": 0,
        "eosTokenId": 1,
        "eosTokens": [
          1,
          106,
          50
        ],
        "bosTokenId": 2,
        "unkTokenId": 3,
        "addBosToken": false,
        "addEosToken": false
      }
    }
  },
  "package": {
    "task": {
      "tfliteEntry": "TF_LITE_PREFILL_DECODE",
      "tokenizerModelEntry": "TOKENIZER_MODEL",
      "metadataEntry": "METADATA"
    },
    "litertlm": {
      "tfliteModelType": "TF_LITE_PREFILL_DECODE",
      "tokenizerSectionType": "SP_Tokenizer",
      "metadataSectionType": "LlmMetadataProto"
    }
  }
}
