> 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/ji-chu-zhi-shi/browser-use.md).

# 使用本地 LLM 的浏览器使用

使用本地模型浏览网站，并在内置浏览器中完成任务。

浏览器使用功能可让本地 LLM 浏览网站并为您完成任务，您可以在聊天旁边的浏览器中观看操作。在开源 [Unsloth Desktop](https://unsloth.ai/docs/zh/desktop.md) 适用于 macOS、Windows 和 Linux 的应用中，任何支持工具调用的模型都可以打开页面、点击按钮、填写表单和阅读 PDF 等文档，而视觉模型还可以检查截图。

{% columns %}
{% column %}
&#x20;本指南说明如何通过本地模型设置浏览器使用功能，并为其分配网页任务。

Unsloth 会在登录、提交表单、购买或下载前征求您的批准，您还可以为每个网站设置权限。您也可以将其连接到任意云端或 API 模型。
{% endcolumn %}

{% column %}

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FHg3Knjk1GznF8V6R39wk%2Ffour_grid_2x2.gif?alt=media&amp;token=008f7dab-7e91-43cb-a7bd-a8e3bfec29d5" alt=""><figcaption><p>Qwen3.8-27B 完成 4 项不同的浏览器任务</p></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

### ⚡ 快速入门

安装 Unsloth Desktop 以运行本地模型，并让它在聊天旁边浏览网站。

{% stepper %}
{% step %}

#### 下载 Unsloth

最简单的入门方式是安装 Unsloth Desktop 应用。它支持 [macOS](https://unsloth.ai/docs/zh/kuai-su-kai-shi/install/mac.md)、Linux、 [Windows](https://unsloth.ai/docs/zh/kuai-su-kai-shi/install/windows-installation.md), [NVIDIA](https://unsloth.ai/docs/zh/kuai-su-kai-shi/install/pip-install.md), [AMD](https://unsloth.ai/docs/zh/kuai-su-kai-shi/install/amd.md)、Intel 和 CPU 配置。

<a href="https://unsloth.ai/download" class="button primary" data-icon="down-to-bracket">下载 Unsloth</a>

* <i class="fa-apple">:apple:</i> [下载 macOS 版](https://unsloth.ai/download/mac)
* <i class="fa-windows">:windows:</i> [下载 Windows 版](https://unsloth.ai/download/windows)
* <i class="fa-linux">:linux:</i> [下载 Linux 版](https://unsloth.ai/download/linux)

或者，如果您偏好手动安装：

{% tabs %}
{% tab title="本地安装" %}
**MacOS、Linux、WSL：**

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

**Windows：**

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

{% endtab %}

{% tab title="Docker" %}
该 [Unsloth Docker 镜像](https://hub.docker.com/r/unsloth/unsloth) `unsloth/unsloth` 可在 Docker 上获取。 [阅读指南。](https://unsloth.ai/docs/get-started/install/docker)
{% endtab %}

{% tab title="Homebrew" %}
安装 Unsloth Desktop：

{% code collapsedlinecount="10" %}

```bash
brew install --cask unsloth
```

{% endcode %}

更新 Unsloth Desktop：

```bash
brew upgrade --cask unsloth
```

{% endtab %}

{% tab title="WinGet" %}
安装 Unsloth Desktop：

```powershell
winget install --id UnslothAI.Unsloth -e
```

更新 Unsloth Desktop：

```powershell
winget upgrade --id UnslothAI.Unsloth -e
```

{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

#### 安装

1. 打开 Unsloth 安装程序（`.dmg`, `.exe` 文件）
2. 在 Mac 上将 Unsloth 拖到“应用程序”文件夹，或在 Windows 上完成安装。
3. 启动应用并等待安装完成
   {% endstep %}

{% step %}

#### 选择模型

打开模型中心或“选择模型”下拉菜单。选择支持工具调用且量化版本适合您设备的模型，然后下载并加载它。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FNCEVgKLJI0goPqjgcg9B%2Fmodel%20hub%20models.png?alt=media&amp;token=533b5e3c-a901-4b33-963e-4a703cc9d5a6" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### 开始浏览

打开 **+** 聊天输入框旁的菜单，并启用 **浏览器使用**。试试以下提示：

```
打开 https://kenney.nl/assets 并找到三个资源包
用于一款小型海盗岛屿游戏：环境、角色
和 UI。

打开每个资源包的页面。分享其名称、链接和简短的
说明我们可以如何使用它。查看所列的
许可证。不要下载任何内容。
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FQXmNUrzvl9pRbNBbbEWI%2FUI%20pack%20adventure.gif?alt=media&amp;token=76426c04-5aeb-4c4b-a158-bdccc26fc5b3" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### 使用您的模型浏览

向您的模型提供一个网站和一项任务。它可以阅读页面、跟随链接，并与按钮、表单和其他控件交互。为使导航更清晰，请引用可见标签：“打开定价，然后选择按年计费。”

**批注** 可让您询问页面的特定部分。选择 **请求编辑**，高亮显示内容并添加问题或指令。所选内容会在聊天中发送给模型。

#### 继续您的任务

您可以在同一聊天中提出后续问题。找到资源包后，试试：

```
这些资源包中，哪个最适合俯视角游戏？
比较它们的风格，并建议我们可能还需要什么。
```

<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%2Fj0521NE4P44p74DzHTGJ%2Fimage.png?alt=media&amp;token=2f58f4e8-5e9b-4f11-a988-01f6ad913470" alt="" width="563"><figcaption></figcaption></figure></div>

明确说明您想要检查的内容会有所帮助。您可以要求模型比较选项、查看另一页面上的详细信息，或解释它如何得出答案。

#### 处理视觉内容

支持视觉功能的模型可以检查图像、图表和其他页面文本无法捕获内容的截图。不支持视觉功能的模型仍可使用页面文本、链接和控件，但无法检查图像本身。

请模型打开或放大您希望它检查的内容。例如：

```
你能浏览 Kenney 资源并分享一张截图吗
内容为 Pirate Kit 页面上放大的预览图？
```

模型可以导航到资源包页面、打开其预览并截取屏幕截图。展开 `browser_screenshot` 工具调用，以查看它捕获的确切图像。&#x20;

<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%2FA2D4w7KXmfWBzHzqCneJ%2Fimage.png?alt=media&amp;token=c3e9f395-7d9b-41f6-ab8a-e0b6fd868ea9" alt="" width="563"><figcaption></figcaption></figure></div>

然后，您可以询问有关该图像的后续问题，或请求仔细查看特定区域。

### 控制浏览器

在聊天旁边观看模型工作。如果您需要亲自处理某个步骤，请选择 **停止**，在浏览器中完成操作后，请模型继续。

若要禁用浏览器使用功能，请点击 **浏览器** 聊天输入框旁的指示器。

#### 批准操作

需要批准时，浏览器会显示一个请求，其中包含 **允许** 和 **拒绝** 按钮。

默认情况下，Unsloth 会在提交表单、登录或执行发送、购买或删除等操作前询问。它也可能会在打开新网站前询问。

请自行输入密码和付款信息。标准浏览器工具无法填写这些字段或上传文件。

#### 设置网站权限

打开“设置”并选择 **浏览器**。在 **代理权限**下，选择默认设置，或为单个网站添加例外。

| 设置    | 控制内容                   |
| ----- | ---------------------- |
| 浏览    | 模型可以访问哪些网站。            |
| 操作    | 对登录、提交表单以及发送或购买等操作的批准。 |
| 下载    | 是否允许下载、是否需要批准，或是否阻止下载。 |
| 无标签点击 | 在没有命名控件的区域（如画布）上点击和拖动。 |

#### 历史记录和“选择文本”脚本

您可以选择模型是否可以读取您的 Unsloth 浏览历史记录。可将其设置为先询问、始终允许或从不允许。

脚本每次都需要批准。运行前您将看到脚本。若要禁用它们，请将 **运行脚本** 设置为 **从不**.

完全访问会跳过若干批准提示，包括历史记录请求，除非历史记录访问设置为 **从不**。被阻止的网站和下载仍会被阻止，脚本仍需批准。

### <i class="fa-file">:file:</i> 在聊天旁处理文件

您还可以使用浏览器面板编辑和浏览 PDF、Office 文档、HTML 和文本文件。

打开“设置”，选择 **浏览器** 并启用 **在浏览器中打开文件**。点击受支持的附件，即可在对话旁打开它。

若要询问特定段落或建议更改，请选择 **请求编辑**，高亮显示该段落，并告诉模型您希望它执行什么操作。您的请求会在聊天中发送给模型。

<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%2FkjknhKM8DGLjafiEwfHS%2Fimage.png?alt=media&amp;token=f6fd67d0-490e-46e8-b52a-3503b395c90a" alt="" width="563"><figcaption></figcaption></figure></div>

阅读时，您可以让模型总结文件、解释某个部分或查找详细信息。若要询问特定段落或建议编辑，请选择 **请求编辑** 并高亮显示您所指的文本。

兼容的文件类型如下：&#x20;

| 文件类型     | 扩展名     |
| -------- | ------- |
| PDF      | `.pdf`  |
| Word 文档  | `.docx` |
| 电子表格     | `.xlsx` |
| 演示文稿     | `.pptx` |
| Markdown | `.md`   |
| HTML     | `.html` |
| 纯文本      | `.txt`  |

**故障排除**

<details>

<summary>浏览器使用功能不可用</summary>

请选择支持工具调用的模型，并打开常规聊天视图。浏览器使用功能在移动端或对比布局中不可用。启用 **浏览器使用** 通过 **+** 聊天输入框旁的菜单。

</details>

<details>

<summary>模型描述操作但没有执行</summary>

检查是否已启用 **浏览器使用** 。尝试要求执行一个具体操作，例如：“打开此 URL 并阅读页面标题。”不同模型的工具调用可靠性可能有所不同。

</details>

<details>

<summary>网站或页面的一部分无法使用</summary>

某些网站和嵌入内容可能无法与浏览器工具配合使用。如果模型找不到控件，请描述其可见标签或位置。对于视觉内容，请尝试使用支持视觉功能的模型。

您也可以选择 **停止**，如果可以，请手动完成该步骤，然后让模型继续。

</details>

<details>

<summary>操作正在等待批准</summary>

请查看浏览器面板中的批准请求，然后选择 **允许** 或 **拒绝**。如果请求已超时，请在您准备好审阅时让模型再次尝试。

</details>

<details>

<summary>本地页面无法打开</summary>

浏览器使用功能支持公开的 HTTP 和 HTTPS 网站。localhost、私有网络地址和 `file://` URL 不支持作为导航目标。若要查看受支持的附件，请启用 **在浏览器中打开文件** 在 **设置 → 浏览器**下，然后点击附件。

</details>

<details>

<summary>模型无法访问另一个浏览器标签页</summary>

模型在自己的 Unsloth 浏览器标签页中工作。它无法控制 Chrome、Firefox 或其他浏览器中的标签页。请将页面的 URL 复制到聊天中，并让模型在 Unsloth 中打开它。

</details>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://unsloth.ai/docs/zh/ji-chu-zhi-shi/browser-use.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
