Kimi K2.7 Code: 1T Open-Source Coding Model Released

Updated June 2026  ยท  By Jarrod Gravison

Quick Answer: Kimi K2.7 Code is a new open-weight coding model from Moonshot AI with 1 trillion parameters (32B active), a 256K-token context window, and a Modified MIT license. It uses 30% fewer thinking tokens than K2.6, scores 81.1% on MCP Mark Verified (beating Claude Opus 4.8’s 76.4%), and costs $0.95/$4.00 per million tokens via API.

If you run agentic coding pipelines, you know the pain: reasoning tokens eat your budget, long context windows balloon latency, and finding an open-source model that keeps up with the paid flagships feels like chasing a moving target. Moonshot AI just released Kimi K2.7 Code on June 12, 2026, and it changes the math. This is a 1-trillion-parameter Mixture-of-Experts model built specifically for long-horizon coding tasks, available on Hugging Face under a Modified MIT license that permits commercial use. The model is live on Hugging Face at moonshotai/Kimi-K2.7-Code and accessible via the Kimi API and ModelScope.

What is Kimi K2.7 Code and why does it matter?

Kimi K2.7 Code is Moonshot AI’s latest iteration in the K2 family, and calling it “another open-source model” undersells what it brings. Built on a 1-trillion-parameter Mixture-of-Experts backbone (384 experts, 8 activated per token, 32B active), this model cuts thinking token usage by roughly 30% compared to K2.6 while posting double-digit gains on every internal coding benchmark. That efficiency improvement is the headline: for teams running autonomous coding agents, the 30% reduction in reasoning tokens translates directly into lower costs and faster task completion. The model forces “think before you answer” mode with a preserve_thinking feature that retains the full chain of thought across multi-turn conversations, which matters enormously for complex debugging and refactoring tasks where context from earlier steps informs later decisions. Released under a Modified MIT license on Hugging Face, K2.7 Code is available for commercial use with attribution, putting frontier-level coding capability within reach of any developer willing to run it.

How does K2.7 Code compare to K2.6 on benchmarks?

  • Kimi Code Bench v2 โ€” K2.7 Code scored 62.0, a +21.8% jump from K2.6’s 50.9. This is Moonshot’s in-house coding benchmark covering realistic, multi-file software engineering tasks.

  • Program Bench โ€” K2.7 Code scored 53.6 versus K2.6’s 48.3, an 11.0% improvement on real-world programming task completion.

  • MLS Bench Lite โ€” The standout: K2.7 jumped from 26.7 to 35.1, a 31.5% gain in multi-language support (Python, Rust, Go, and more), effectively catching up to GPT-5.5’s 35.5.

  • MCP Mark Verified โ€” K2.7 Code reached 81.1%, beating Claude Opus 4.8’s 76.4% on tool-use benchmarks. Only GPT-5.5 scored higher at 92.9%.

The caveat: all these benchmarks are Moonshot-reported. Independent third-party numbers on SWE-bench Verified, LiveCodeBench, and GPQA Diamond are not yet available as of this writing. That said, K2.6 had competitive SWE-bench results (~80% by some reports), and K2.7 Code’s consistency across all five reported benchmarks suggests real improvement.

What architecture powers K2.7 Code?

K2.7 Code uses a Mixture-of-Experts (MoE) transformer with 61 layers (1 dense, 60 MoE). The 384 experts are selected via learned routing: 8 experts plus 1 shared expert activate per token, keeping inference efficient despite the 1T total parameter count. The attention mechanism is MLA (Multi-head Latent Attention), which compresses the key-value cache using learned latent projections โ€” critical for fitting that 256K context window in memory. It uses SwiGLU activation, a 160K vocabulary, and MuonClip-stabilized training. The MoonViT vision encoder (400M parameters) enables multimodal input for tasks involving code screenshots or diagrams. Recommended inference engines include vLLM, SGLang, and KTransformers, and INT4 quantized versions are available for reduced memory footprint.

What does K2.7 Code cost and who can use it?

The model weights are free under a Modified MIT license โ€” you can download, modify, and deploy K2.7 Code commercially as long as you provide attribution. For API access, Moonshot charges $0.95 per million input tokens and $4.00 per million output tokens, with automatic context caching dropping the input cost to $0.19 per million on cache hits. Compared to Claude Opus 4.6’s $5/$25 rates and GPT-5.5’s $1.75/$14, K2.7 Code is roughly 5x cheaper than Anthropic’s flagship and competitive with Google’s Gemini 3 Flash ($0.50/$3.00). The Kimi Code CLI offers a limited free tier, and the Vercel AI Gateway also hosts K2.7 Code with $5 in free credits for new users.

How does K2.7 Code change the open-source coding landscape?

The open-source coding model space was already heating up in 2026 with DeepSeek V4, Qwen3.5, GLM-5, and Mistral Small 4 all competing. K2.7 Code enters as arguably the strongest open-weight model specifically tuned for agentic coding โ€” where the model uses tools, calls APIs, edits files across multiple locations, and maintains context across hours-long sessions. The preserve_thinking mode, the 30% token efficiency gain, and the MCP benchmark lead over Claude Opus 4.8 are all signals that open-source coding is no longer playing catch-up. For developers who value control over their stack โ€” running models on their own hardware, paying per token at API rates, or self-hosting on multi-GPU setups โ€” K2.7 Code is the most compelling open-coding option available as of June 2026. The Modified MIT license also removes the legal ambiguity that sometimes plagues open-weight model licensing.

How do you get started with Kimi K2.7 Code?

Getting started is straightforward if you have experience with the K2 series or OpenAI-compatible APIs. The Kimi API is fully compatible with the OpenAI SDK format. For local deployment, the model requires substantial hardware โ€” roughly 64GB+ VRAM at FP16, achievable on setups like 4x RTX 4090 or 2x A100. Recommended engines are vLLM (for best performance) and SGLang (for flexibility). Quick start via API:

pip install openai from openai import OpenAI client = OpenAI( api_key=“your_key”, base_url=“https://api.kimi.ai/v1" ) response = client.chat.completions.create( model=“kimi-k2.7-code”, messages=[{“role”:“user”,“content”:“Write a Python script to scrape a website and extract all external links”}] )

For local deployment, check the Hugging Face model card for the latest inference engine compatibility and quantization guides. The model is also available through the Vercel AI Gateway for teams already on the Vercel ecosystem.

Key Takeaways

  • Kimi K2.7 Code is an open-source 1T-parameter MoE model released June 12, 2026 with 32B active parameters per token and a token efficiency improvement that cuts reasoning costs by 30%.

  • It beats Claude Opus 4.8 on MCP Mark Verified (81.1% vs 76.4%) and nearly matches GPT-5.5 on MLS Bench Lite, all while being about 5x cheaper at API rates.

  • All benchmarks are currently Moonshot-reported and lack independent third-party verification, but the consistent double-digit gains across five different metrics strengthen the case for real improvement.

  • The model ships with a mandatory preserve_thinking mode that retains full chain-of-thought across multi-turn conversations, purpose-built for complex agentic coding workflows.

  • Available under a Modified MIT license, K2.7 Code offers commercial use with attribution and costs $0.95/$4.00 per million tokens via API with free local deployment for those with the hardware.

Frequently Asked Questions

What is Kimi K2.7 Code?

Kimi K2.7 Code is Moonshot AI’s latest open-source Mixture-of-Experts coding model released June 12, 2026. It has 1 trillion total parameters with 32 billion active per token, a 256K context window, and a Modified MIT license. It is purpose-built for coding, agentic tool use, and long-horizon software engineering workflows.

How much does Kimi K2.7 Code cost to use via API?

Kimi K2.7 Code API pricing is $0.95 per million input tokens and $4.00 per million output tokens. Cache hits drop the input cost to $0.19 per million. This is roughly 5x cheaper than Claude Opus 4.8, and the 30% reduction in thinking tokens per task lowers effective cost further compared to K2.6.

Is Kimi K2.7 Code free to use?

Yes, the model weights are open-source under a Modified MIT license, so you can download and run Kimi K2.7 Code locally for free on compatible hardware. You can also try it for free via the Kimi Code CLI or the kimi-k2.7-code endpoint with limited free credits on the Kimi API platform.

How does Kimi K2.7 Code compare to K2.6?

Kimi K2.7 Code uses roughly 30% fewer thinking tokens than K2.6 while scoring higher across all coding benchmarks. It gained +11.1 points on Kimi Code Bench v2 (50.9 to 62.0), +11.0% on Program Bench, and +31.5% on MLS Bench Lite. It also introduces mandatory preserve_thinking mode for multi-turn reasoning continuity.

Can I run Kimi K2.7 Code locally on my own hardware?

Yes, but it requires significant hardware. The full model needs approximately 64GB+ VRAM at FP16. Recommended inference engines include vLLM, SGLang, and KTransformers. INT4 quantized versions are available to reduce memory requirements, and the model has been demonstrated running on multi-GPU setups with 4x RTX 4090 or similar configurations.

Compare Open-Source Coding Models โ†’ More Open Source AI