Moonshot AI's Kimi-K2.7-Code Slashes Reasoning Costs by 30% on 1T Open-Weight Model
Moonshot AI open-sources Kimi-K2.7-Code, a 1T-parameter coding agent that cuts reasoning token usage 30% while beating K2.6 on every benchmark

- Open-sourced: Moonshot AI released Kimi-K2.7-Code weights on Hugging Face under a Modified MIT license.
- 30% fewer reasoning tokens: The model cuts thinking-token usage by ~30% vs K2.6, reducing inference costs for agentic pipelines.
- 1T MoE architecture: 1 trillion total parameters, 32B active per token, 256K context, with a 400M MoonViT vision encoder.
- Benchmark gains over K2.6: +21.8% on Kimi Code Bench v2, +11.0% on Program Bench, +31.5% on MLS Bench Lite -- all vendor-reported.
- Pricing: $0.95/M input tokens, $4.00/M output tokens via API; free weights for self-hosting with vLLM, SGLang, or KTransformers.
- Forced thinking + preserve_thinking: Reasoning always runs and persists across turns -- great for agents, not for low-latency tasks.
Moonshot AI just shipped Kimi-K2.7-Code, and the headline isn't the benchmark numbers -- it's the token efficiency. The Beijing-based company claims the model cuts reasoning token usage by 30% compared to its predecessor, meaning developers burn through fewer compute resources while getting better results. For teams running coding agents at scale, that's a cost story, not just a capability story.
Kimi-K2.7-Code is one of the largest open-weight coding models you can download right now, packing 1 trillion total parameters, activating 32 billion of them per token, running a 256K-token context window, and shipping with open weights on Hugging Face under a Modified MIT license. The model is live on Moonshot AI's Kimi platform APIs and hosted on Hugging Face.
A model built for the long haul
This is a coding-first, agentic model, built to plan, edit files, run tools, and debug across many steps rather than to chat. The distinction matters. Most LLMs are optimized for single-turn quality. K2.7-Code is optimized for finishing things -- whole features, whole refactors, whole debugging sessions.
Real-world software engineering rarely ends in a single step. Tasks like refactoring a codebase, implementing a feature across multiple files, or debugging over long agent sessions require a model to follow instructions reliably across extended contexts, and to carry a task through to completion. That's the problem K2.7-Code is explicitly designed to solve.
The architecture under the hood
K2.7-Code is a Mixture-of-Experts model -- an architecture where a large pool of specialized sub-networks ("experts") exists, but only a small subset activates for any given input. It holds 1T total parameters and activates 32B per token, using 384 experts with 8 selected per token and 1 shared. This keeps inference costs manageable despite the massive parameter count.
Attention uses MLA (Multi-head Latent Attention), and the feed-forward path uses SwiGLU. A MoonViT vision encoder adds 400M parameters for image and video input. Unusually for a coding-first model, K2.7-Code accepts text, image, and video through that vision encoder -- so you can drop in a screenshot of a UI bug, or hand it a recorded reproduction and a stack trace in one prompt.
Preserve Thinking: the quiet innovation
One of the most practically interesting features is something called preserve_thinking. Traditional LLMs treat each turn independently -- the model's chain-of-thought doesn't carry over. K2.7-Code's Preserve Thinking mode forces the reasoning to persist. In a multi-step coding session, this means the model remembers the architectural decisions it made in turn 1 when you're asking about edge cases in turn 5.
One behavior worth noting: K2.7-Code forces thinking mode on, and you can't turn it off. The model always reasons before answering. That's a deliberate design choice, and it affects how you structure workflows and budget token spend. There's no "instant mode" -- every call goes through the reasoning loop.
What the numbers actually say
Moonshot AI reports a 21.8% gain on Kimi Code Bench v2, an 11.0% improvement on Program Bench, and a 31.5% jump on MLS Bench Lite over K2.6. On the agentic side, K2.7-Code scored 81.1 on MCP Mark Verified, a suite that tests correct tool invocation through the Model Context Protocol -- covering CI checks, ticket updates, and file edits in a single loop.
Here's how it stacks up against the closed-source competition on Moonshot's own benchmarks:
| Benchmark | 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 |
| MCP Mark Verified | 72.8 | 81.1 | 92.9 | 76.4 |
There's a caveat that matters. Every benchmark published for K2.7 so far is a Moonshot proprietary benchmark. As of the release date, there were no independent third-party results on standard public suites like SWE-bench Verified, LiveCodeBench, or GPQA Diamond. Treat the scores as vendor-reported and directional, not independently verified. That said, K2.7 beat Opus 4.8 on MCP Mark Verified (81.1 vs 76.4), suggesting better tool invocation in agentic loops.
Where it fits -- and where it doesn't
K2.7-Code is a specialist, not a generalist. The practical use-cases where it shines:
- Long-horizon software engineering -- multi-file refactors, feature implementation across a full stack, debugging sessions that span dozens of tool calls
- MCP tool-use workflows -- the 81.1 score on MCP Mark Verified translates to reliable tool invocation in production loops: CI checks, ticket updates, file edits, database queries, all coordinated through one agent
- Multimodal debugging -- documentation, screenshots, and a recorded reproduction can share one prompt; for UI bugs or visual regression work, mixing text, image, and video input in a single session is genuinely useful
- Cost-sensitive agentic pipelines -- K2.7-Code is open-source and roughly 4x cheaper than the frontier closed models on output tokens
Where it's weaker: for maximum quality, GPT-5.5 wins. Some practitioners already say the numbers do not match what they see in real repos. And the forced thinking mode means it's not the right pick for low-latency, high-throughput tasks where you need fast single-turn answers.
How to run it
Weights are on Hugging Face under a Modified MIT license, and Moonshot says K2.6 deployment patterns can be reused with vLLM, SGLang, or KTransformers. The API is OpenAI-compatible, so swapping it into existing agent frameworks is minimal friction.
Here's the fastest path to get started via the API:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_MOONSHOT_API_KEY",
base_url="https://api.moonshot.ai/v1"
)
response = client.chat.completions.create(
model="kimi-k2.7-code",
messages=[
{"role": "system", "content": "You are Kimi, an AI assistant by Moonshot AI."},
{"role": "user", "content": "Refactor this function to handle edge cases..."}
],
max_tokens=8192
)
print(response.choices[0].message.reasoning) # the thinking trace
print(response.choices[0].message.content) # the final answerAPI pricing sits at $0.95 per million input tokens, $4.00 per million output tokens, and $0.19 per million on cache hits. Weights are free on Hugging Face for self-hosting. The release also pairs with Kimi Code, Moonshot's terminal-first coding agent, with membership plans listed from $19/month.
The bigger picture
Moonshot's pivot toward open-weight model releases started with the K2 series in mid-2025. The K2 base model launched in July 2025, K2 Thinking followed in November 2025 adding enhanced reasoning capabilities, K2.5 arrived in January 2026, and K2.6 came in April 2026. Now K2.7-Code lands in June 2026 -- the fifth major release in under a year.
K2.7-Code's efficiency gains suggest Moonshot is optimizing the execution layer -- the "how" of token usage -- rather than scaling parameters. That's a meaningful strategic shift. Rather than chasing parameter counts, they're squeezing more out of the same architecture. Moonshot is not just shipping weights, it is shipping a subscription coding platform around them -- the same model-plus-plan playbook Anthropic runs with Claude Code.
On MLS Bench Lite, K2.7-Code (35.1) is now within striking distance of GPT-5.5 (35.5). Six months ago, open-source models weren't competitive on multi-language benchmarks. The gap is now measured in single-digit percentages on some tasks. Whether that translates to real-world parity is still an open question -- but the direction of travel is clear.