Views
No views yet

| Architecture | Mixture-of-Experts (MoE) |
| Total Parameters | 1T |
| Activated Parameters | 32B |
| Number of Layers (Dense layer included) | 61 |
| Number of Dense Layers | 1 |
| Attention Hidden Dimension | 7168 |
| MoE Hidden Dimension (per Expert) | 2048 |
| Number of Attention Heads | 64 |
| Number of Experts | 384 |
| Selected Experts per Token | 8 |
| Number of Shared Experts | 1 |
| Vocabulary Size | 160K |
| Context Length | 256K |
| Attention Mechanism | MLA |
| Activation Function | SwiGLU |
| Vision Encoder | MoonViT |
| Parameters of Vision Encoder | 400M |
| Benchmark | Kimi K2.6 | Kimi K2.7 Code | GPT-5.5 | Claude Opus 4.8 |
|---|---|---|---|---|
| Coding | ||||
| Kimi Code Bench v2 | 50.9 | 62.0 | 69.0 | 67.4 |
| Program Bench | 48.3 | 53.6 | 69.1 | 63.8 |
| MLS Bench Lite | 26.7 | 35.1 | 35.5 | 42.8 |
| Agentic | ||||
| Kimi Claw 24/7 Bench | 42.9 | 46.9 | 52.8 | 50.4 |
| MCP Atlas | 69.4 | 76.0 | 79.4 | 81.3 |
| MCP Mark Verified | 72.8 | 81.1 | 92.9 | 76.4 |
[!Note] You can access Kimi-K2.7-Code's API on https://platform.moonshot.ai and we provide OpenAI/Anthropic-compatible API for you. Currently, Kimi-K2.7-Code is recommended to run on the following inference engines:
transformers is >=4.57.1, <5.0.0.[!Note]
Chat with video content is an experimental feature and is only supported in our official API for now. The recommendedtemperaturewill be1.0for Thinking mode. The recommendedtop_pis0.95. Instant mode is not supported.
1import openai
2import base64
3import requests
4def simple_chat(client: openai.OpenAI, model_name: str):
5 messages = [
6 {'role': 'system', 'content': 'You are Kimi, an AI assistant created by Moonshot AI.'},
7 {
8 'role': 'user',
9 'content': [
10 {'type': 'text', 'text': 'which one is bigger, 9.11 or 9.9? think carefully.'}
11 ],
12 },
13 ]
14 response = client.chat.completions.create(
15 model=model_name, messages=messages, stream=False, max_tokens=4096
16 )
17 print('====== Below is reasoning content in Thinking Mode ======')
18 print(f'reasoning content: {response.choices[0].message.reasoning}')
19 print('====== Below is response in Thinking Mode ======')
20 print(f'response: {response.choices[0].message.content}')1import openai
2import base64
3import requests
4
5def chat_with_image(client: openai.OpenAI, model_name: str):
6 url = 'https://huggingface.co/moonshotai/Kimi-K2.7-Code/resolve/main/figures/kimi-logo.png'
7 image_base64 = base64.b64encode(requests.get(url).content).decode()
8 messages = [
9 {
10 'role': 'user',
11 'content': [
12 {'type': 'text', 'text': 'Describe this image in detail.'},
13 {
14 'type': 'image_url',
15 'image_url': {'url': f'data:image/png;base64,{image_base64}'},
16 },
17 ],
18 }
19 ]
20
21 response = client.chat.completions.create(
22 model=model_name, messages=messages, stream=False, max_tokens=8192
23 )
24 print('====== Below is reasoning content in Thinking Mode ======')
25 print(f'reasoning content: {response.choices[0].message.reasoning}')
26 print('====== Below is response in Thinking Mode ======')
27 print(f'response: {response.choices[0].message.content}')1import openai
2import base64
3import requests
4
5def chat_with_video(client: openai.OpenAI, model_name:str):
6 url = 'https://huggingface.co/moonshotai/Kimi-K2.7-Code/resolve/main/figures/demo_video.mp4'
7 video_base64 = base64.b64encode(requests.get(url).content).decode()
8 messages = [
9 {
10 "role": "user",
11 "content": [
12 {"type": "text","text": "Describe the video in detail."},
13 {
14 "type": "video_url",
15 "video_url": {"url": f"data:video/mp4;base64,{video_base64}"},
16 },
17 ],
18 }
19 ]
20
21 response = client.chat.completions.create(model=model_name, messages=messages)
22 print('====== Below is reasoning content in Thinking Mode ======')
23 print(f'reasoning content: {response.choices[0].message.reasoning}')
24 print('====== Below is response in Thinking Mode ======')
25 print(f'response: {response.choices[0].message.content}')preserve_thinking mode, which retains full reasoning content across multi-turn interactions and enhances performance in coding agent scenarios.preserve_thinking mode:1def chat_with_preserve_thinking(client: openai.OpenAI, model_name: str):
2 messages = [
3 {
4 "role": "user",
5 "content": "Tell me three random numbers."
6 },
7 {
8 "role": "assistant",
9 "reasoning_content": "I'll start by listing five numbers: 473, 921, 235, 215, 222, and I'll tell you the first three.",
10 # Some API (e.g. vLLM) may not support reasoning_content, you can try reasoning instead
11 "content": "473, 921, 235"
12 },
13 {
14 "role": "user",
15 "content": "What are the other two numbers you have in mind?"
16 }
17 ]
18
19 response = client.chat.completions.create(
20 model=model_name,
21 messages=messages,
22 stream=False,
23 max_tokens=4096,
24 )
25 # the assistant should mention 215 and 222 that appear in the prior reasoning content
26 print(f"response: {response.choices[0].message.reasoning}")
27 return response.choices[0].message.content
28