# moonshotai/kimi-k2 architecture

> Architecture diagram of the GitHub repository moonshotai/kimi-k2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/moonshotai/kimi-k2
- Repository: https://github.com/moonshotai/kimi-k2

## Overview

This repository presents Kimi K2 as a model release, not an executable application: it documents a large MoE language model, its training and optimization, and Base and Instruct variants. The documented user-facing path is general-purpose chat and agentic tool use with Instruct; Base is intended for researchers and builders who want to fine-tune. The tree also includes deployment and tool-call guidance, but their contents are not available here, so their runtime relationships cannot be established.

Main entry points: [`README.md`](https://github.com/moonshotai/kimi-k2/blob/main/README.md) (Kimi K2)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["Model"]
  node_k2["Kimi K2<br/>[README.md]"]
  node_moe["MoE architecture<br/>[README.md]"]
  node_base["K2 Base<br/>[README.md]"]
  node_instruct["K2 Instruct<br/>[README.md]"]
end

subgraph group_training["Training"]
  node_pretraining["Large-scale pretraining<br/>[README.md]"]
  node_muonclip["MuonClip optimizer<br/>[README.md]"]
end

subgraph group_usage["Usage"]
  node_agentic["Agentic capabilities<br/>[README.md]"]
  node_deployment["Deployment guidance<br/>[deploy_guidance.md]"]
  node_toolguidance["Tool-call guidance"]
end

node_researcher(("Researchers and builders"))
node_user(("Chat and agent users"))

node_k2 -->|"uses architecture"| node_moe
node_pretraining -->|"trains model"| node_k2
node_muonclip -->|"optimizes training"| node_pretraining
node_k2 -->|"offers variant"| node_base
node_k2 -->|"offers variant"| node_instruct
node_researcher -->|"fine-tunes"| node_base
node_user -->|"uses for chat"| node_instruct
node_instruct -->|"supports tool use"| node_agentic

click node_k2 "https://github.com/moonshotai/kimi-k2/blob/main/README.md"
click node_moe "https://github.com/moonshotai/kimi-k2/blob/main/README.md"
click node_base "https://github.com/moonshotai/kimi-k2/blob/main/README.md"
click node_instruct "https://github.com/moonshotai/kimi-k2/blob/main/README.md"
click node_pretraining "https://github.com/moonshotai/kimi-k2/blob/main/README.md"
click node_muonclip "https://github.com/moonshotai/kimi-k2/blob/main/README.md"
click node_agentic "https://github.com/moonshotai/kimi-k2/blob/main/README.md"
click node_deployment "https://github.com/moonshotai/kimi-k2/blob/main/docs/deploy_guidance.md"
click node_toolguidance "https://github.com/moonshotai/kimi-k2/blob/main/docs/tool_call_guidance.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_k2,node_moe,node_base,node_instruct,node_user toneBlue
class node_pretraining,node_muonclip toneAmber
class node_agentic,node_deployment,node_toolguidance toneMint
class node_researcher toneIndigo
```

## Components

### Model

- [Kimi K2](https://github.com/moonshotai/kimi-k2/blob/main/README.md): `README.md`
- [MoE architecture](https://github.com/moonshotai/kimi-k2/blob/main/README.md): `README.md`
- [K2 Base](https://github.com/moonshotai/kimi-k2/blob/main/README.md): `README.md`
- [K2 Instruct](https://github.com/moonshotai/kimi-k2/blob/main/README.md): `README.md`

### Training

- [Large-scale pretraining](https://github.com/moonshotai/kimi-k2/blob/main/README.md): `README.md`
- [MuonClip optimizer](https://github.com/moonshotai/kimi-k2/blob/main/README.md): `README.md`

### Usage

- [Agentic capabilities](https://github.com/moonshotai/kimi-k2/blob/main/README.md): `README.md`
- [Deployment guidance](https://github.com/moonshotai/kimi-k2/blob/main/docs/deploy_guidance.md): `docs/deploy_guidance.md`
- [Tool-call guidance](https://github.com/moonshotai/kimi-k2/blob/main/docs/tool_call_guidance.md): `docs/tool_call_guidance.md`

### Other components

- **Researchers and builders**
- **Chat and agent users**

## Connections

- Kimi K2 → MoE architecture: uses architecture (evidence: `README.md`)
- Large-scale pretraining → Kimi K2: trains model (evidence: `README.md`)
- MuonClip optimizer → Large-scale pretraining: optimizes training (evidence: `README.md`)
- Kimi K2 → K2 Base: offers variant (evidence: `README.md`)
- Kimi K2 → K2 Instruct: offers variant (evidence: `README.md`)
- Researchers and builders → K2 Base: fine-tunes (evidence: `README.md`)
- Chat and agent users → K2 Instruct: uses for chat (evidence: `README.md`)
- K2 Instruct → Agentic capabilities: supports tool use (evidence: `README.md`)
