unsloth/Kimi-K2.7-Code-GGUF
摘要
Unsloth 发布了 Kimi K2.7 Code 的 GGUF 量化版本,这是一个基于 Kimi K2.6 构建的 1 万亿参数 MoE 编码模型,具有改进的 Token 效率和智能体编码能力。
查看缓存全文
缓存时间: 2026/06/15 09:07
unsloth/Kimi-K2.7-Code-GGUF · Hugging Face
来源: https://huggingface.co/unsloth/Kimi-K2.7-Code-GGUF
阅读我们的如何运行Kimi K2.7代码指南!
参阅 Unsloth Dynamic 2.0 GGUF (https://unsloth.ai/docs/basics/unsloth-dynamic-v2.0-gguf) 了解我们的量化基准测试。
- 要以全精度无损方式运行Kimi K2.7 Code,请运行Q8(UD-Q8_K_XL),大小为595GB,仅比Q4(UD-Q4_K_XL)大10GB。
- 请参阅我们的Kimi K2.7 Code指南 (https://unsloth.ai/docs/models/kimi-k2.7-code) 了解量化分析和说明。
聊天 (https://www.kimi.com/code)主页 (https://www.moonshot.ai/)
Hugging Face (https://huggingface.co/moonshotai)推特关注 (https://twitter.com/kimi_moonshot)Discord (https://discord.gg/TYU2fdJykW)ModelScope) (https://modelscope.cn/organization/moonshotai)
许可证 (https://huggingface.co/moonshotai/Kimi-K2.7-Code/blob/main/LICENSE)
1. 模型介绍
Kimi K2.7 Code是一款基于Kimi K2.6构建的专注于编程的智能体模型。在实际长周期编程任务上进行了大幅改进,增强了在复杂软件工程工作流程中端到端完成任务的能力,同时提升了代币效率,与Kimi K2.6相比,思考代币使用量减少了约30%。
2. 模型摘要
架构混合专家(MoE)总参数量1T激活参数量32B层数(包含稠密层)61稠密层数1注意力隐藏维度7168MoE隐藏维度(每专家)2048注意力头数64专家数384每个token选中的专家数8共享专家数1词汇表大小160K上下文长度256K注意力机制MLA激活函数SwiGLU视觉编码器MoonViT视觉编码器参数量400M
3. 评估结果
| 基准测试 | Kimi K2.6 | Kimi K2.7 Code | GPT-5.5 | Claude Opus 4.8 |
|---|---|---|---|---|
| 编程 | ||||
| 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 |
| 智能体 | ||||
| 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 |
脚注
- 通用测试细节 - 除非另有说明,Kimi K2.7 Code和K2.6均使用Kimi Code CLI启用思考模式进行测试,温度为1.0,top-p为0.95,上下文长度为262,144个token;GPT-5.5在Codex中以xhigh模式运行,Opus 4.8在Claude Code中以xhigh模式运行。除这些差异外,所有基准测试均在相同条件下进行评估。
- 编程基准测试 - Kimi Code Bench V2是我们内部基准测试,旨在评估编程智能体在真实任务上的表现。它包含涉及10多种主流编程语言的多样化软件工程任务,涵盖内部工程用例、生产事故和真实世界开源项目,重点涉及后端服务、基础设施、性能工程、系统编程、安全、前端开发以及机器学习/数据工程的全生产技术栈。 - Program Bench (https://programbench.com/) 通过要求代码生成智能体仅根据编译后的二进制文件及其文档重现程序行为来评估其能力。它包含200项任务,从小型CLI工具到FFmpeg和SQLite等大型系统。提交内容将根据超过248,000个模糊测试生成的行为测试进行评判。每项任务中,智能体会获得可执行文件及其文档,但无法获取源代码、反编译结果或互联网访问权限。它必须自行选择实现语言,从头构建完整程序,并通过行为测试套件(将其输出与原始二进制文件进行比较)的验证。 - MLS-Bench (https://mls-bench.com/) 评估AI系统能否发明可泛化且可扩展的机器学习方法。MLS-Bench-Lite是MLS-Bench官方30项任务子集,涵盖LLM预训练与后训练、机器人、世界模型、计算机视觉、强化学习、优化、机器学习系统、人工智能科学等。智能体有5小时探索时间,然后提交解决方案。Opus 4.8在Claude Code中使用最大努力设置进行评估。
- 智能体基准测试 - Kimi Claw 24/7 Bench是我们内部的基准测试,用于评估在持续性、跨日协作任务中的长周期智能体性能。它涵盖17个专业场景,共610个评估点,涉及软件工程、机器学习研究、招聘、交易、营销等领域。所有任务均通过OpenClaw框架执行。最终得分是所有评估点的平均通过率,并取3次运行的平均值。 - MCP-Atlas (https://labs.scale.com/leaderboard/mcp_atlas) 通过可扩展的MCP评估LLM在真实工具使用任务上的性能。我们遵循官方MCP-Atlas评估配置,设置了100次工具调用预算,每步最多32k个token。最终结果取3次运行的平均值。 - MCPMark-Verified 是 MCPMark (https://mcpmark.ai/) 的人工验证版本,是一个用于评估五个真实服务器环境(Notion、GitHub、文件系统、Postgres和Playwright)中MCP工具使用的基准测试。每个任务已由我们的团队和基准测试官方重新检查,并即将开源。我们遵循官方MCPMark评估配置,设置了100步工具调用预算,每步最多32k个token。最终结果取3次运行的平均值。
4. 原生INT4量化
Kimi-K2.7-Code采用了与 Kimi-K2-Thinking (https://huggingface.co/moonshotai/Kimi-K2-Thinking#4-native-int4-quantization) 相同的原生int4量化方法。
6. 模型使用
以下使用示例演示了如何调用我们的官方API。请注意,Kimi-K2.7-Code强制启用思考模式并将 preserve_thinking 设置为 True。
对于使用vLLM或SGLang部署的第三方API,请注意:
- 与视频内容的聊天是一项实验性功能,目前仅在我们的官方API中支持。 - 推荐在思考模式下将
temperature设置为1.0。 - 推荐将top_p设置为0.95。 - 不支持即时模式。
聊天补全
以下是一个简单的聊天补全脚本,展示如何在思考模式下调用K2.7-Code API。
import openai import base64 import requests def simple_chat(client: openai.OpenAI, model_name: str): messages = [ {'role': 'system', 'content': 'You are Kimi, an AI assistant created by Moonshot AI.'}, { 'role': 'user', 'content': [ {'type': 'text', 'text': 'which one is bigger, 9.11 or 9.9? think carefully.'} ], }, ] response = client.chat.completions.create( model=model_name, messages=messages, stream=False, max_tokens=4096 ) print('====== Below is reasoning content in Thinking Mode ======') print(f'reasoning content: {response.choices[0].message.reasoning}') print('====== Below is response in Thinking Mode ======') print(f'response: {response.choices[0].message.content}')
带视觉内容的聊天补全
K2.7-Code支持图像和视频输入。
以下示例演示了如何通过图像输入调用K2.7-Code API:
`` import openai import base64 import requests
def chat_with_image(client: openai.OpenAI, model_name: str): url = ‘https://huggingface.co/moonshotai/Kimi-K2.7-Code/resolve/main/figures/kimi-logo.png’ image_base64 = base64.b64encode(requests.get(url).content).decode() messages = [ { ‘role’: ‘user’, ‘content’: [ {‘type’: ‘text’, ‘text’: ‘Describe this image in detail.’}, { ‘type’: ‘image_url’, ‘image_url’: {‘url’: f’data:image/png;base64,{image_base64}’}, }, ], } ]
response = client.chat.completions.create(
model=model_name, messages=messages, stream=False, max_tokens=8192
)
print('====== Below is reasoning content in Thinking Mode ======')
print(f'reasoning content: {response.choices[0].message.reasoning}')
print('====== Below is response in Thinking Mode ======')
print(f'response: {response.choices[0].message.content}')
``
以下示例演示了如何通过视频输入调用K2.7-Code API:
`` import openai import base64 import requests
def chat_with_video(client: openai.OpenAI, model_name:str): url = ‘https://huggingface.co/moonshotai/Kimi-K2.7-Code/resolve/main/figures/demo_video.mp4’ video_base64 = base64.b64encode(requests.get(url).content).decode() messages = [ { “role”: “user”, “content”: [ {“type”: “text”,“text”: “Describe the video in detail.”}, { “type”: “video_url”, “video_url”: {“url”: f“data:video/mp4;base64,{video_base64}“}, }, ], } ]
response = client.chat.completions.create(model=model_name, messages=messages)
print('====== Below is reasoning content in Thinking Mode ======')
print(f'reasoning content: {response.choices[0].message.reasoning}')
print('====== Below is response in Thinking Mode ======')
print(f'response: {response.choices[0].message.content}')
``
保留思考内容
Kimi K2.7 Code强制启用preserve_thinking模式,该模式会在多轮交互中保留完整的推理内容,并提升编程智能体场景下的性能。
此功能默认启用且无法禁用。以下示例演示了如何在preserve_thinking模式下调用K2.7-Code API:
`` def chat_with_preserve_thinking(client: openai.OpenAI, model_name: str): messages = [ { “role”: “user”, “content”: “Tell me three random numbers.” }, { “role”: “assistant”, “reasoning_content”: “I’ll start by listing five numbers: 473, 921, 235, 215, 222, and I’ll tell you the first three.”, # Some API (e.g. vLLM) may not support reasoning_content, you can try reasoning instead “content”: “473, 921, 235” }, { “role”: “user”, “content”: “What are the other two numbers you have in mind?” } ]
response = client.chat.completions.create(
model=model_name,
messages=messages,
stream=False,
max_tokens=4096,
)
# the assistant should mention 215 and 222 that appear in the prior reasoning content
print(f"response: {response.choices[0].message.reasoning}")
return response.choices[0].message.content
``
交错思考与多步工具调用
K2.7-Code与K2 Thinking共享相同的交错思考与多步工具调用设计。使用示例请参考K2 Thinking文档 (https://platform.moonshot.ai/docs/guide/use-kimi-k2-thinking-model#complete-example)。
编程智能体框架
Kimi K2.7 Code与Kimi Code CLI作为其智能体框架配合最佳——请访问https://www.kimi.com/code 尝试。
7. 许可证
代码仓库和模型权重均根据修改版MIT许可证 (https://huggingface.co/unsloth/Kimi-K2.7-Code-GGUF/blob/main/LICENSE) 发布。
8. 第三方声明
请参阅第三方声明 (https://huggingface.co/unsloth/Kimi-K2.7-Code-GGUF/blob/main/THIRD_PARTY_NOTICES.md)
9. 联系我们
如有任何问题,请通过 [email protected] 与我们联系。
相似文章
unsloth/Kimi-K2.6-GGUF
Unsloth 推出开源 1T 参数 Kimi K2.6 MoE 模型的量化 GGUF 版本,专为长程编码、自主智能体集群及生产级设计任务优化。
Kimi K2.6 Unsloth GGUF 已发布
Unsloth 推出了 Kimi K2.6 的 GGUF 量化版本,可在本地高效推理。
unsloth/North-Mini-Code-1.0-GGUF · Hugging Face
此页面托管了Cohere的North-Mini-Code-1.0模型的GGUF量化版本,这是一个30B-A3B MoE模型,针对代码生成和代理任务进行了优化。提供了从特定PR构建llama.cpp以支持cohere2moe架构的说明。
unsloth/Qwen3.6-27B-GGUF
Unsloth 发布了 Qwen3.6-27B 模型的 GGUF 量化版本,具备更强的智能体编程能力、工具调用功能,并支持 Unsloth Studio。
unsloth/Qwen3.6-27B-MTP-GGUF
Unsloth 发布了 Qwen3.6-27B 模型的 GGUF 权重,该模型支持多令牌预测(MTP),可实现更快的生成速度并增强了智能体(Agentic)编码能力。