# 如何使用 Claude Code 运行本地 LLM

这份分步指南将带你了解如何在完全本地环境中将开源 LLM 和 API 连接到 Claude Code，并附带截图。可使用任何开源模型运行，如 Qwen3.5、DeepSeek 和 Gemma。

在本教程中，我们将使用 [**Qwen3.5**](https://unsloth.ai/docs/zh/mo-xing/qwen3.5) 和 [GLM-4.7-Flash](https://unsloth.ai/docs/zh/mo-xing/glm-4.7-flash)。截至 2026 年 3 月，它们都是最强的 35B MoE 智能体与编码模型（在 24GB RAM/统一内存设备上表现也很出色），可借助 [Unsloth](https://github.com/unslothai/unsloth)自主微调一个 LLM。你可以替换为 [任何其他模型](https://unsloth.ai/docs/zh/mo-xing/tutorials)，只需更新脚本中的模型名称即可。

<a href="#qwen3.5-tutorial" class="button secondary">Qwen3.5 教程</a><a href="#glm-4.7-flash-tutorial" class="button secondary">GLM-4.7-Flash 教程</a><a href="#claude-code-tutorial" class="button primary" data-icon="claude">Claude Code 教程</a>

对于模型量化，我们将使用 Unsloth [动态 GGUF](https://unsloth.ai/docs/zh/ji-chu/unsloth-dynamic-2.0-ggufs) 来以量化方式运行任何 LLM，同时尽可能保留准确性。

{% hint style="info" %}
自 2026 年 1 月以来，Claude Code 变化很大。你需要开启更多设置和必要功能。
{% endhint %}

## 📖 LLM 设置教程

在开始之前，我们首先需要为你将要使用的特定模型完成设置。我们使用 `llama.cpp` 这是一个开源框架，可在你的 Mac、Linux、Windows 等设备上运行 LLM。Llama.cpp 包含 `llama-server` 它允许你高效地提供和部署 LLM 服务。模型将通过 8001 端口提供服务，所有智能体工具都将通过一个兼容 OpenAI 的端点路由。&#x20;

### Qwen3.5 教程

我们将使用 [Qwen3.5](https://unsloth.ai/docs/zh/mo-xing/qwen3.5)-35B-A3B 以及用于快速准确编码任务的特定设置。如果你的 VRAM 不足，并且想要一个 **更聪明的** 模型， **Qwen3.5-27B** 是一个很好的选择，但它会慢约 2 倍；或者你也可以使用其他 Qwen3.5 变体，如 9B、4B 或 2B。

{% hint style="info" %}
如果你想要一个 **更聪明的** 模型，或者你的 VRAM 不足，请使用 Qwen3.5-27B。不过它会比 35B-A3B 慢约 2 倍。或者你也可以使用 [**Qwen3-Coder-Next**](https://unsloth.ai/docs/zh/mo-xing/qwen3-coder-next) 如果你的 VRAM 足够，它会非常棒。
{% endhint %}

{% stepper %}
{% step %}

#### 安装 llama.cpp

我们需要安装 `llama.cpp` 以便部署/提供本地 LLM 供 Claude Code 等使用。我们遵循官方构建说明，以获得正确的 GPU 绑定和最高性能。将 `-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 git-all -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
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F4DmycqgjxOz6TOQd9PLJ%2Fimage.png?alt=media&#x26;token=c94db0b5-8e4a-4043-b2a3-c68bad93213e" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### 在本地下载并使用模型

通过 `huggingface_hub` 在 Python 中下载模型（先通过以下命令安装： `pip install huggingface_hub hf_transfer`）。我们使用 **UD-Q4\_K\_XL** 量化，以获得最佳的体积/准确度平衡。你可以在我们的 [此处的集合](https://unsloth.ai/docs/zh/kai-shi-shi-yong/unsloth-model-catalog)中找到所有 Unsloth GGUF 上传。若下载卡住，请查看 [hugging-face-hub-xet-debugging](https://unsloth.ai/docs/zh/ji-chu/troubleshooting-and-faqs/hugging-face-hub-xet-debugging "mention")

```bash
hf download unsloth/Qwen3.5-35B-A3B-GGUF \\
    --local-dir unsloth/Qwen3.5-35B-A3B-GGUF \\
    --include "*UD-Q4_K_XL*" # 动态 2bit 请使用 "*UD-Q2_K_XL*"
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FRfXofrNzl1ypjfMTz15o%2Fimage.png?alt=media&#x26;token=8009de90-cd11-46ed-85b5-fca5c07b66fc" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
我们使用了 `unsloth/Qwen3.5-35B-A3B-GGUF` ，但你也可以使用其他变体，如 27B，或者任何其他模型，例如 `unsloth/`[`Qwen3-Coder-Next`](https://unsloth.ai/docs/zh/mo-xing/qwen3-coder-next)`-GGUF`.
{% endhint %}

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FxlIrQGQ0cevb1ckkSFy5%2Fimage.png?alt=media&#x26;token=b1a42562-927a-4ad2-85f8-29c2993c46aa" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### 启动 Llama-server

为了将 Qwen3.5 部署用于智能体工作负载，我们使用 `llama-server`。我们采用 [Qwen 推荐的采样参数](https://unsloth.ai/docs/zh/mo-xing/qwen3.5#recommended-settings) 用于思考模式： `温度 0.6`, `top_p 0.95` , `top-k 20`。请注意，如果你使用非思考模式或其他任务，这些数值会变化。

在新的终端中运行此命令（使用 `tmux` 或打开一个新终端）。下面的配置应该 **在 24GB GPU（RTX 4090）上完全适配（占用 23GB）** `--fit on` 也会自动卸载，但如果你看到性能很差，请降低 `--ctx-size` .

{% hint style="danger" %}
我们使用了 `--cache-type-k q8_0 --cache-type-v q8_0` 以进行 KV 缓存量化，从而减少 VRAM 使用。若要完全精度，请使用 `--cache-type-k bf16 --cache-type-v bf16` 根据多方报告，Qwen3.5 在使用 `f16` KV 缓存时会降低准确性，因此不要使用 `--cache-type-k f16 --cache-type-v f16` ，因为 llama.cpp 默认也是开启的。请注意，bf16 KV Cache 在某些机器上可能会稍慢。
{% endhint %}

```bash
./llama.cpp/llama-server \\
    --model unsloth/Qwen3.5-35B-A3B-GGUF/Qwen3.5-35B-A3B-UD-Q4_K_XL.gguf \\
    --alias "unsloth/Qwen3.5-35B-A3B" \\
    --temp 0.6 \\
    --top-p 0.95 \\
    --top-k 20 \\
    --min-p 0.00 \\
    --port 8001 \\
    --kv-unified \\
    --cache-type-k q8_0 --cache-type-v q8_0 \\
    --flash-attn on --fit on \\
    --ctx-size 131072 # 按需更改
```

{% hint style="success" %}
你也可以为 Qwen3.5 关闭思考，这可以提升智能体编码任务的性能。要在 llama.cpp 中关闭思考，请将以下内容添加到 llama-server 命令中：

`--chat-template-kwargs "{\"enable_thinking\": false}"`

<img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F373wtRRbMcobtjV5e6xf%2Fkerkekke.png?alt=media&#x26;token=2cd3b8c7-93b6-41cb-8bce-41f1aee819eb" alt="" data-size="original">
{% endhint %}
{% endstep %}
{% endstepper %}

### GLM-4.7-Flash 教程

{% stepper %}
{% step %}

#### 安装 llama.cpp

我们需要安装 `llama.cpp` 以便部署/提供本地 LLM 供 Claude Code 等使用。我们遵循官方构建说明，以获得正确的 GPU 绑定和最高性能。将 `-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 git-all -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
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F4DmycqgjxOz6TOQd9PLJ%2Fimage.png?alt=media&#x26;token=c94db0b5-8e4a-4043-b2a3-c68bad93213e" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### 在本地下载并使用模型

通过 `huggingface_hub` 在 Python 中下载模型（先通过以下命令安装： `pip install huggingface_hub hf_transfer`）。我们使用 **UD-Q4\_K\_XL** 量化，以获得最佳的体积/准确度平衡。你可以在我们的 [此处的集合](https://unsloth.ai/docs/zh/kai-shi-shi-yong/unsloth-model-catalog)中找到所有 Unsloth GGUF 上传。若下载卡住，请查看 [hugging-face-hub-xet-debugging](https://unsloth.ai/docs/zh/ji-chu/troubleshooting-and-faqs/hugging-face-hub-xet-debugging "mention")

{% hint style="success" %}
我们使用了 `unsloth/GLM-4.7-Flash-GGUF` ，但你也可以使用类似 `unsloth/Qwen3-Coder-Next-GGUF` 的任何内容——参见 [qwen3-coder-next](https://unsloth.ai/docs/zh/mo-xing/qwen3-coder-next "mention")
{% endhint %}

```python
import os
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
from huggingface_hub import snapshot_download

snapshot_download(
    repo_id = "unsloth/GLM-4.7-Flash-GGUF",
    local_dir = "unsloth/GLM-4.7-Flash-GGUF",
    allow_patterns = ["*UD-Q4_K_XL*"],
)
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FxlIrQGQ0cevb1ckkSFy5%2Fimage.png?alt=media&#x26;token=b1a42562-927a-4ad2-85f8-29c2993c46aa" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### 启动 Llama-server

为了将 GLM-4.7-Flash 部署用于智能体工作负载，我们使用 `llama-server`。我们采用 Z.ai 推荐的采样参数（`温度 1.0`, `top_p 0.95`).

在新的终端中运行此命令（使用 `tmux` 或打开一个新终端）。下面的配置应该 **在 24GB GPU（RTX 4090）上完全适配（占用 23GB）** `--fit on` 也会自动卸载，但如果你看到性能很差，请降低 `--ctx-size` .

{% hint style="danger" %}
我们使用了 `--cache-type-k q8_0 --cache-type-v q8_0` 用于 KV 缓存量化，以减少 VRAM 使用。如果你看到质量下降，也可以改用 `bf16` ，但这会使 VRAM 使用量增加一倍： `--cache-type-k bf16 --cache-type-v bf16`
{% endhint %}

```bash
./llama.cpp/llama-server \\
    --model unsloth/GLM-4.7-Flash-GGUF/GLM-4.7-Flash-UD-Q4_K_XL.gguf \\
    --alias "unsloth/GLM-4.7-Flash" \\
    --temp 1.0 \\
    --top-p 0.95 \\
    --min-p 0.01 \\
    --port 8001 \\
    --kv-unified \\
    --cache-type-k q8_0 --cache-type-v q8_0 \\
    --flash-attn on --fit on \\
    --batch-size 4096 --ubatch-size 1024 \\
    --ctx-size 131072 # 按需更改
```

{% hint style="success" %}
你也可以为 GLM-4.7-Flash 关闭思考，这可以提升智能体编码任务的性能。要在 llama.cpp 中关闭思考，请将以下内容添加到 llama-server 命令中：

`--chat-template-kwargs "{\"enable_thinking\": false}"`

<img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FyKf6guCV8snRaAV16Zxc%2FG_16XLgXUAEnSWH.jpg?alt=media&#x26;token=3b557c6d-3f6f-4515-ba9f-4cc8b50bcef1" alt="" data-size="original">
{% endhint %}
{% endstep %}
{% endstepper %}

## <i class="fa-claude">:claude:</i> Claude Code 教程

{% hint style="danger" %}
参见 [#fixing-90-slower-inference-in-claude-code](#fixing-90-slower-inference-in-claude-code "mention") 在安装 Claude Code 之后，以修复由于 KV Cache 失效而导致开源模型慢 90% 的问题。
{% endhint %}

完成本地 LLM 的前几步设置后，就该设置 Claude Code 了。Claude Code 是 Anthropic 的智能体编码工具，运行在你的终端中，理解你的代码库，并通过自然语言处理复杂的 Git 工作流。

#### **安装 Claude Code 并在本地运行它**

{% tabs %}
{% tab title="Mac / Linux 设置" %}

```bash
curl -fsSL https://claude.ai/install.sh | bash
# 或通过 Homebrew：brew install --cask claude-code
```

**配置**

设置 `ANTHROPIC_BASE_URL` 环境变量，将 Claude Code 重定向到你的本地 `llama.cpp` 服务器。

```bash
export ANTHROPIC_BASE_URL="http://localhost:8001"
```

另外，你可能还需要设置 `ANTHROPIC_API_KEY` ，具体取决于服务器。例如：

```bash
export ANTHROPIC_API_KEY='sk-no-key-required' ## 或 'sk-1234'
```

**会话 vs 持久化：** 上面的命令只对当前终端有效。若要在新终端中持续生效：

将 `export` 这一行添加到 `~/.bashrc` （bash）或 `~/.zshrc` （zsh）。

{% hint style="warning" %}
如果你看到 `无法连接到 API（ConnectionRefused）` ，请记得取消设置 `ANTHROPIC_BASE_URL`  通过 `unset ANTHROPIC_BASE_URL`
{% endhint %}

**缺少 API 密钥**

如果你看到这个，请设置 `export ANTHROPIC_API_KEY='sk-no-key-required' ## 或 'sk-1234'`

{% hint style="info" %}
如果 Claude Code 首次运行时仍要求你登录，请添加 `"hasCompletedOnboarding": true` 和 `"primaryApiKey": "sk-dummy-key"` 改为 `~/.claude.json`。对于 VS Code 扩展，还要在 **禁用登录提示** 中启用它（或者添加 `"claudeCode.disableLoginPrompt": true` 改为 `settings.json`).
{% endhint %}
{% endtab %}

{% tab title="Windows 设置" %}
以下所有命令请使用 Powershell：

```powershell
irm https://claude.ai/install.ps1 | iex
```

**配置**

设置 `ANTHROPIC_BASE_URL` 环境变量，将 Claude Code 重定向到你的本地 `llama.cpp` 服务器。你还必须使用 `$env:CLAUDE_CODE_ATTRIBUTION_HEADER=0` 如下所示。

```powershell
$env:ANTHROPIC_BASE_URL="http://localhost:8001"
```

{% hint style="danger" %}
Claude Code 最近会在前面添加并更改 Claude Code Attribution 标头，这会使 KV Cache 失效。请参见这个 [LocalLlama 讨论](https://www.reddit.com/r/LocalLLaMA/comments/1r47fz0/claude_code_with_local_models_full_prompt/).

要解决这个问题，请执行 `$env:CLAUDE_CODE_ATTRIBUTION_HEADER=0` 或编辑 `~/.claude/settings.json` ，内容如下：

```
{
    ...
    "env": {
        "CLAUDE_CODE_ATTRIBUTION_HEADER" : "0",
        ...
    }
}
```

{% endhint %}

**会话 vs 持久化：** 上面的命令只对当前终端有效。若要在新终端中持续生效：

运行 `setx ANTHROPIC_BASE_URL "http://localhost:8001"` 一次，或者将 `$env:` 这一行添加到你的 `$PROFILE`.

{% hint style="info" %}
如果 Claude Code 首次运行时仍要求你登录，请添加 `"hasCompletedOnboarding": true` 和 `"primaryApiKey": "sk-dummy-key"` 改为 `~/.claude.json`。对于 VS Code 扩展，还要在 **禁用登录提示** 中启用它（或者添加 `"claudeCode.disableLoginPrompt": true` 改为 `settings.json`).
{% endhint %}
{% endtab %}
{% endtabs %}

### :detective:修复 Claude Code 中慢 90% 的推理

{% hint style="danger" %}
Claude Code 最近会在前面添加 Claude Code Attribution 标头，这会 **使 KV Cache 失效，导致本地模型的推理速度慢 90%**。参见这个 [LocalLlama 讨论](https://www.reddit.com/r/LocalLLaMA/comments/1r47fz0/claude_code_with_local_models_full_prompt/).
{% endhint %}

要解决这个问题，请编辑 `~/.claude/settings.json` 以包含 `CLAUDE_CODE_ATTRIBUTION_HEADER` 并在其中将其设为 0 `"env"`

{% hint style="info" %}
使用 `export CLAUDE_CODE_ATTRIBUTION_HEADER=0` **不能** 工作！
{% endhint %}

例如，执行 `cat > ~/.claude/settings.json` 然后添加下面的内容（粘贴后，请按 ENTER 然后 CTRL+D 保存）。如果你已有一个之前的 `~/.claude/settings.json` 文件，只需添加 `"CLAUDE_CODE_ATTRIBUTION_HEADER" : "0"` 到 "env" 部分，并保持设置文件其余部分不变。

<pre><code>{
  "promptSuggestionEnabled": false,
  "env": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "0",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    <a data-footnote-ref href="#user-content-fn-1">"CLAUDE_CODE_ATTRIBUTION_HEADER" : "0"</a>
  },
  "attribution": {
    "commit": "",
    "pr": ""
  },
  "plansDirectory" : "./plans",
  "prefersReducedMotion" : true,
  "terminalProgressBarEnabled" : false,
  "effortLevel" : "high"
}
</code></pre>

#### :star2:在 Linux / Mac / Windows 上本地运行 Claude Code

{% hint style="success" %}
我们使用了 `unsloth/GLM-4.7-Flash-GGUF` ，但你也可以使用类似 `unsloth/Qwen3.5-35B-A3B-GGUF`.
{% endhint %}

{% hint style="danger" %}
参见 [#fixing-90-slower-inference-in-claude-code](#fixing-90-slower-inference-in-claude-code "mention") 首先修复因 KV Cache 失效导致开源模型慢 90% 的问题。
{% endhint %}

进入你的项目文件夹（`mkdir project ; cd project`）然后运行：

```bash
claude --model unsloth/GLM-4.7-Flash
```

如果要使用 Qwen3.5-35B-A3B，只需改为：

```bash
claude --model unsloth/Qwen3.5-35B-A3B
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fnyc5BnXQiXPRZnyuYZt3%2Fimage.png?alt=media&#x26;token=72011cb6-abed-4a41-99b0-104ef5d0111f" alt=""><figcaption></figcaption></figure>

要将 Claude Code 设置为无需任何批准即可执行命令，请运行 **（注意：这会使 Claude Code 按它喜欢的方式执行和运行代码，而无需任何批准！）**

{% code overflow="wrap" %}

```bash
claude --model unsloth/GLM-4.7-Flash --dangerously-skip-permissions
```

{% endcode %}

试试这个提示，来安装并运行一个简单的 Unsloth 微调：

{% code overflow="wrap" %}

```
你只能在 cwd project/ 中工作。不要搜索 CLAUDE.md——就是这里。通过 uv 使用虚拟环境安装 Unsloth。尽可能使用 `python -m venv unsloth_env` 然后 `source unsloth_env/bin/activate`。请查看 https://unsloth.ai/docs/get-started/install/pip-install 了解方法（获取并阅读）。然后按 https://github.com/unslothai/unsloth 中的说明执行一个简单的 Unsloth 微调运行。你可以使用 1 块 GPU。
```

{% endcode %}

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FBkpEsVssYZG9wHvvWMRH%2Fimage.png?alt=media&#x26;token=e1a8283f-49ed-4b78-8052-d8970f069d5b" alt=""><figcaption></figcaption></figure>

等一会儿后，Unsloth 将通过 uv 安装到 venv 中，并加载完成：

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FHATFwDrR1gP44XFbzWcv%2Fimage.png?alt=media&#x26;token=6ff63733-686d-4b08-bdd5-66a6fa4aa34c" alt=""><figcaption></figcaption></figure>

最后你会看到一个使用 Unsloth 成功微调的模型！

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FZjQ6askaixcYOMrr2qMi%2Fimage.png?alt=media&#x26;token=e0e0047d-b6a2-421f-a86b-68e093a3a17a" alt=""><figcaption></figcaption></figure>

**IDE 扩展（VS Code / Cursor）**

你也可以通过官方扩展直接在编辑器中使用 Claude Code：

* [为 VS Code 安装](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code)
* [为 Cursor 安装](cursor:extension/anthropic.claude-code)
* [VS Code 中的 Claude Code 文档](https://code.claude.com/docs/en/vs-code)

或者，按 `Ctrl+Shift+X` （Windows/Linux）或 `Cmd+Shift+X` （Mac），搜索 **Claude Code**，然后点击 **安装**.

{% hint style="warning" %}
如果你看到 `无法连接到 API（ConnectionRefused）` ，请记得取消设置 `ANTHROPIC_BASE_URL`  通过 `unset ANTHROPIC_BASE_URL`
{% endhint %}

{% hint style="danger" %}
如果你发现开源模型慢 90%，请先查看 [#claude-code-90-slower-inference](#claude-code-90-slower-inference "mention") 以修复 KV 缓存失效问题。
{% endhint %}

[^1]: 必须使用这个！


---

# Agent Instructions: 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:

```
GET https://unsloth.ai/docs/zh/ji-chu/claude-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
