메뉴
HN
Hacker News 47일 전

Kimi K2.7-코드: 토큰 효율성을 높인 오픈소스 코딩 모델

IMP
7/10
핵심 요약

Moonshot AI가 토큰 효율성이 개선된 오픈소스 코딩 모델 'Kimi K2.7-Code'를 공개했습니다. 이 모델은 도구 호출(Tool call) 및 추론(Reasoning) 기능을 체계적으로 지원하는 고급 프롬프트 템플릿을 특징으로 합니다. Hugging Face 플랫폼에 게시되어 개발자들이 자유롭게 활용할 수 있습니다.

번역된 본문

이미지<|media_content|><|media_pad|><|media_end|> {% elif content['type'] == 'video' 또는 content['type']== 'video_url'-%} <|kimi_k25_video_placeholder|> {% else -%} {{ content['text'] }} {%- endif -%} {%- endfor -%} {%- endif -%} {%- endmacro -%}

{% macro set_roles(message) -%} {%- set role_name = message.get('name') 또는 message['role'] -%} {%- if message['role'] == 'user' -%} <|im_user|>{{role_name}}<|im_middle|> {%- elif message['role'] == 'assistant' -%} <|im_assistant|>{{role_name}}<|im_middle|> {%- else -%} <|im_system|>{{role_name}}<|im_middle|> {%- endif -%} {%- endmacro -%}

{%- macro render_toolcalls(message) -%} <|tool_calls_section_begin|> {%- for tool_call in message['tool_calls'] -%} {%- set formatted_id = tool_call['id'] -%} <|tool_call_begin|>{{ formatted_id }}<|tool_call_argument_begin|>{% if tool_call['function']['arguments'] is string %}{{ tool_call['function']['arguments'] }}{% else %}{{ tool_call['function']['arguments'] | tojson }}{% endif %}<|tool_call_end|> {%- endfor -%} <|tool_calls_section_end|> {%- endmacro -%}

{%- set preserve_thinking = preserve_thinking | default(true) -%} {# 마지막 비-도구-호출 어시스턴트 메시지를 찾습니다. preserve_thinking가 참이면 -1을 유지하여 기록(hist)을 비우고 모든 메시지가 접미사(suffix)를 사용하게 합니다 (추론 유지). #} {%- set ns = namespace(last_non_tool_call_assistant_msg=-1) -%} {%- if not preserve_thinking -%} {%- for idx in range(messages|length-1, -1, -1) -%} {%- if messages[idx]['role'] == 'assistant' 그리고 not messages[idx].get('tool_calls') -%} {%- set ns.last_non_tool_call_assistant_msg = idx -%} {%- break -%} {%- endif -%} {%- endfor -%} {%- endif -%}

{# 모든 메시지를 기록(hist)과 접미사(suffix)로 분할하며, 접미사의 reasoning_content는 보존되어야 합니다.#} {%- set hist_msgs = messages[:ns.last_non_tool_call_assistant_msg+1] -%} {%- set suffix_msgs = messages[ns.last_non_tool_call_assistant_msg+1:] -%}

{%- if tools -%} {%- if tools_ts_str -%} <|im_system|>tool_declare<|im_middle|>{{ tools_ts_str }}<|im_end|> {%- else -%} <|im_system|>tool_declare<|im_middle|>{{ tools | tojson(separators=(',', ':')) }}<|im_end|> {%- endif -%} {%- endif -%}

{%- for message in hist_msgs -%} {{set_roles(message)}} {%- if message['role'] == 'assistant' -%} ڒ {{render_content(message)}} {%- if message.get('tool_calls') -%} {{render_toolcalls(message)}} {%- endif -%} {%- elif message['role'] == 'tool' -%} {%- set tool_call_id = message.tool_call_id -%}

{{ tool_call_id }}의 반환

{{render_content(message)}} {%- elif message['content'] is not none -%} {{render_content(message)}} {%- endif -%} <|im_end|> {%- endfor -%}

{%- for message in suffix_msgs -%} {{set_roles(message)}} {%- if message['role'] == 'assistant' -%} {%- if thinking is defined 그리고 thinking is false 그리고 preserve_thinking is false -%} ڒ {{render_content(message)}} {%- else -%} {%- set rc = message.get('reasoning', message.get('reasoning_content', '')) -%} ڒ{{rc}} {{render_content(message)}} {%- endif -%} {%- if message.get('tool_calls') -%} {{render_toolcalls(message)}} {%- endif -%} {%- elif message['role'] == 'tool' -%} {%- set tool_call_id = message.tool_call_id -%}

{{ tool_call_id }}의 반환

{{render_content(message)}} {%- elif message['content'] is not none -%} {{render_content(message)}} {%- endif -%} <|im_end|> {%- endfor -%}

{%- if add_generation_prompt -%} <|im_assistant|>assistant<|im_middle|> {%- if thinking is defined 그리고 thinking is false -%} ڒ {%- else -%} ڒ {%- endif -%} {%- endif -%}


[모델 메타데이터]

  • 생성일시: 2026-06-11T07:51:47.000Z
  • 토론 비활성화: 아니오
  • 토론 정렬: 최근 생성순
  • 다운로드: 0
  • 전체 기간 다운로드: 0
  • 모델 ID: moonshotai/Kimi-K2.7-Code
  • 사용자 좋아요 여부: 아니오
  • 인퍼런스 제공자: 없음
  • HuggingChat 항목 표시: 아니오
  • 인퍼런스:
  • 최종 수정일: 2026-06-12T10:05:55.000Z
  • 좋아요: 111
  • Pip:
원문 보기
원문 보기 (영어)
image<|media_content|><|media_pad|><|media_end|>\n {% elif content['type'] == 'video' or content['type']== 'video_url'-%}\n <|kimi_k25_video_placeholder|>\n {% else -%}\n {{ content['text'] }}\n {%- endif -%}\n {%- endfor -%}\n {%- endif -%}\n{%- endmacro -%}\n\n{% macro set_roles(message) -%}\n {%- set role_name = message.get('name') or message['role'] -%}\n {%- if message['role'] == 'user' -%}\n <|im_user|>{{role_name}}<|im_middle|>\n {%- elif message['role'] == 'assistant' -%}\n <|im_assistant|>{{role_name}}<|im_middle|>\n {%- else -%}\n <|im_system|>{{role_name}}<|im_middle|>\n {%- endif -%}\n{%- endmacro -%}\n\n\n{%- macro render_toolcalls(message) -%}\n <|tool_calls_section_begin|>\n {%- for tool_call in message['tool_calls'] -%}\n {%- set formatted_id = tool_call['id'] -%}\n <|tool_call_begin|>{{ formatted_id }}<|tool_call_argument_begin|>{% if tool_call['function']['arguments'] is string %}{{ tool_call['function']['arguments'] }}{% else %}{{ tool_call['function']['arguments'] | tojson }}{% endif %}<|tool_call_end|>\n {%- endfor -%}\n <|tool_calls_section_end|>\n{%- endmacro -%}\n\n\n{%- set preserve_thinking = preserve_thinking | default(true) -%}\n{# Find last non-tool-call assistant message. If preserve_thinking, keep -1 so hist is empty and all msgs use suffix (retain reasoning). #}\n{%- set ns = namespace(last_non_tool_call_assistant_msg=-1) -%}\n{%- if not preserve_thinking -%}\n{%- for idx in range(messages|length-1, -1, -1) -%}\n {%- if messages[idx]['role'] == 'assistant' and not messages[idx].get('tool_calls') -%}\n {%- set ns.last_non_tool_call_assistant_msg = idx -%}\n {%- break -%}\n {%- endif -%}\n{%- endfor -%}\n{%- endif -%}\n\n{# split all messages into history & suffix, reasoning_content in suffix should be reserved.#}\n{%- set hist_msgs = messages[:ns.last_non_tool_call_assistant_msg+1] -%}\n{%- set suffix_msgs = messages[ns.last_non_tool_call_assistant_msg+1:] -%}\n\n{%- if tools -%}\n {%- if tools_ts_str -%}\n <|im_system|>tool_declare<|im_middle|>{{ tools_ts_str }}<|im_end|>\n {%- else -%}\n <|im_system|>tool_declare<|im_middle|>{{ tools | tojson(separators=(',', ':')) }}<|im_end|>\n {%- endif -%}\n{%- endif -%}\n\n \n{%- for message in hist_msgs -%}\n {{set_roles(message)}}\n {%- if message['role'] == 'assistant' -%}\n <think></think>{{render_content(message)}}\n {%- if message.get('tool_calls') -%}\n {{render_toolcalls(message)}}\n {%- endif -%}\n {%- elif message['role'] == 'tool' -%}\n {%- set tool_call_id = message.tool_call_id -%}\n ## Return of {{ tool_call_id }}\n{{render_content(message)}}\n {%- elif message['content'] is not none -%}\n {{render_content(message)}}\n {%- endif -%}\n <|im_end|>\n{%- endfor -%}\n\n{%- for message in suffix_msgs -%}\n {{set_roles(message)}}\n {%- if message['role'] == 'assistant' -%}\n {%- if thinking is defined and thinking is false and preserve_thinking is false -%}\n <think></think>{{render_content(message)}}\n {%- else -%}\n {%- set rc = message.get('reasoning', message.get('reasoning_content', '')) -%}\n <think>{{rc}}</think>{{render_content(message)}}\n {%- endif -%}\n {%- if message.get('tool_calls') -%}\n {{render_toolcalls(message)}}\n {%- endif -%}\n {%- elif message['role'] == 'tool' -%}\n {%- set tool_call_id = message.tool_call_id -%}\n ## Return of {{ tool_call_id }}\n{{render_content(message)}}\n {%- elif message['content'] is not none -%}\n {{render_content(message)}}\n {%- endif -%}\n <|im_end|>\n{%- endfor -%}\n\n\n{%- if add_generation_prompt -%}\n <|im_assistant|>assistant<|im_middle|>\n {%- if thinking is defined and thinking is false -%}\n <think></think>\n {%- else -%}\n <think>\n {%- endif -%}\n{%- endif -%}"},"createdAt":"2026-06-11T07:51:47.000Z","discussionsDisabled":false,"discussionsSorting":"recently-created","downloads":0,"downloadsAllTime":0,"id":"moonshotai/Kimi-K2.7-Code","isLikedByUser":false,"availableInferenceProviders":[],"showHuggingChatEntry":false,"inference":"","lastModified":"2026-06-12T10:05:55.000Z","likes":111,"pipeline_tag":"image-text-to-text","library_name":"transformers","librariesOther":[],"trackDownloads":true,"model-index":null,"private":false,"repoType":"model","gated":false,"tags":["transformers","safetensors","kimi_k25","image-feature-extraction","compressed-tensors","image-text-to-text","conversational","custom_code","license:other","region:us"],"tag_objs":[{"id":"image-text-to-text","label":"Image-Text-to-Text","type":"pipeline_tag","subType":"multimodal"},{"id":"transformers","label":"Transformers","type":"library"},{"id":"safetensors","label":"Safetensors","type":"library"},{"id":"kimi_k25","label":"kimi_k25","type":"other","clickable":true},{"id":"image-feature-extraction","label":"image-feature-extraction","type":"other","clickable":true},{"id":"compressed-tensors","label":"compressed-tensors","type":"other","clickable":true},{"id":"conversational","label":"conversational","type":"other","clickable":true},{"id":"custom_code","label":"custom_code","type":"other","clickable":true},{"id":"license:other","label":"other","type":"license"},{"type":"region","label":"🇺🇸 Region: US","id":"region:us"}],"transformersInfo":{"auto_model":"AutoModel","custom_class":"modeling_kimi_k25.KimiK25ForConditionalGeneration","pipeline_tag":"image-feature-extraction"},"widgetData":[{"text":"Hi, what can you help me with?"},{"text":"What is 84 * 3 / 2?"},{"text":"Tell me an interesting fact about the universe!"},{"text":"Explain quantum computing in simple terms."}],"safetensors":{"parameters":{"BF16":43902267888,"F32":23040,"I32":1014687129600},"total":1058589420528,"sharded":true,"totalFileSize":595201585646},"hasBlockedOids":false,"region":"us","isQuantized":false,"licenseFilePath":"LICENSE"},"discussionsStats":{"closed":0,"open":0,"total":0},"query":{},"inferenceContextData":{"billableEntities":[],"entityName2Providers":{}},"hasQuantizations":false,"copyToBucketNamespaces":[]}"> 1. Model Introduction Kimi K2.7 Code is a coding-focused agentic model built upon Kimi K2.6. With substantial improvements on real-world long-horizon coding tasks, it strengthens end-to-end task completion across complex software engineering workflows while improving token efficiency, reducing thinking-token usage by approximately 30% compared with Kimi K2.6. 2. Model Summary 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 3. Evaluation Results 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 Footnotes General Testing Details Unless stated otherwise, Kimi K2.7 Code and K2.6 were tested with thinking mode enabled via Kimi Code CLI at temperature = 1.0, top-p = 0.95, and a 262,144-token context length; GPT-5.5 ran in Codex with xhigh mode, and Opus 4.8 in Claude Code with xhigh mode. Aside from these differences, all benchmarks were evaluated under the same conditions. Coding Benchmarks Kimi Code Bench V2 is our in-house benchmark designed to evaluate coding agents on realistic tasks. It has diversed software engineering tasks across 10+ mainstream programming languages and a full production tech stack covering tasks from internal engineering use cases, production incidents, and real-world open-source projects, with emphasis on backend services, infrastructure, performance engineering, systems programming, security, frontend development, and ML/data engineering. Program Bench evaluates code-generation agents
관련 소식