> For the complete documentation index, see [llms.txt](https://docs.cherryai.com.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cherryai.com.cn/docs/zhong-wen-fan-ti/pre-basic/providers/ollama.md).

# Ollama

Ollama 係一款優秀嘅開源工具，令您可以喺本地輕鬆運行同管理各種大型語言模型（LLMs）。Cherry Studio 現已支援 Ollama 整合，令您可以喺熟悉嘅界面中，直接同本地部署嘅 LLM 互動，唔使依賴雲端服務！

## 咩係 Ollama？

Ollama 係一個簡化大型語言模型（LLM）部署同使用嘅工具。佢有以下特點：

* **本地運行：** 模型完全喺您嘅本地電腦上運行，唔使連網，保障您嘅私隱同數據安全。
* **簡單易用：** 透過簡單嘅命令行指令，即可下載、運行同管理各種 LLM。
* **模型豐富：** 支援 Llama 2、Deepseek、Mistral、Gemma 等多種熱門嘅開源模型。
* **跨平台：** 支援 macOS、Windows 同 Linux 系統。
* **開放 API**：支援同 OpenAI 相容嘅接口，可以同其他工具整合。

## 點解要喺 Cherry Studio 入面使用 Ollama？

* **唔使雲服務：** 唔再受限於雲端 API 嘅配額同費用，盡情體驗本地 LLM 嘅強大功能。
* **數據私隱：** 您所有對話數據都會保留喺本地，唔使擔心私隱洩露。
* **離線可用：** 就算喺冇網絡連接嘅情況下，都可以繼續同 LLM 互動。
* **定制化：** 可以根據您嘅需求，選擇同配置最適合您嘅 LLM。

## 喺 Cherry Studio 入面配置 Ollama

### **1. 安裝同運行 Ollama**

首先，您需要喺您嘅電腦上安裝並運行 Ollama。請按照以下步驟操作：

* **下載 Ollama：** 訪問 Ollama 官網（<https://ollama.com/>），根據您嘅操作系統下載對應嘅安裝包。\
  喺 Linux 下，可以直接執行命令安裝 ollama：

  ```sh
  curl -fsSL https://ollama.com/install.sh | sh
  ```
* **安裝 Ollama：** 按照安裝程式嘅指引完成安裝。
* **下載模型：** 打開終端（或者命令提示符），使用 `ollama run` 命令下載您想使用嘅模型。例如，要下載 Llama 2 模型，可以執行：

  ```sh
  ollama run llama3.2
  ```

  Ollama 會自動下載並運行該模型。
* **保持 Ollama 運行：** 喺您使用 Cherry Studio 同 Ollama 模型互動期間，請確保 Ollama 保持運行狀態。

### **2. 喺 Cherry Studio 入面添加 Ollama 服務商**

跟住，喺 Cherry Studio 入面添加 Ollama 作為自定義 AI 服務商：

* **打開設定：** 喺 Cherry Studio 界面左側導航欄中，撳「設定」（齒輪圖示）。
* **進入模型服務：** 喺設定頁面中，選擇「模型服務」標籤。
* **添加提供商：** 撳列表中嘅 Ollama。

<figure><img src="/files/ee47770ba6a16f2cd41d1180b647e4015ee1b296" alt=""><figcaption></figcaption></figure>

### **3. 配置 Ollama 服務商**

喺服務商列表中搵到啱啱添加嘅 Ollama，並進行詳細配置：

1. **啟用狀態：**
   * 確保 Ollama 服務商最右側嘅開關已經打開，表示已啟用。
2. **API 密鑰：**
   * Ollama 預設**唔需要** API 密鑰。您可以將呢個欄位留空，或者填寫任何內容。
3. **API 地址：**
   * 填寫 Ollama 提供嘅本地 API 地址。通常情況下，地址係：

     ```
     http://localhost:11434/
     ```

     如果改咗端口，請自行更改。
4. **保持活躍時間：** 呢個選項係設定會話嘅保持時間，單位係分鐘。如果喺設定時間內冇新對話，Cherry Studio 會自動斷開同 Ollama 嘅連接，釋放資源。
5. **模型管理：**
   * 撳「+ 添加」按鈕，手動添加您喺 Ollama 入面已經下載嘅模型名稱。
   * 例如您已經透過`ollama run llama3.2`下載咗`llama3.2`模型, 咁呢度可以填入`llama3.2`
   * 撳「管理」按鈕，可以對已添加嘅模型進行編輯或者刪除。

## 開始使用

完成以上配置後，您就可以喺 Cherry Studio 嘅聊天界面中，選擇 Ollama 服務商同您已下載嘅模型，開始同本地 LLM 對話喇！

## 技巧同提示

* **首次運行模型：** 第一次運行某個模型時，Ollama 需要下載模型檔案，可能需要較長時間，請耐心等待。
* **查看可用模型：** 喺終端中執行 `ollama list` 命令，可以查看您已下載嘅 Ollama 模型列表。
* **硬件要求：** 運行大型語言模型需要一定嘅計算資源（CPU、內存、GPU），請確保您嘅電腦配置符合模型要求。
* **Ollama 文檔**：可以撳配置頁面中嘅`查看 Ollama 文檔同模型`鏈接快速跳轉去 Ollama 官網文檔。

***

### 💡 獲取幫助同提交反饋

如果您喺配置或使用過程中遇到任何疑問、Bug 或有功能改進建議，請參考 [反饋同建議](/docs/zhong-wen-fan-ti/question-contact/suggestions.md) 入面提供嘅官方渠道。


---

# 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://docs.cherryai.com.cn/docs/zhong-wen-fan-ti/pre-basic/providers/ollama.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.
