{
  "id": "mixtral-block",
  "name": "Mixtral MoE Block",
  "components": [
    {
      "id": "input-1",
      "type": "input",
      "name": "hidden_states",
      "position": { "x": 220, "y": 50 },
      "params": { "shape": [1, 4096, 4096] },
      "inputs": [], "outputs": []
    },
    {
      "id": "rmsNorm-1",
      "type": "rmsNorm",
      "name": "input_norm",
      "scope": "layer.0.attention",
      "position": { "x": 220, "y": 220 },
      "params": { "normalizedShape": 4096 },
      "inputs": [], "outputs": []
    },
    {
      "id": "gqa-1",
      "type": "groupedQueryAttention",
      "name": "self_attn",
      "scope": "layer.0.attention",
      "position": { "x": 220, "y": 390 },
      "params": { "embedDim": 4096, "numHeads": 32, "numKVHeads": 8 },
      "inputs": [], "outputs": []
    },
    {
      "id": "rope-1",
      "type": "rope",
      "name": "rotary_emb",
      "scope": "layer.0.attention",
      "position": { "x": 500, "y": 390 },
      "params": { "dim": 128 },
      "inputs": [], "outputs": []
    },
    {
      "id": "add-1",
      "type": "add",
      "name": "attn_residual",
      "scope": "layer.0.attention",
      "position": { "x": 220, "y": 560 },
      "params": {},
      "inputs": [], "outputs": []
    },
    {
      "id": "rmsNorm-2",
      "type": "rmsNorm",
      "name": "post_attn_norm",
      "scope": "layer.0.moe",
      "position": { "x": 220, "y": 730 },
      "params": { "normalizedShape": 4096 },
      "inputs": [], "outputs": []
    },
    {
      "id": "moe-1",
      "type": "moeLayer",
      "name": "block_sparse_moe",
      "scope": "layer.0.moe",
      "position": { "x": 220, "y": 900 },
      "params": { "embedDim": 4096, "numExperts": 8, "topK": 2, "expertDim": 14336 },
      "inputs": [], "outputs": []
    },
    {
      "id": "add-2",
      "type": "add",
      "name": "moe_residual",
      "scope": "layer.0.moe",
      "position": { "x": 220, "y": 1070 },
      "params": {},
      "inputs": [], "outputs": []
    },
    {
      "id": "output-1",
      "type": "output",
      "name": "hidden_out",
      "position": { "x": 220, "y": 1240 },
      "params": {},
      "inputs": [], "outputs": []
    }
  ],
  "connections": [
    { "id": "c1", "from": "input-1",    "to": "rmsNorm-1" },
    { "id": "c9", "from": "input-1",    "to": "add-1" },
    { "id": "c2", "from": "rmsNorm-1",  "to": "gqa-1" },
    { "id": "c3", "from": "rope-1",     "to": "gqa-1" },
    { "id": "c4", "from": "gqa-1",      "to": "add-1" },
    { "id": "c5", "from": "add-1",      "to": "rmsNorm-2" },
    { "id": "c10", "from": "add-1",     "to": "add-2" },
    { "id": "c6", "from": "rmsNorm-2",  "to": "moe-1" },
    { "id": "c7", "from": "moe-1",      "to": "add-2" },
    { "id": "c8", "from": "add-2",      "to": "output-1" }
  ]
}
