πŸ“‹ Model Description


tags:
  • unsloth
base_model:
  • moonshotai/Kimi-K2-Instruct-0905
license: other license_name: modified-mit library_name: transformers

Learn how to run Kimi-K2 Dynamic GGUFs - Read our Guide!

Unsloth Dynamic 2.0 achieves superior accuracy & outperforms other leading quants.

πŸŒ™ Kimi K2 Usage Guidelines

It is recommended to have at least 128GB unified RAM memory to run the small quants. With 16GB VRAM and 256 RAM, expect 5+ tokens/sec.
For best results, use any 2-bit XL quant or above.

Set the temperature to 0.6 recommended) to reduce repetition and incoherence.



Chat
github
Homepage


Hugging Face
Twitter Follow
Discord


License


πŸ“°  Tech Blog     |     πŸ“„  Paper

1. Model Introduction

Kimi K2-Instruct-0905 is the latest, most capable version of Kimi K2. It is a state-of-the-art mixture-of-experts (MoE) language model, featuring 32 billion activated parameters and a total of 1 trillion parameters.

Key Features

  • Enhanced agentic coding intelligence: Kimi K2-Instruct-0905 demonstrates significant improvements in performance on public benchmarks and real-world coding agent tasks.
  • Improved frontend coding experience: Kimi K2-Instruct-0905 offers advancements in both the aesthetics and practicality of frontend programming.
  • Extended context length: Kimi K2-Instruct-0905’s context window has been increased from 128k to 256k tokens, providing better support for long-horizon tasks.

2. Model Summary

ArchitectureMixture-of-Experts (MoE)
Total Parameters1T
Activated Parameters32B
Number of Layers (Dense layer included)61
Number of Dense Layers1
Attention Hidden Dimension7168
MoE Hidden Dimension (per Expert)2048
Number of Attention Heads64
Number of Experts384
Selected Experts per Token8
Number of Shared Experts1
Vocabulary Size160K
Context Length256K
Attention MechanismMLA
Activation FunctionSwiGLU

3. Evaluation Results

BenchmarkMetricK2-Instruct-0905K2-Instruct-0711Qwen3-Coder-480B-A35B-InstructGLM-4.5DeepSeek-V3.1Claude-Sonnet-4Claude-Opus-4
SWE-Bench verifiedACC69.2 Β± 0.6365.869.664.266.072.772.5*
SWE-Bench MultilingualACC55.9 Β± 0.7247.354.752.754.553.3*-
Multi-SWE-BenchACC33.5 Β± 0.2831.332.731.729.035.7-
Terminal-BenchACC44.5 Β± 2.0337.537.539.931.336.443.2*
SWE-DevACC66.6 Β± 0.7261.964.763.253.367.1-

All K2-Instruct-0905 numbers are reported as mean Β± std over five independent, full-test-set runs.
Before each run we prune the repository so that every Git object unreachable from the target commit disappears; this guarantees the agent sees only the code that would legitimately be available at that point in history.

Except for Terminal-Bench (Terminus-2), every result was produced with our in-house evaluation harness. The harness is derived from SWE-agent, but we clamp the context windows of the Bash and Edit tools and rewrite the system prompt to match the task semantics. All baseline figures denoted with an asterisk (*) are excerpted directly from their official report or public leaderboard; the remaining metrics were evaluated by us under conditions identical to those used for K2-Instruct-0905.

For SWE-Dev we go one step further: we overwrite the original repository files and delete any test file that exercises the functions the agent is expected to generate, eliminating any indirect hints about the desired implementation.

4. Deployment

[!Note]

You can access Kimi K2's API on https://platform.moonshot.ai , we provide OpenAI/Anthropic-compatible API for you.

>

The Anthropic-compatible API maps temperature by realtemperature = requesttemperature * 0.6 for better compatible with existing applications.

Our model checkpoints are stored in the block-fp8 format, you can find it on Huggingface.

Currently, Kimi-K2 is recommended to run on the following inference engines:

  • vLLM
  • SGLang
  • KTransformers
  • TensorRT-LLM

Deployment examples for vLLM and SGLang can be found in the Model Deployment Guide.


5. Model Usage

Chat Completion

Once the local inference service is up, you can interact with it through the chat endpoint:

def simplechat(client: OpenAI, modelname: str):
    messages = [
        {"role": "system", "content": "You are Kimi, an AI assistant created by Moonshot AI."},
        {"role": "user", "content": [{"type": "text", "text": "Please give a brief self-introduction."}]},
    ]
    response = client.chat.completions.create(
        model=model_name,
        messages=messages,
        stream=False,
        temperature=0.6,
        max_tokens=256
    )
    print(response.choices[0].message.content)

[!NOTE]

The recommended temperature for Kimi-K2-Instruct-0905 is temperature = 0.6.

If no special instructions are required, the system prompt above is a good default.


Tool Calling

Kimi-K2-Instruct-0905 has strong tool-calling capabilities.
To enable them, you need to pass the list of available tools in each request, then the model will autonomously decide when and how to invoke them.

The following example demonstrates calling a weather tool end-to-end:

# Your tool implementation
def get_weather(city: str) -> dict:
    return {"weather": "Sunny"}

Tool schema definition

tools = [{ "type": "function", "function": { "name": "get_weather", "description": "Retrieve current weather information. Call this when the user asks about the weather.", "parameters": { "type": "object", "required": ["city"], "properties": { "city": { "type": "string", "description": "Name of the city" } } } } }]

Map tool names to their implementations

tool_map = { "getweather": getweather } def toolcallwithclient(client: OpenAI, modelname: str): messages = [ {"role": "system", "content": "You are Kimi, an AI assistant created by Moonshot AI."}, {"role": "user", "content": "What's the weather like in Beijing today? Use the tool to check."} ] finish_reason = None while finishreason is None or finishreason == "tool_calls": completion = client.chat.completions.create( model=model_name, messages=messages, temperature=0.6, tools=tools, # tool list defined above tool_choice="auto" ) choice = completion.choices[0] finishreason = choice.finishreason if finishreason == "toolcalls": messages.append(choice.message) for toolcall in choice.message.toolcalls: toolcallname = tool_call.function.name toolcallarguments = json.loads(tool_call.function.arguments) toolfunction = toolmap[toolcallname] toolresult = toolfunction(toolcallarguments) print("toolresult:", toolresult) messages.append({ "role": "tool", "toolcallid": tool_call.id, "name": toolcallname, "content": json.dumps(tool_result) }) print("-" * 100) print(choice.message.content)

The toolcallwith_client function implements the pipeline from user query to tool execution.
This pipeline requires the inference engine to support Kimi-K2’s native tool-parsing logic.
For more information, see the Tool Calling Guide.


6. License

Both the code repository and the model weights are released under the Modified MIT License.


7. Third Party Notices

See THIRD PARTY NOTICES


7. Contact Us

If you have any questions, please reach out at [email protected].

πŸ“‚ GGUF File List

No GGUF files available