Qualcomm to Acquire Modular. Read More →

Kimi K2.7 Code logo

Kimi K2.7 Code

Kimi K2.7 Code is Moonshot AI's coding-focused agentic model, built on the Kimi K2.6 architecture. It shares the same 1T-parameter Mixture-of-Experts design (32B active per token, 384 experts, MLA attention) with a MoonViT vision encoder and a 256K-token context window. K2.7 Code delivers substantial gains on real-world long-horizon software engineering tasks while reducing thinking-token usage by approximately 30% compared with K2.6. Thinking and preserve_thinking are always enabled for consistent reasoning across multi-turn agentic sessions.

Example Usage

Output

  Speculative decoding uses a smaller draft model to predict multiple
  tokens ahead, then verifies them against the full model in a single
  pass. Accepted tokens skip individual generation steps, improving
  throughput without sacrificing accuracy. It's most effective when the
  draft model closely matches the target model's distribution.
Code to use
Python

  from openai import OpenAI
  
  client = OpenAI(
      base_url="https://model.api.modular.com",
      api_key="<your_api_token>",
  )
  
  response = client.chat.completions.create(
      model="moonshotai/Kimi-K2.7-Code",
      messages=[
          {"role": "system", "content": "You are a helpful assistant."},
          {"role": "user", "content": "Explain speculative decoding in 3 sentences."},
      ],
      stream=True,
  )
  
  for chunk in response:
      if chunk.choices[0].delta.content:
          print(chunk.choices[0].delta.content, end="")
Output

  “The image shows a fox wearing a backpack in a forest.”
Input image
Cute orange cartoon fox with a small brown backpack sitting on grass in a bright, colorful forest.
Code to use

  import base64
  from openai import OpenAI
  
  client = OpenAI(
      base_url="https://model.api.modular.com",
      api_key="<your_api_token>",
  )
  
  with open("fox.png", "rb") as image_file:
      image_data = base64.b64encode(image_file.read()).decode("utf-8")
  
  response = client.chat.completions.create(
      model="moonshotai/Kimi-K2.7-Code",
      messages=[
          {
              "role": "user",
              "content": [
                  {
                      "type": "text",
                      "text": "Describe this image in one sentence.",
                  },
                  {
                      "type": "image_url",
                      "image_url": {
                          "url": f"data:image/png;base64,{image_data}"
                      },
                  },
              ],
          }
      ],
  )
  
  print(response.choices[0].message.content)
Model Details
  • Developed by
    Moonshot AI
  • Model family
    moonshotai/Kimi-K2.7-Code
  • Modality
    LLM,
    Vision,
  • Context Window
    256K
  • Total Params
    1T
  • Precision
    INT4
  • Deployment options
    Shared, Dedicated, Self-hosted

Why choose Kimi K2.7 Code on Modular?

  • High performance, out of the box

    Run leading open models with strong default performance and the ability to optimize down to the kernel — extracting more from every GPU.

  • Lower Infrastructure Costs

    Deploy efficiently across NVIDIA and AMD hardware to reduce GPU count, increase throughput, and avoid expensive closed-model licensing.

  • Easy Integration

    Integrate through an OpenAI-compatible endpoint, swap models freely, and scale across clouds or hardware without redesigning your application stack.

Kimi K2.7 Code
Want to self-host this model with our open source infrastructure?
Read How

🔥 Trending models

Similar models

Get started with Modular

  • Request a demo

    Schedule a demo of Modular and explore a custom end-to-end deployment built around your models, hardware, and performance goals.

    • Distributed, large-scale online inference endpoints

    • Highest-performance to maximize ROI and latency

    • Deploy in Modular cloud or your cloud

    • View all features with a custom demo

    Book a demo

    Talk with our sales lead Jay!

    30min demo.  Evaluate with your workloads.  Ask us anything.

  • Talk to us!

    Book a demo for a personalized walkthrough of Modular in your environment. Learn how teams use it to simplify systems and tune performance at scale.

    • Custom 30 min walkthrough of our platform

    • Cover specific model or deployment needs

    • Flexible pricing to fit your specific needs

    Book a demo

    Talk with our sales lead Jay!

  • Start using MAX

    ( FREE )

    Run any open source model in 5 minutes, then benchmark it. Scale it to millions yourself (for free!).

  • Start using Mojo

    ( FREE )

    Install Mojo and get up and running in minutes. A simple install, familiar tooling, and clear docs make it easy to start writing code immediately.