> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/zh/mo-xing/tutorials/kimi-k2.5.md).

# Kimi K2.5：本地运行指南

关于在你自己的本地设备上运行 Kimi-K2.5 的指南！

Kimi-K2.5 是 Moonshot 推出的新模型，在视觉、编码、代理和聊天任务上达到了 SOTA 性能。这个 1T 参数的混合推理模型需要 600GB 磁盘空间，而量化的 **Unsloth 动态 1.8-bit** 版本将其减少到 240GB（-60% 大小）**:** [**Kimi-K2.5-GGUF**](https://huggingface.co/unsloth/Kimi-K2.5-GGUF)

所有上传都使用 Unsloth [Dynamic 2.0](/docs/zh/ji-chu/dynamic-3.0-ggufs.md) 用于实现 SOTA 的 Aider 和 5-shot MMLU 性能。看看我们的动态 1–2 bit GGUF 在 [编码基准](/docs/zh/ji-chu/dynamic-3.0-ggufs/unsloth-dynamic-ggufs-on-aider-polyglot.md).

### :gear: 推荐要求

{% hint style="info" %}
你需要 >**240GB 磁盘空间** 才能运行 1-bit 量化！

为获得最佳性能，请确保你的可用总内存（VRAM + 系统 RAM）大于你下载的量化模型文件大小。如果不满足，llama.cpp 仍可通过 SSD/HDD 卸载运行，但推理速度会更慢。
{% endhint %}

如果你将所有 MoE 层卸载到系统 RAM（或高速 SSD），1.8-bit（UD-TQ1\_0）量化可在单张 24GB GPU 上运行。配备约 256GB RAM 时，预计约 10 token/s。完整的 Kimi K2.5 模型为 630GB，通常至少需要 4× H200 GPU。

如果模型能放得下，使用 B200 时你将获得 >40 token/s。

要以接近 **全精度**运行模型，你可以使用 4-bit 或 5-bit 量化。为了稳妥起见，你也可以使用更高位数。

对于强性能，建议使用 >240GB 的统一内存（或 RAM+VRAM 总和）以达到 10+ token/s。如果低于这个值，也能运行，但速度会下降（llama.cpp 仍可通过 mmap/磁盘卸载运行），并且可能从约 10 token/s 降到 <2 token/s。

我们推荐 UD-Q2\_K\_XL（375GB），它在大小和质量之间有不错的平衡。经验法则是：RAM+VRAM ≈ 量化大小；否则仍然可以运行，只是由于卸载会更慢。

## 🥝 运行 Kimi K2.5 指南

Kimi-K2.5 需要针对不同用例使用不同的采样参数。

目前没有 **视觉支持** 但希望 llama.cpp 很快会支持。

{% hint style="success" %}
**要以全精度运行模型，你只需使用 4-bit 或 5-bit Dynamic GGUF（例如 UD\_Q4\_K\_XL），因为该模型最初以 INT4 格式发布。**

你可以选择更高位数的量化，以防少量量化差异带来问题，但在大多数情况下这并不必要。
{% endhint %}

### 🌙 使用指南：

根据 Moonshot AI，以下是 Kimi K2.5 推理的推荐设置：

| 默认设置（即时模式）                                                         | 思考模式                                                               |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| <mark style="background-color:green;">**temperature = 0.6**</mark> | <mark style="background-color:green;">**temperature = 1.0**</mark> |
| <mark style="background-color:green;">**top\_p = 0.95**</mark>     | <mark style="background-color:green;">**top\_p = 0.95**</mark>     |
| min\_p = 0.01                                                      | min\_p = 0.01                                                      |

* 将 **温度设为 1.0** 以减少重复和不连贯。
* 建议上下文长度 = 98,304（最高可达 256K）
* 注意：使用不同工具可能需要不同设置

{% hint style="info" %}
我们建议将 <mark style="background-color:green;">**min\_p 设为 0.01**</mark> 以抑制概率较低的不太可能出现的 token。而且 **禁用或将 repeat penalty = 1.0** 如有需要。
{% endhint %}

#### Kimi K2.5 的聊天模板

运行 `tokenizer.apply_chat_template([{"role": "user", "content": "1+1 等于多少？"},])` 会得到：

{% code overflow="wrap" %}

```
<|im_system|>system<|im_middle|>你是 Kimi，一款由 Moonshot AI 创建的 AI 助手。<|im_end|><|im_user|>user<|im_middle|>1+1 等于多少？<|im_end|><|im_assistant|>assistant<|im_middle|><think>
```

{% endcode %}

#### 🦥 在 Unsloth Studio 中运行 Kimi-K2.5

Kimi-K2.5 可以运行在 [Unsloth Studio](/docs/zh/xin/studio.md)，这是我们新的本地 AI 开源 Web UI。借助 Unsloth Studio，你可以在本地运行模型，支持 **MacOS、Windows**、Linux 以及：

{% columns %}
{% column %}

* 搜索、下载、 [运行 GGUF](/docs/zh/xin/studio.md#run-models-locally) 和 safetensor 模型
* [**自我修复** 工具调用](/docs/zh/xin/studio.md#execute-code--heal-tool-calling) + **网页搜索**
* [**代码执行**](/docs/zh/xin/studio.md#run-models-locally) （Python、Bash）
* [自动推理](https://unsloth.ai/docs/desktop#feature-deep-dive) 参数调优（temp、top-p 等）
* 通过 llama.cpp 实现快速 CPU + GPU 推理
* [训练 LLM](/docs/zh/xin/studio.md#no-code-training) 速度快 2 倍，VRAM 占用减少 70%
  {% endcolumn %}

{% column %}

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FFeQ0UUlnjXkDdqhcWglh%2Fskinny%20studio%20chat.png?alt=media&amp;token=c2ee045f-c243-4024-a8e4-bb4dbe7bae79" alt=""><figcaption></figcaption></figure></div>
{% endcolumn %}
{% endcolumns %}

{% stepper %}
{% step %}
**安装 Unsloth**

在终端中运行：

MacOS、Linux、WSL：

```bash
curl -fsSL https://unsloth.ai/install.sh | sh
```

Windows PowerShell：

```bash
irm https://unsloth.ai/install.ps1 | iex
```

{% hint style="success" %}
**安装会很快，约需 1-2 分钟。**
{% endhint %}
{% endstep %}

{% step %}
**启动 Unsloth**

MacOS、Linux、WSL 和 Windows：

```bash
unsloth studio -H 0.0.0.0 -p 8888
```

然后打开 `http://localhost:8888` 在你的浏览器中。
{% endstep %}

{% step %}
**搜索并下载 Kimi-K2.5**

首次启动时，你需要创建一个密码来保护你的账户，并在稍后重新登录。随后你会看到一个简短的引导向导，用于选择模型、数据集和基本设置。你可以随时跳过，直接进入聊天。

然后前往 [Unsloth Chat](/docs/zh/xin/studio/chat.md) 选项卡并搜索 **Kimi-K2.5** 在搜索栏中下载你想要的模型和量化版本。确保你有足够的算力来运行模型。

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FexhsJAWYrkO20yACHDWR%2FScreenshot%202026-04-02%20at%202.05.22%E2%80%AFAM.png?alt=media&amp;token=387d1dc3-0c97-44c8-b8de-67fe90d9ade7" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**运行 Kimi-K2.5**

在使用 Unsloth Studio 时，推理参数应会自动设置，不过你仍然可以手动更改。你也可以编辑上下文长度、聊天模板和其他设置。

更多信息请查看我们的 [Unsloth Studio 推理指南](/docs/zh/xin/studio/chat.md).

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FXPQGEEr1YoKofrTatAKK%2Ftoolcallingif.gif?alt=media&amp;token=25d68698-fb13-4c46-99b2-d39fb025df08" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}

### ✨ 在 llama.cpp 中运行 Kimi K2.5

对于本指南，我们将运行最小的 1-bit 量化，大小为 240GB。你可以随意将量化类型改为 2-bit、3-bit 等。要以接近 **全精度**运行模型，你可以使用 4-bit 或 5-bit 量化。为了稳妥起见，你也可以使用更高位数。

1. 获取最新的 `llama.cpp` 在 [GitHub 这里](https://github.com/ggml-org/llama.cpp)。你也可以按照下面的构建说明操作。将 `-DGGML_CUDA=ON` 改为 `-DGGML_CUDA=OFF` 如果你没有 GPU，或者只想进行 CPU 推理。 **对于 Apple Mac / Metal 设备**，设置 `-DGGML_CUDA=OFF` 然后按常规继续——Metal 支持默认开启。

```bash
apt-get update
apt-get install pciutils build-essential cmake curl libcurl4-openssl-dev -y
git clone https://github.com/ggml-org/llama.cpp
cmake llama.cpp -B llama.cpp/build \
    -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON
cmake --build llama.cpp/build --config Release -j --clean-first --target llama-cli llama-mtmd-cli llama-server llama-gguf-split
cp llama.cpp/build/bin/llama-* llama.cpp
```

2. 如果你想 `llama.cpp` 直接加载模型，你可以使用下面的方法：(:UD-TQ1\_0) 是量化类型。你也可以通过 Hugging Face 下载（第 3 点）。这与 `ollama run` 。使用 `export LLAMA_CACHE="folder"` 来强制 `llama.cpp` 保存到特定位置。

{% hint style="success" %}
`LLAMA_SET_ROWS=1` 会让 llama.cpp 稍微快一些！建议使用！ `--fit on` 会自动在所有 GPU 和 CPU 上以最佳方式适配模型。
{% endhint %}

```bash
export LLAMA_CACHE="unsloth/Kimi-K2.5-GGUF"
LLAMA_SET_ROWS=1 ./llama.cpp/llama-cli \
    -hf unsloth/Kimi-K2.5-GGUF:UD-TQ1_0\
    --temp 1.0 \
    --min-p 0.01 \
    --top-p 0.95 \\
    --ctx-size 16384 \\
    --seed 3407
```

3. `--fit on` 会自动将模型适配到你的系统。如果未使用 `--fit on` 并且你大约有 360GB 的 GPU 总显存，请移除 `-ot ".ffn_.*_exps.=CPU"` 以获得最大速度。

{% hint style="info" %}
使用 `--fit on` 用于在 GPU 和 CPU 上自动适配。如果这不起作用，请看下面：

请尝试 `-ot ".ffn_.*_exps.=CPU"` 将所有 MoE 层卸载到 CPU！这实际上让你能够把所有非 MoE 层放到 1 张 GPU 上，从而提升生成速度。如果你有更多 GPU 容量，可以自定义正则表达式以适配更多层。

如果你有更多一点的 GPU 内存，试试 `-ot ".ffn_(up|down)_exps.=CPU"` 这会卸载上投影和下投影 MoE 层。

试试 `-ot ".ffn_(up)_exps.=CPU"` 如果你有更多 GPU 内存。这会只卸载上投影 MoE 层。

并且最后通过以下方式卸载所有层： `-ot ".ffn_.*_exps.=CPU"` 这将使用最少的 VRAM。

你也可以自定义正则表达式，例如 `-ot "\.(6|7|8|9|[0-9][0-9]|[0-9][0-9][0-9])\.ffn_(gate|up|down)_exps.=CPU"` 表示只从第 6 层开始卸载 gate、up 和 down MoE 层。
{% endhint %}

3. 通过以下方式下载模型（在安装 `pip install huggingface_hub hf_transfer` ）。我们推荐使用我们的 2bit 动态量化 UD-Q2\_K\_XL，以平衡大小和准确度。所有版本见： [huggingface.co/unsloth/Kimi-K2.5-GGUF](https://huggingface.co/unsloth/Kimi-K2.5-GGUF) 如果下载卡住，请参阅 [Hugging Face Hub、XET 调试](/docs/zh/ji-chu/troubleshooting-and-faqs/hugging-face-hub-xet-debugging.md)

{% code overflow="wrap" %}

```bash
pip install -U huggingface_hub
hf download unsloth/Kimi-K2.5-GGUF \
    --local-dir unsloth/Kimi-K2.5-GGUF \
    --include "*UD-TQ1_0*" # 动态 2bit 请使用 "*UD-Q2_K_XL*"
```

{% endcode %}

{% hint style="info" %}
如果你发现下载卡在 90% 到 95% 左右，请查看我们的 [故障排查指南](https://docs.unsloth.ai/basics/troubleshooting-and-faqs#downloading-gets-stuck-at-90-to-95).
{% endhint %}

4. 运行任意提示。
5. 编辑  `--ctx-size 16384` 用于上下文长度。你也可以省略它，以便通过 `--fit on`

{% code overflow="wrap" %}

```bash
LLAMA_SET_ROWS=1 ./llama.cpp/llama-cli \
    --model unsloth/Kimi-K2.5-GGUF/UD-TQ1_0/Kimi-K2.5-UD-TQ1_0-00001-of-00005.gguf \
    --temp 1.0 \
    --min-p 0.01 \
    --top-p 0.95 \\
    --ctx-size 16384 \\
    --seed 3407
```

{% endcode %}

6. 例如，试试："用 HTML 创建一个 Flappy Bird 游戏"，你会得到：

{% columns %}
{% column width="33.33333333333333%" %}

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FwgHfM2RE4JaK2shbPLWj%2Fimage.png?alt=media&amp;token=ae7e5bae-b4b5-45d8-a126-adc3695e36ad" alt="" width="188"><figcaption></figcaption></figure>
{% endcolumn %}

{% column width="66.66666666666667%" %}
{% code expandable="true" %}

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Flappy Bird</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            background: #222;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            font-family: 'Segoe UI', sans-serif;
            overflow: hidden;
            touch-action: none;
        }
        
        #game-container {
            position: relative;
            width: 400px;
            height: 600px;
            background: linear-gradient(to bottom, #70c5ce 0%, #70c5ce 80%, #c23810 80%, #c23810 100%);
            box-shadow: 0 0 20px rgba(0,0,0,0.5);
            overflow: hidden;
        }
        
        canvas {
            display: block;
        }
        
        .overlay {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            color: white;
            text-shadow: 2px 2px 0 #000;
            font-weight: bold;
            pointer-events: none;
        }
        
        .game-title {
            font-size: 48px;
            margin-bottom: 20px;
        }
        
        .score-display {
            font-size: 36px;
            margin-bottom: 10px;
        }
        
        .best-score {
            font-size: 24px;
            color: #ffe;
        }
        
        .instruction {
            font-size: 20px;
            animation: pulse 1s infinite;
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        
        .hidden { display: none; }
    </style>
</head>
<body>
    <div id="game-container">
        <canvas id="canvas" width="400" height="600"></canvas>
        
        <!-- 开始界面 -->
        <div id="start-screen" class="overlay">
            <div class="game-title">FLAPPY BIRD</div>
            <div class="instruction">点击或按空格起飞</div>
        </div>
        
        <!-- 游戏结束界面 -->
        <div id="game-over-screen" class="overlay hidden">
            <div class="game-title">GAME OVER</div>
            <div class="score-display">得分：<span id="final-score">0</span></div>
            <div class="best-score">最高分：<span id="best-score">0</span></div>
            <div class="instruction">点击重新开始</div>
        </div>
        
        <!-- 分数计数器 -->
        <div id="current-score" class="overlay hidden" style="top: 10%; font-size: 72px; color: white; text-shadow: 4px 4px 0 #000;">
            0
        </div>
    </div>

    <script>
        const canvas = document.getElementById('canvas');
        const ctx = canvas.getContext('2d');
        
        // 游戏常量
        const GRAVITY = 0.4;
        const JUMP_STRENGTH = -7;
        const PIPE_SPEED = 3;
        const PIPE_SPAWN_RATE = 120; // 帧
        const PIPE_GAP = 120;
        
        // 游戏状态
        let bird = { x: 50, y: 200, velocity: 0, radius: 15, wingState: 0 };
        let pipes = [];
        let score = 0;
        let bestScore = localStorage.getItem('flappyBest') || 0;
        let frameCount = 0;
        let isGameOver = false;
        let isPlaying = false;
        
        // DOM 元素
        const startScreen = document.getElementById('start-screen');
        const gameOverScreen = document.getElementById('game-over-screen');
        const currentScoreDisplay = document.getElementById('current-score');
        const finalScoreEl = document.getElementById('final-score');
        const bestScoreEl = document.getElementById('best-score');
        
        // 输入处理
        function handleInput(e) {
            if (!isPlaying) {
                if (isGameOver) {
                    resetGame();
                }
                startGame();
            } else if (!isGameOver) {
                bird.velocity = JUMP_STRENGTH;
                bird.wingState = 1;
            }
        }
        
        document.addEventListener('keydown', (e) => {
            if (e.code === 'Space' || e.code === 'ArrowUp') handleInput(e);
        });
        canvas.addEventListener('pointerdown', handleInput);
        
        function startGame() {
            isPlaying = true;
            isGameOver = false;
            startScreen.classList.add('hidden');
            currentScoreDisplay.classList.remove('hidden');
            resetGameState();
            gameLoop();
        }
        
        function resetGameState() {
            bird = { x: 50, y: 200, velocity: 0, radius: 15, wingState: 0 };
            pipes = [];
            score = 0;
            frameCount = 0;
            currentScoreDisplay.textContent = score;
        }
        
        function resetGame() {
            isGameOver = false;
            isPlaying = true;
            gameOverScreen.classList.add('hidden');
            currentScoreDisplay.classList.remove('hidden');
            resetGameState();
            gameLoop();
        }
        
        function spawnPipe() {
            const minHeight = 100;
            const maxHeight = 400;
            const topHeight = Math.floor(Math.random() * (maxHeight - minHeight + 1) + minHeight);
            const bottomHeight = canvas.height - topHeight - PIPE_GAP;
            
            pipes.push({
                x: canvas.width,
                topHeight: topHeight,
                bottomY: topHeight + PIPE_GAP,
                bottomHeight: bottomHeight,
                passed: false
            });
        }
        
        function update() {
            if (isGameOver) return;
            
            // 小鸟物理
            bird.velocity += GRAVITY;
            bird.y += bird.velocity;
            
            // 地面/天花板碰撞
            if (bird.y + bird.radius > canvas.height || bird.y - bird.radius < 0) {
                gameOver();
                return;
            }
            
            // 管道生成
            frameCount++;
            if (frameCount % PIPE_SPAWN_RATE === 0) {
                spawnPipe();
            }
            
            // 管道移动与碰撞
            for (let i = pipes.length - 1; i >= 0; i--) {
                const pipe = pipes[i];
                pipe.x -= PIPE_SPEED;
                
                // 移除屏幕外的管道
                if (pipe.x + 60 < 0) {
                    pipes.splice(i, 1);
                    continue;
                }
                
                // 碰撞检测（简化的矩形-圆形）
                const pipeWidth = 60;
                const pipeX = pipe.x;
                const pipeLeft = pipeX;
                const pipeRight = pipeX + pipeWidth;
                
                // 小鸟是圆形，管道是矩形
                const birdLeft = bird.x - bird.radius + 4; // 喙偏移 +4
                const birdRight = bird.x + bird.radius + 2;
                const birdTop = bird.y - bird.radius;
                const birdBottom = bird.y + bird.radius;
                
                // 水平碰撞检测
                if (birdRight > pipeLeft && birdLeft < pipeRight) {
                    // 上方管道碰撞
                    if (birdTop < pipe.topHeight) {
                        gameOver();
                        return;
                    }
                    // 下方管道碰撞
                    if (birdBottom > pipe.bottomY) {
                        gameOver();
                        return;
                    }
                }
                
                // 计分
                if (pipe.x + pipeWidth < bird.x && !pipe.passued) {
                    pipe.passed = true;
                    score++;
                    currentScoreDisplay.textContent = score;
                }
            }
            
            // 翅膀动画
            if (bird.wingState > 0) {
                bird.wingState = (bird.wingState + 0.2) % 2;
            }
        }
        
        function draw() {
            // 清空画布
            ctx.clearRect(0, 0, canvas.width, canvas.height);
            
            // 绘制管道
            pipes.forEach(pipe => {
                // 上管道
                ctx.fillStyle = '#46c';
                ctx.fillRect(pipe.x, 0, 60, pipe.topHeight);
                ctx.fillStyle = '#34a';
                ctx.fillRect(pipe.x, pipe.topHeight - 20, 60, 20); // 盖帽
                
                // 下管道
                ctx.fillStyle = '#46c';
                ctx.fillRect(pipe.x, pipe.bottomY, 60, canvas.height - pipe.bottomY);
                ctx.fillStyle = '#34a';
                ctx.fillRect(pipe.x, pipe.bottomY - 20, 60, 20); // 盖帽
            });
            
            // 绘制小鸟（带喙的圆形）
            ctx.fillStyle = '#e3bc4e';
            ctx.beginPath();
            ctx.arc(bird.x, bird.y, bird.radius, 0, Math.PI * 2);
            ctx.fill();
            
            // 喙
            ctx.fillStyle = '#e04c4c';
            ctx.beginPath();
            ctx.moveTo(bird.x + bird.radius - 4, bird.y - 4);
            ctx.lineTo(bird.x + bird.radius + 10, bird.y);
            ctx.lineTo(bird.x + bird.radius - 4, bird.y + 4);
            ctx.fill();
            
            // 眼睛
            ctx.fillStyle = 'black';
            ctx.beginPath();
            ctx.arc(bird.x + 5, bird.y - 6, 3, 0, Math.PI * 2);
            ctx.fill();
            
            // 翅膀
            ctx.fillStyle = '#c4a';
            ctx.beginPath();
            ctx.ellipse(bird.x - 5, bird.y + 5, 10, 6, 0, 0, Math.PI * 2);
            ctx.fill();
        }
        
        function gameOver() {
            isGameOver = true;
            isPlaying = false;
            
            // 更新最高分
            if (score > bestScore) {
                bestScore = score;
                localStorage.setItem('flappyBest', bestScore);
            }
            
            // 显示游戏结束界面
            currentScoreDisplay.classList.add('hidden');
            gameOverScreen.classList.remove('hidden');
            finalScoreEl.textContent = score;
            bestScoreEl.textContent = bestScore;
        }
        
        function gameLoop() {
            if (!isPlaying) return;
            
            update();
            draw();
            requestAnimationFrame(gameLoop);
        }
        
        // 初始绘制
        draw();
    </script>
</body>
</html>
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### ✨ 使用 llama-server 和 OpenAI 的 completion 库进行部署

{% hint style="success" %}
使用 `--kv-unified` 可以让 llama.cpp 中的推理服务更快！参见 <https://www.reddit.com/r/LocalLLaMA/comments/1qnwa33/glm_47_flash_huge_performance_improvement_with_kvu/>
{% endhint %}

按照 [#run-kimi-k2-thinking-in-llama.cpp](#run-kimi-k2-thinking-in-llama.cpp "mention")安装 llama.cpp 后，你可以使用下面的方法启动一个兼容 OpenAI 的服务器：

{% code overflow="wrap" %}

```bash
LLAMA_SET_ROWS=1 ./llama.cpp/llama-server \
    --model unsloth/Kimi-K2.5-GGUF/UD-TQ1_0/Kimi-K2.5-UD-TQ1_0-00001-of-00005.gguf \
    --special \
    --alias "unsloth/Kimi-K2.5" \
    --min-p 0.01 \
    --ctx-size 16384 \\
    --port 8001 \\
    --kv-unified
```

{% endcode %}

然后使用 OpenAI 的 Python 库，如下： `pip install openai` :

```python
from openai import OpenAI
import json
openai_client = OpenAI(
    base_url = "http://127.0.0.1:8001/v1",
    api_key = "sk-no-key-required",
)
completion = openai_client.chat.completions.create(
    model = "unsloth/Kimi-K2.5",
    messages = [{"role": "user", "content": "What is 1+1?"},],
)
print(completion.choices[0].message.content)
```

结果如下：

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FkltZYBKtXcy5TzKKvGzN%2Fimage.png?alt=media&amp;token=d0a7c6e2-bac8-4d95-a5fa-446975dff581" alt="" width="563"><figcaption></figcaption></figure>

而在另一个 llama-server 窗口中：

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FjwlPZF5cdLHaHYgOhna3%2Fimage.png?alt=media&amp;token=602f1cbf-80bf-49ce-bbdb-21862d3d65fe" alt="" width="563"><figcaption></figcaption></figure>

### 📊 基准测试

你可以在下方以表格形式查看基准测试：

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FxRTS9YSfD8G0d9KiXK3W%2Fkimi%20k25%20benchmarks.jpg?alt=media&amp;token=b537ff73-136e-4bc6-ba76-0882ee30c72c" alt="" width="375"><figcaption></figcaption></figure>

#### 推理与知识

| 基准              | Kimi K2.5 | GPT-5.2 | Claude 4.5 Opus | Gemini 3 Pro | DeepSeek V3.2 | Qwen3-VL-235B-A22B-Thinking |
| --------------- | --------: | ------: | --------------: | -----------: | ------------: | --------------------------: |
| HLE-Full        |      30.1 |    34.5 |            30.8 |         37.5 |         25.1† |                           - |
| HLE-Full（含工具）   |      50.2 |    45.5 |            43.2 |         45.8 |         40.8† |                           - |
| AIME 2025       |      96.1 |     100 |            92.8 |         95.0 |          93.1 |                           - |
| HMMT 2025（2 月）  |      95.4 |    99.4 |          92.9\* |       97.3\* |          92.5 |                           - |
| IMO-AnswerBench |      81.8 |    86.3 |          78.5\* |       83.1\* |          78.3 |                           - |
| GPQA-Diamond    |      87.6 |    92.4 |            87.0 |         91.9 |          82.4 |                           - |
| MMLU-Pro        |      87.1 |  86.7\* |          89.3\* |         90.1 |          85.0 |                           - |

#### 图像与视频

| 基准               | Kimi K2.5 | GPT-5.2 | Claude 4.5 Opus | Gemini 3 Pro | DeepSeek V3.2 | Qwen3-VL-235B-A22B-Thinking |
| ---------------- | --------: | ------: | --------------: | -----------: | ------------: | --------------------------: |
| MMMU-Pro         |      78.5 |  79.5\* |            74.0 |         81.0 |             - |                        69.3 |
| CharXiv（RQ）      |      77.5 |    82.1 |          67.2\* |         81.4 |             - |                        66.1 |
| MathVision       |      84.2 |    83.0 |          77.1\* |       86.1\* |             - |                        74.6 |
| MathVista（mini）  |      90.1 |  82.8\* |          80.2\* |       89.8\* |             - |                        85.8 |
| ZeroBench        |         9 |     9\* |             3\* |          8\* |             - |                         4\* |
| ZeroBench（含工具）   |        11 |     7\* |             9\* |         12\* |             - |                         3\* |
| OCRBench         |      92.3 |  80.7\* |          86.5\* |       90.3\* |             - |                        87.5 |
| OmniDocBench 1.5 |      88.8 |    85.7 |          87.7\* |         88.5 |             - |                      82.0\* |
| InfoVQA（验证集）     |      92.6 |    84\* |          76.9\* |       57.2\* |             - |                        89.5 |
| SimpleVQA        |      71.2 |  55.8\* |          69.7\* |       69.7\* |             - |                      56.8\* |
| WorldVQA         |      46.3 |    28.0 |            36.8 |         47.4 |             - |                        23.5 |
| VideoMMMU        |      86.6 |    85.9 |          84.4\* |         87.6 |             - |                        80.0 |
| MMVU             |      80.4 |  80.8\* |            77.3 |         77.5 |             - |                        71.1 |
| MotionBench      |      70.4 |    64.8 |            60.3 |         70.3 |             - |                           - |
| VideoMME         |      87.4 |  86.0\* |               - |       88.4\* |             - |                        79.0 |
| LongVideoBench   |      79.8 |  76.5\* |          67.2\* |       77.7\* |             - |                      65.6\* |
| LVBench          |      75.9 |       - |               - |       73.5\* |             - |                        63.6 |

#### 编程

| 基准                     | Kimi K2.5 | GPT-5.2 | Claude 4.5 Opus | Gemini 3 Pro | DeepSeek V3.2 | Qwen3-VL-235B-A22B-Thinking |
| ---------------------- | --------: | ------: | --------------: | -----------: | ------------: | --------------------------: |
| SWE-Bench Verified     |      76.8 |    80.0 |            80.9 |         76.2 |          73.1 |                           - |
| SWE-Bench Pro          |      50.7 |    55.6 |          55.4\* |            - |             - |                           - |
| SWE-Bench Multilingual |      73.0 |    72.0 |            77.5 |         65.0 |          70.2 |                           - |
| Terminal Bench 2.0     |      50.8 |    54.0 |            59.3 |         54.2 |          46.4 |                           - |
| PaperBench             |      63.5 |  63.7\* |          72.9\* |            - |          47.1 |                           - |
| CyberGym               |      41.3 |       - |            50.6 |       39.9\* |        17.3\* |                           - |
| SciCode                |      48.7 |    52.1 |            49.5 |         56.1 |          38.9 |                           - |
| OJBench (cpp)          |      57.4 |       - |          54.6\* |       68.5\* |        54.7\* |                           - |
| LiveCodeBench (v6)     |      85.0 |       - |          82.2\* |       87.4\* |          83.3 |                           - |

#### 长上下文

| 基准           | Kimi K2.5 | GPT-5.2 | Claude 4.5 Opus | Gemini 3 Pro | DeepSeek V3.2 | Qwen3-VL-235B-A22B-Thinking |
| ------------ | --------: | ------: | --------------: | -----------: | ------------: | --------------------------: |
| Longbench v2 |      61.0 |  54.5\* |          64.4\* |       68.2\* |        59.8\* |                           - |
| AA-LCR       |      70.0 |  72.3\* |          71.3\* |       65.3\* |        64.3\* |                           - |

#### 代理式搜索

| 基准                              | Kimi K2.5 | GPT-5.2 | Claude 4.5 Opus | Gemini 3 Pro | DeepSeek V3.2 | Qwen3-VL-235B-A22B-Thinking |
| ------------------------------- | --------: | ------: | --------------: | -----------: | ------------: | --------------------------: |
| BrowseComp                      |      60.6 |    65.8 |            37.0 |         37.8 |          51.4 |                           - |
| BrowseComp（含上下文管理）              |      74.9 |    65.8 |            57.8 |         59.2 |          67.6 |                           - |
| BrowseComp（Agent Swarm）         |      78.4 |       - |               - |            - |             - |                           - |
| WideSearch（item-f1）             |      72.7 |       - |          76.2\* |         57.0 |        32.5\* |                           - |
| WideSearch（item-f1 Agent Swarm） |      79.0 |       - |               - |            - |             - |                           - |
| DeepSearchQA                    |      77.1 |  71.3\* |          76.1\* |       63.2\* |        60.9\* |                           - |
| FinSearchCompT2\&T3             |      67.8 |       - |          66.2\* |         49.9 |        59.1\* |                           - |
| Seal-0                          |      57.4 |    45.0 |          47.7\* |       45.5\* |        49.5\* |                           - |

#### 注释

* `*` = 由作者重新评估的分数（此前未公开）。
* `†` = DeepSeek V3.2 的分数对应其仅文本子集（如脚注所述）。
* `-` = 未评估 / 不可用。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://unsloth.ai/docs/zh/mo-xing/tutorials/kimi-k2.5.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
