{
  "hf_id": "moonshotai/Kimi-K2.7-Code",
  "meta": {
    "title": "Kimi-K2.7-Code",
    "slug": "kimi-k2.7-code",
    "provider": "Moonshot AI",
    "description": "Coding-focused agentic MoE built on Kimi-K2.6, tuned for long-horizon software-engineering tasks with thinking-only reasoning, tool calling, and vision-language input",
    "date_added": "2026-06-12",
    "date_updated": "2026-11-21",
    "tasks": [
      "multimodal",
      "text"
    ],
    "performance_headline": "1T MoE coding agent with ~30% fewer thinking tokens than Kimi-K2.6",
    "related_recipes": [
      "moonshotai/Kimi-K2.6",
      "moonshotai/Kimi-K2-Thinking"
    ],
    "hardware": {
      "h200": "verified",
      "mi300x": "verified",
      "mi325x": "verified",
      "mi355x": "verified",
      "ascend_910b": "verified"
    }
  },
  "recommended_command": {
    "hardware": "h200",
    "strategy": "single_node_tp",
    "variant": "default",
    "node_count": 1,
    "deploy_type": "single_node",
    "env": {},
    "docker_image": "vllm/vllm-openai:latest",
    "command": "vllm serve moonshotai/Kimi-K2.7-Code \\\n  --trust-remote-code \\\n  --tensor-parallel-size 8 \\\n  --tool-call-parser kimi_k2 \\\n  --enable-auto-tool-choice \\\n  --reasoning-parser kimi_k2 \\\n  --speculative-config '{\"model\":\"lightseekorg/kimi-k2.7-coder-eagle3.1-mla\",\"method\":\"eagle3\",\"num_speculative_tokens\":3}' \\\n  --mm-encoder-tp-mode data",
    "argv": [
      "vllm",
      "serve",
      "moonshotai/Kimi-K2.7-Code",
      "--trust-remote-code",
      "--tensor-parallel-size",
      "8",
      "--tool-call-parser",
      "kimi_k2",
      "--enable-auto-tool-choice",
      "--reasoning-parser",
      "kimi_k2",
      "--speculative-config",
      "{\"model\":\"lightseekorg/kimi-k2.7-coder-eagle3.1-mla\",\"method\":\"eagle3\",\"num_speculative_tokens\":3}",
      "--mm-encoder-tp-mode",
      "data"
    ],
    "docker_command": "docker run --gpus all \\\n  --privileged --ipc=host -p 8000:8000 \\\n  -v ~/.cache/huggingface:/root/.cache/huggingface \\\n  vllm/vllm-openai:latest moonshotai/Kimi-K2.7-Code \\\n  --trust-remote-code \\\n  --tensor-parallel-size 8 \\\n  --tool-call-parser kimi_k2 \\\n  --enable-auto-tool-choice \\\n  --reasoning-parser kimi_k2 \\\n  --speculative-config '{\"model\":\"lightseekorg/kimi-k2.7-coder-eagle3.1-mla\",\"method\":\"eagle3\",\"num_speculative_tokens\":3}' \\\n  --mm-encoder-tp-mode data",
    "docker_argv": [
      "docker",
      "run",
      "--gpus",
      "all",
      "--privileged",
      "--ipc=host",
      "-p",
      "8000:8000",
      "-v",
      "~/.cache/huggingface:/root/.cache/huggingface",
      "vllm/vllm-openai:latest",
      "moonshotai/Kimi-K2.7-Code",
      "--trust-remote-code",
      "--tensor-parallel-size",
      "8",
      "--tool-call-parser",
      "kimi_k2",
      "--enable-auto-tool-choice",
      "--reasoning-parser",
      "kimi_k2",
      "--speculative-config",
      "{\"model\":\"lightseekorg/kimi-k2.7-coder-eagle3.1-mla\",\"method\":\"eagle3\",\"num_speculative_tokens\":3}",
      "--mm-encoder-tp-mode",
      "data"
    ],
    "strategy_spec": {
      "name": "single_node_tp",
      "deploy_type": "single_node",
      "display_name": "Tensor Parallel",
      "short_label": "TP",
      "orientation": "latency",
      "description": "Single-node tensor parallel. Splits the model across all local GPUs. TP size is set to the GPU count at deploy time. The simplest multi-GPU strategy — works for all model architectures.\n",
      "hardware_match": {
        "min_gpus": 1,
        "max_gpus": 8,
        "multi_node": false
      },
      "vllm_args": [],
      "parallel_flag": "--tensor-parallel-size"
    },
    "hardware_profile": {
      "brand": "NVIDIA",
      "generation": "hopper",
      "compute_arch": "sm90",
      "display_name": "H200",
      "description": "NVIDIA H200 SXM 141 GB HBM3e · 8-GPU HGX node",
      "gpu_count": 8,
      "vram_gb": 1128,
      "multi_node": false
    },
    "alternatives": {
      "single_node_tep": "/moonshotai/Kimi-K2.7-Code/strategies/single_node_tep.json",
      "single_node_dep": "/moonshotai/Kimi-K2.7-Code/strategies/single_node_dep.json",
      "multi_node_tp": "/moonshotai/Kimi-K2.7-Code/strategies/multi_node_tp.json",
      "multi_node_tp_pp": "/moonshotai/Kimi-K2.7-Code/strategies/multi_node_tp_pp.json",
      "multi_node_dep": "/moonshotai/Kimi-K2.7-Code/strategies/multi_node_dep.json",
      "multi_node_tep": "/moonshotai/Kimi-K2.7-Code/strategies/multi_node_tep.json",
      "pd_cluster": "/moonshotai/Kimi-K2.7-Code/strategies/pd_cluster.json",
      "kv_store_centralized_mooncake": "/moonshotai/Kimi-K2.7-Code/strategies/kv_store_centralized_mooncake.json",
      "kv_store_distributed_mooncake": "/moonshotai/Kimi-K2.7-Code/strategies/kv_store_distributed_mooncake.json"
    },
    "by_hardware": {
      "h200": "/moonshotai/Kimi-K2.7-Code/hw/h200.json",
      "h100": "/moonshotai/Kimi-K2.7-Code/hw/h100.json",
      "b200": "/moonshotai/Kimi-K2.7-Code/hw/b200.json",
      "gb200": "/moonshotai/Kimi-K2.7-Code/hw/gb200.json",
      "b300": "/moonshotai/Kimi-K2.7-Code/hw/b300.json",
      "gb300": "/moonshotai/Kimi-K2.7-Code/hw/gb300.json",
      "mi300x": "/moonshotai/Kimi-K2.7-Code/hw/mi300x.json",
      "mi325x": "/moonshotai/Kimi-K2.7-Code/hw/mi325x.json",
      "mi350x": "/moonshotai/Kimi-K2.7-Code/hw/mi350x.json",
      "mi355x": "/moonshotai/Kimi-K2.7-Code/hw/mi355x.json",
      "ascend_910b": "/moonshotai/Kimi-K2.7-Code/hw/ascend_910b.json"
    }
  },
  "model": {
    "model_id": "moonshotai/Kimi-K2.7-Code",
    "min_vllm_version": "0.19.1",
    "docker_image": {
      "nvidia": "vllm/vllm-openai:latest",
      "amd": "vllm/vllm-openai-rocm:nightly"
    },
    "architecture": "moe",
    "parameter_count": "1T",
    "active_parameters": "32B",
    "context_length": 262144,
    "supports_dcp": true,
    "base_args": [
      "--trust-remote-code"
    ],
    "base_env": {},
    "install": {
      "pip": {
        "command": "uv venv\nsource .venv/bin/activate\nuv pip install -U vllm --torch-backend auto"
      },
      "docker": {
        "command": "docker pull vllm/vllm-openai:latest"
      }
    }
  },
  "features": {
    "tool_calling": {
      "description": "Kimi K2 tool-call parser with automatic tool choice",
      "args": [
        "--tool-call-parser",
        "kimi_k2",
        "--enable-auto-tool-choice"
      ]
    },
    "reasoning": {
      "description": "Kimi K2 reasoning parser for extracting chain-of-thought content (Kimi-K2.7-Code is thinking-only — keep this enabled)",
      "args": [
        "--reasoning-parser",
        "kimi_k2"
      ]
    },
    "spec_decoding": {
      "description": "Eagle3 speculative decoding for accelerated inference",
      "args": [
        "--speculative-config",
        "{\"model\":\"lightseekorg/kimi-k2.7-coder-eagle3.1-mla\",\"method\":\"eagle3\",\"num_speculative_tokens\":3}"
      ],
      "hardware_overrides": {
        "ascend_910b": {
          "args": [
            "--speculative-config",
            "{\"method\":\"dflash\",\"model\":\"z-lab/Kimi-K2.5-DFlash\",\"num_speculative_tokens\":15}"
          ]
        }
      }
    },
    "text_only": {
      "description": "Skip loading the vision encoder for text-only workloads — frees VRAM for KV cache. Mutually exclusive with encoder_parallel.",
      "args": [
        "--language-model-only"
      ]
    },
    "encoder_parallel": {
      "description": "Run the vision encoder in data-parallel mode — avoids TP comm overhead on the small encoder. Mutually exclusive with text_only.",
      "args": [
        "--mm-encoder-tp-mode",
        "data"
      ]
    }
  },
  "opt_in_features": [
    "text_only"
  ],
  "variants": {
    "default": {
      "precision": "int4",
      "vram_minimum_gb": 714,
      "description": "Native INT4 via compressed-tensors (~595 GB on disk); fits 8×H200"
    },
    "ascend_w4a8": {
      "model_id": "Eco-Tech/Kimi-K2.7-Code-w4a8",
      "precision": "int4",
      "label": "W4A8 (Ascend A2)",
      "vram_minimum_gb": 529,
      "description": "ModelSlim INT4 W4A8 checkpoint for Atlas 800I A2 (910B4), served as a two-node prefill pool (DP2 x TP8) and a two-node decode pool (DP4 x TP4, two local DP ranks per node). Requires --quantization ascend.",
      "supported_hardware": [
        "ascend_910b"
      ],
      "min_vllm_version": "0.32.0",
      "extra_args": [
        "--quantization",
        "ascend",
        "--host",
        "0.0.0.0",
        "--served-model-name",
        "kimi27",
        "--seed",
        "1024",
        "--max-model-len",
        "71680",
        "--gpu-memory-utilization",
        "0.95",
        "--enable-prefix-caching",
        "--async-scheduling",
        "--mm-processor-cache-gb",
        "0",
        "--compilation-config",
        "{\"cudagraph_mode\":\"FULL_DECODE_ONLY\"}"
      ],
      "extra_env": {
        "PYTORCH_NPU_ALLOC_CONF": "expandable_segments:True",
        "OMP_PROC_BIND": "false",
        "OMP_NUM_THREADS": "1",
        "TASK_QUEUE_ENABLE": "1",
        "VLLM_RPC_TIMEOUT": "3600000",
        "HCCL_OP_EXPANSION_MODE": "AIV",
        "HCCL_INTRA_ROCE_ENABLE": "1",
        "ACL_OP_INIT_MODE": "1",
        "PYTHONHASHSEED": "0",
        "VLLM_USE_MODELSCOPE": "true",
        "MOONCAKE_CONFIG_PATH": "$MOONCAKE_CONFIG_PATH"
      },
      "hardware_overrides": {
        "ascend_910b": {
          "docker_image": "quay.io/ascend/vllm-ascend:v0.32.0rc1",
          "docker_shm_size": "1g",
          "docker_serve_command": "vllm serve",
          "install": {
            "pip": false
          }
        }
      },
      "json": "/Eco-Tech/Kimi-K2.7-Code-w4a8.json"
    }
  },
  "hardware_overrides": {
    "amd": {
      "extra_env": {
        "VLLM_ROCM_USE_AITER": "1",
        "VLLM_ROCM_QUICK_REDUCE_QUANTIZATION": "INT4"
      }
    }
  },
  "guide": "## Overview\n\n[Kimi-K2.7-Code](https://huggingface.co/moonshotai/Kimi-K2.7-Code) is a coding-focused\nagentic model built on top of Kimi-K2.6. It substantially improves real-world\nlong-horizon coding performance — strengthening end-to-end task completion across complex\nsoftware-engineering workflows while improving token efficiency, reducing thinking-token\nusage by ~30% versus Kimi-K2.6.\n\nIt shares the same architecture as Kimi-K2.5 / Kimi-K2.6 (1T-parameter MoE, 32B activated,\nDeepSeek-V3 backbone with MLA attention and a MoonViT vision encoder), so the K2.6\ndeployment method can be reused directly. Kimi-K2.7-Code runs in **thinking mode only**\nwith `preserve_thinking` forced on; keep the reasoning parser enabled.\n\n## Prerequisites\n\n- **vLLM version:** >= 0.19.1 (manually verified). The model is also available in the\n  vLLM nightly wheel, but nightly builds are experimental.\n- **Hardware (INT4):** 8x H200 GPUs (verified), or equivalent aggregate VRAM (~640 GB)\n\n```bash\nuv venv\nsource .venv/bin/activate\nuv pip install -U vllm --torch-backend=auto\n```\n\n## Launch command\n\nServe on a single H200 node with TP8 (vision encoder in data-parallel mode):\n\n```bash\nvllm serve moonshotai/Kimi-K2.7-Code \\\n  --tensor-parallel-size 8 \\\n  --mm-encoder-tp-mode data \\\n  --trust-remote-code \\\n  --tool-call-parser kimi_k2 \\\n  --enable-auto-tool-choice \\\n  --reasoning-parser kimi_k2\n```\n\n**Key notes**\n\n- `--tool-call-parser kimi_k2` — required for enabling tool calling.\n- `--reasoning-parser kimi_k2` — Kimi-K2.7-Code supports thinking mode only; pass this for\n  correct reasoning processing.\n- `--mm-encoder-tp-mode data` — runs the small MoonViT encoder data-parallel to avoid TP\n  communication overhead.\n\n### AMD MI300X/MI325X\n\nOn 8x MI300X or MI325X (`gfx942`), use the standard W4A16 MoE path with AITER\nand INT4 QuickReduce.\n\n```bash\nexport VLLM_ROCM_USE_AITER=1\nexport VLLM_ROCM_QUICK_REDUCE_QUANTIZATION=INT4\n\nvllm serve moonshotai/Kimi-K2.7-Code \\\n  --host 0.0.0.0 \\\n  --port 8000 \\\n  --trust-remote-code \\\n  --tensor-parallel-size 8 \\\n  --tool-call-parser kimi_k2 \\\n  --enable-auto-tool-choice \\\n  --reasoning-parser kimi_k2 \\\n  --mm-encoder-tp-mode data\n```\n\n### AMD MI350X/MI355X\n\nOn 8x MI350X or MI355X (`gfx950`), add `--moe-backend flydsl` to use the\noptimized FlyDSL W4A16 MoE kernel. Keep LoRA disabled for this path.\n\n```bash\nexport VLLM_ROCM_USE_AITER=1\nexport VLLM_ROCM_QUICK_REDUCE_QUANTIZATION=INT4\n\nvllm serve moonshotai/Kimi-K2.7-Code \\\n  --tensor-parallel-size 8 \\\n  --trust-remote-code \\\n  --mm-encoder-tp-mode data \\\n  --moe-backend flydsl \\\n  --tool-call-parser kimi_k2 \\\n  --enable-auto-tool-choice \\\n  --reasoning-parser kimi_k2 \\\n  --compilation-config '{\"pass_config\": {\"fuse_allreduce_rms\": false}}'\n```\n\nNotes:\n- The FlyDSL INT4 MoE path does not support expert parallelism; do not add\n  `--enable-expert-parallel`.\n- Keep `--compilation-config '{\"pass_config\": {\"fuse_allreduce_rms\": false}}'`;\n  it is required for this FlyDSL path on MI350X / MI355X.\n- vLLM has tuned MI350X/MI355X FlyDSL configs for this Kimi shape at TP=8 and TP=4.\n- Keep vLLM's default block size unless you are tuning long-context\n  throughput; `--block-size 64` is safe to try.\n\n## Client Usage\n\nOnce the vLLM server is running, consume it via the OpenAI-compatible API. The recommended\nsampling for thinking mode is `temperature=1.0` and `top_p=0.95`.\n\n```python\nimport time\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=\"EMPTY\",\n    base_url=\"http://localhost:8000/v1\",\n    timeout=3600,\n)\n\nmessages = [\n    {\n        \"role\": \"user\",\n        \"content\": [\n            {\n                \"type\": \"image_url\",\n                \"image_url\": {\n                    \"url\": \"https://huggingface.co/moonshotai/Kimi-K2.7-Code/resolve/main/figures/kimi-logo.png\"\n                },\n            },\n            {\"type\": \"text\", \"text\": \"Describe this image in detail.\"},\n        ],\n    }\n]\n\nstart = time.time()\nresponse = client.chat.completions.create(\n    model=\"moonshotai/Kimi-K2.7-Code\",\n    messages=messages,\n    max_tokens=4096,\n    temperature=1.0,\n    top_p=0.95,\n)\nprint(f\"Response costs: {time.time() - start:.2f}s\")\nprint(f\"Reasoning: {response.choices[0].message.reasoning}\")\nprint(f\"Response: {response.choices[0].message.content}\")\n```\n\n## Troubleshooting\n\n- **OOM errors:** Lower `--max-num-seqs` or `--max-model-len`, or adjust TP/EP to match your GPU count.\n- **Vision encoder performance:** Use `--mm-encoder-tp-mode data` to run the vision encoder\n  in data-parallel mode. The encoder is small, so TP adds communication overhead with little gain.\n- **Unique multimodal inputs:** Pass `--mm-processor-cache-gb 0` to avoid caching overhead.\n  For repeated inputs, `--mm-processor-cache-type shm` uses host shared memory for better\n  performance at high TP settings.\n- **Text-only workloads:** Pass `--language-model-only` to skip loading MoonViT and free\n  VRAM for KV cache.\n\n## References\n\n- [Kimi-K2.7-Code on Hugging Face](https://huggingface.co/moonshotai/Kimi-K2.7-Code)\n- [Kimi-K2.7-Code deployment guide](https://huggingface.co/moonshotai/Kimi-K2.7-Code/blob/main/docs/deploy_guidance.md)\n- [Kimi-K2.6 recipe](https://recipes.vllm.ai/moonshotai/Kimi-K2.6)\n- [vLLM multimodal inputs guide](https://docs.vllm.ai/en/latest/features/multimodal_inputs.html)\n\n## Ascend overview\n\nKimi-K2.7-Code is a 1T-parameter MoE coding model with a MoonViT encoder.\nThe Ascend W4A8 checkpoint runs on Atlas 800I A2 (910B4) as a four-node\nprefill/decode cluster: two prefill nodes with DP2 x TP8 and two decode\nnodes with DP4 x TP4, connected through Mooncake KV transfer and fronted by\nthe Ascend proxy.\n\n## Ascend prerequisites\n\n- Hardware and node topology: 4 x Atlas 800I A2, 8 x 910B4 (64 GB) each\n- vLLM / vLLM Ascend runtime: vLLM-Ascend v0.32.0rc1\n- Image: `quay.io/ascend/vllm-ascend:v0.32.0rc1`\n- Checkpoint: `Eco-Tech/Kimi-K2.7-Code-w4a8` revision\n  `a671b826a7329495a89d6ff70b9c4ea96588c035`\n- Draft: `z-lab/Kimi-K2.5-DFlash`\n- Host: `/etc/hccn.conf` present, shared model storage mounted, one\n  `mooncake_master` reachable by every engine\n- Both model ids resolve from ModelScope (`VLLM_USE_MODELSCOPE=true`)\n\n## Client usage\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"http://<router-host>:<router-port>/v1\",\n    api_key=\"EMPTY\",\n)\nresponse = client.chat.completions.create(\n    model=\"kimi27\",\n    messages=[{\"role\": \"user\", \"content\": \"Hello\"}],\n    max_tokens=1024,\n)\nprint(response.choices[0].message.content)\n```\n\n## Ascend references\n\n- [Kimi-K2.7-Code model card](https://huggingface.co/moonshotai/Kimi-K2.7-Code)\n- [Base recipe](https://github.com/vllm-project/vllm/blob/main/recipes/models/moonshotai/Kimi-K2.7-Code.yaml)\n- [W4A8 checkpoint](https://www.modelscope.cn/models/Eco-Tech/Kimi-K2.7-Code-w4a8)\n- [DFlash draft](https://huggingface.co/z-lab/Kimi-K2.5-DFlash)\n- [Ascend Mooncake PD guide](https://docs.vllm.ai/projects/ascend/en/latest/tutorials/features/pd_disaggregation_mooncake_multi_node.html)\n",
  "hardware_notes": {
    "ascend_910b": {
      "title": "Atlas 800I A2 (910B4) four-node PD",
      "body": "Requires two prefill and two decode nodes, each with 8 x 64 GB NPUs.\nProvide the model cache or weights path on every node, set\n`MOONCAKE_CONFIG_PATH`, and start `mooncake_master` before the engines.\nWhen using the rendered Docker command, add\n`-v /etc/hccn.conf:/etc/hccn.conf:ro`; the default mount set omits it.\n",
      "link": {
        "label": "vLLM Ascend PD disaggregation guide",
        "href": "https://docs.vllm.ai/projects/ascend/en/latest/tutorials/features/pd_disaggregation_mooncake_multi_node.html"
      }
    }
  },
  "strategy_hardware": {
    "single_node_tp": {
      "npu": "unsupported",
      "ascend_910b": "unsupported"
    },
    "single_node_tep": {
      "npu": "unsupported",
      "ascend_910b": "unsupported"
    },
    "single_node_dep": {
      "npu": "unsupported",
      "ascend_910b": "unsupported"
    },
    "multi_node_tp": {
      "npu": "unsupported",
      "ascend_910b": "unsupported"
    },
    "multi_node_tp_pp": {
      "npu": "unsupported",
      "ascend_910b": "unsupported"
    },
    "multi_node_dep": {
      "npu": "unsupported",
      "ascend_910b": "unsupported"
    },
    "multi_node_tep": {
      "npu": "unsupported",
      "ascend_910b": "unsupported"
    },
    "pd_cluster": {
      "npu": "unsupported",
      "ascend_910b": "supported"
    }
  },
  "strategy_min_gpus": {
    "ascend_910b": {
      "pd_cluster": 32
    }
  },
  "presets": {
    "ascend_a2_w4a8_pd": {
      "label": "Ascend A2 W4A8 PD (2P + 2D)",
      "hardware": "ascend_910b",
      "strategy": "pd_cluster",
      "variants": [
        "ascend_w4a8"
      ],
      "default": true,
      "select": {
        "pd_router": "ascend",
        "pd_connector": "mooncake_ascend",
        "frontend": "python",
        "kv_offload": false,
        "features": {
          "spec_decoding": true,
          "encoder_parallel": false
        }
      },
      "source": {
        "label": "vLLM Ascend Mooncake multi-node PD guide",
        "href": "https://docs.vllm.ai/projects/ascend/en/latest/tutorials/features/pd_disaggregation_mooncake_multi_node.html",
        "key": "kimi-k27-a2-w4a8-pd",
        "revision": "2026-11-21"
      },
      "description": "Two prefill nodes (DP2 x TP8) and two decode nodes (DP4 x TP4), with Mooncake KV transfer and the Ascend proxy in front.",
      "workload": "64k input / 1k output chat and agentic coding traffic.",
      "image": {
        "vllm": "quay.io/ascend/vllm-ascend:v0.32.0rc1",
        "model_revision": "a671b826a7329495a89d6ff70b9c4ea96588c035"
      },
      "remove_args": [
        "--data-parallel-hybrid-lb"
      ],
      "roles": {
        "prefill": {
          "nodes": 2,
          "parallelism": "dep",
          "tp": 8,
          "pp": 1,
          "args": [
            "--port",
            "7100",
            "--max-num-batched-tokens",
            "16384",
            "--max-num-seqs",
            "3",
            "--enforce-eager",
            "--additional-config",
            "{\"enable_cpu_binding\":true,\"enable_shared_expert_dp\":true}"
          ],
          "env": {
            "HCCL_BUFFSIZE": "256",
            "VLLM_ASCEND_ENABLE_FLASHCOMM1": "1",
            "VLLM_ASCEND_ENABLE_MLAPO": "1",
            "VLLM_ASCEND_ENABLE_NZ": "1",
            "VLLM_USE_V1": "1",
            "VLLM_ENGINE_ITER_TIMEOUT": "600",
            "HCCL_IF_IP": "$PREFILL_NODE_1",
            "HCCL_SOCKET_IFNAME": "$IFACE_NAME",
            "GLOO_SOCKET_IFNAME": "$IFACE_NAME",
            "TP_SOCKET_IFNAME": "$IFACE_NAME"
          },
          "json_args": {
            "--kv-transfer-config": {
              "kv_connector": "MultiConnector",
              "kv_role": "kv_producer",
              "kv_port": null,
              "kv_connector_extra_config": {
                "prefill": null,
                "decode": null,
                "connectors": [
                  {
                    "kv_connector": "MooncakeConnectorV1",
                    "kv_role": "kv_producer",
                    "kv_port": "30000",
                    "kv_connector_extra_config": {
                      "prefill": {
                        "dp_size": 2,
                        "tp_size": 8
                      },
                      "decode": {
                        "dp_size": 4,
                        "tp_size": 4
                      }
                    }
                  },
                  {
                    "kv_connector": "AscendStoreConnector",
                    "kv_role": "kv_producer",
                    "kv_connector_extra_config": {
                      "lookup_rpc_port": "0",
                      "backend": "mooncake"
                    }
                  }
                ]
              }
            }
          }
        },
        "decode": {
          "nodes": 2,
          "parallelism": "dep",
          "tp": 4,
          "pp": 1,
          "args": [
            "--port",
            "7100",
            "--max-num-batched-tokens",
            "200",
            "--max-num-seqs",
            "4",
            "--additional-config",
            "{\"enable_cpu_binding\":true,\"recompute_scheduler_enable\":true,\"enable_shared_expert_dp\":true}"
          ],
          "env": {
            "HCCL_BUFFSIZE": "1100",
            "VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS": "0",
            "VLLM_ASCEND_ENABLE_MLAPO": "1",
            "VLLM_ASCEND_ENABLE_NZ": "1",
            "VLLM_USE_V1": "1",
            "VLLM_ENGINE_ITER_TIMEOUT": "600",
            "HCCL_IF_IP": "$DECODE_NODE_1",
            "HCCL_SOCKET_IFNAME": "$IFACE_NAME",
            "GLOO_SOCKET_IFNAME": "$IFACE_NAME",
            "TP_SOCKET_IFNAME": "$IFACE_NAME"
          },
          "json_args": {
            "--kv-transfer-config": {
              "kv_connector": "MultiConnector",
              "kv_role": "kv_consumer",
              "kv_port": null,
              "kv_connector_extra_config": {
                "prefill": null,
                "decode": null,
                "connectors": [
                  {
                    "kv_connector": "MooncakeConnectorV1",
                    "kv_role": "kv_consumer",
                    "kv_port": "30100",
                    "kv_connector_extra_config": {
                      "prefill": {
                        "dp_size": 2,
                        "tp_size": 8
                      },
                      "decode": {
                        "dp_size": 4,
                        "tp_size": 4
                      }
                    }
                  },
                  {
                    "kv_connector": "AscendStoreConnector",
                    "kv_role": "kv_consumer",
                    "kv_connector_extra_config": {
                      "lookup_rpc_port": "0",
                      "backend": "mooncake"
                    }
                  }
                ]
              }
            }
          }
        }
      },
      "runbook": "## Topology\n\nFour Atlas 800I A2 nodes (8 x 910B4, 64 GB each):\n\n- Prefill: two dedicated nodes, DEP with TP8 on 8 devices. Each node runs\n  one DP rank (global DP2, local DP1) on an external endpoint.\n- Decode: two dedicated nodes, DEP with TP4 on 8 devices. Each node runs\n  two local DP ranks (global DP4, local DP2); HTTP ports are base port\n  plus the local rank, so 7100 and 7101 per node.\n- The Ascend proxy enumerates all four decode endpoints and both prefill\n  endpoints. Do not send normal generation requests directly to a decode\n  endpoint; decode is a KV consumer and can wedge when it receives a plain\n  request.\n\nThe renderer emits external-DP worker commands for these two-node pools.\nThe validated cluster used the equivalent per-rank `vllm serve` processes\nfrom `launch_online_dp.py`, with the same DP/TP sizes, rank offsets,\n7100/7101 ports and KV connector settings.\n\n## Placeholders to fill\n\nExport or replace the usual renderer variables before launch:\n`$PREFILL_NODE_1`, `$PREFILL_NODE_2`, `$DECODE_NODE_1`, `$DECODE_NODE_2`,\n`$PREFILL_DP_RPC_PORT`, `$DECODE_DP_RPC_PORT`, `$IFACE_NAME`,\n`$ROUTER_HOST`, `$ROUTER_PORT`, and `$MOONCAKE_CONFIG_PATH`.\n\n## Mooncake\n\nEvery prefill and decode node needs the same shared config, an exported\n`MOONCAKE_CONFIG_PATH`, and a reachable `mooncake_master`. The validated\nconfig used 15 GB per TP rank (32 clients, 480 GB total); a 1 GB value\nonly yields 32 GB and triggers eviction under two concurrent 64k requests.\nThe master ran on the first prefill node:\n\n```json\n{\n  \"metadata_server\": \"P2PHANDSHAKE\",\n  \"protocol\": \"ascend\",\n  \"device_name\": \"\",\n  \"master_server_address\": \"$PREFILL_NODE_1:50088\",\n  \"global_segment_size\": \"15GB\",\n  \"preferred_segment\": false,\n  \"prefer_alloc_in_same_node\": true\n}\n```\n\nStart `mooncake_master --rpc_port=50088` on the first prefill node before\nthe engines. When using the rendered Docker command, add\n`-v /etc/hccn.conf:/etc/hccn.conf:ro` so the Ascend Mooncake backend can\nread the host RoCE configuration; the renderer's default Ascend mount set\nomits it.\n",
      "json": "/moonshotai/Kimi-K2.7-Code/presets/ascend_a2_w4a8_pd.json"
    }
  },
  "notes": [
    {
      "title": "Use the Ascend PD preset",
      "when": {
        "hardware": [
          "ascend_910b"
        ],
        "strategies": [
          "pd_cluster"
        ],
        "variants": [
          "ascend_w4a8"
        ]
      },
      "body": "The supported path is the `ascend_a2_w4a8_pd` preset. It selects the Ascend proxy\nand Mooncake (Ascend), with native external-DP workers. Baseline and other\nrouters are outside this overlay's verification scope.\n"
    }
  ],
  "source": {
    "source": "vllm",
    "repo": "vllm-project/vllm",
    "ref": "main",
    "sha": "d51a5147112a31dfbed08cfa4b774c27c34ce90d",
    "path": "recipes/models/moonshotai/Kimi-K2.7-Code.yaml",
    "edit_url": "https://github.com/vllm-project/vllm/edit/main/recipes/models/moonshotai/Kimi-K2.7-Code.yaml",
    "overlays": [
      {
        "source": "vllm-ascend",
        "repo": "vllm-project/vllm-ascend",
        "ref": "main",
        "sha": "146b0a57242da88e245bfc4840367947d9b33a68",
        "path": "recipes/overlays/moonshotai/Kimi-K2.7-Code.yaml",
        "edit_url": "https://github.com/vllm-project/vllm-ascend/edit/main/recipes/overlays/moonshotai/Kimi-K2.7-Code.yaml"
      }
    ]
  }
}