智慧視窗中的自訂模型 - 自攜端點

Firefox Firefox 最近更新:
This is a machine-generated translation of the English article. It has not been reviewed by a human, and may contain errors. If you would like to revise this content, you can start here.
注意:Smart Window 功能將會逐步推出,從美國和加拿大的 Firefox 版本 150 使用者開始,並從 Firefox 155 版開始向法國使用者推出。

Smart Window 可讓您連接自己的 AI 模型,而非使用 Firefox 提供的模型。其運作的主要要求是您連接的伺服器必須與 OpenAI API 相容。如果您想要有更多控制權、使用特定供應商,或是在您的裝置上本機執行模型,這會很有幫助。

您可以連接:

  • 遠端模型(例如 OpenRouter)
  • 在您裝置上本機執行的模型(例如 Lemonade Server 或 Ollama)
注意:若您使用自訂模型,Smart Window 可能無法如預期般運作。此功能與這些說明是為熟悉這些服務和工具的使用者所設計。請務必使用受信任的模型供應商!

使用遠端模型 (OpenRouter)

  1. 若您還沒有 OpenRouter 帳號,請至 https://openrouter.ai/ 建立一個。
  2. 在 OpenRouter 中產生一組 API 金鑰,並將其複製到安全的地方。
    • OpenRouter API 金鑰以 sk-or-v1- 開頭。
  3. 開啟 OpenRouter 模型頁面 並選擇您想使用的模型。
    • 記下其模型 ID。例如:z-ai/glm-4.5-air:free。
  4. 在 Firefox 中:在畫面頂端的選單列點擊 Firefox 並選擇 設定(或在某些情況下為 偏好設定)。點擊選單按鈕 Fx89menuButton 後,選擇 設定。
  5. 前往 AI Controls > Smart Window Settings > Assistant model。
  6. 選取 Custom: Use your own LLM。
  7. 填寫欄位:
    • Model name:貼上步驟 3 的 OpenRouter 模型 ID。
    • Model endpoint with the OpenRouter API endpoint, which is typically https://openrouter.ai/api/v1.
    • API key:貼上步驟 2 的 OpenRouter API 金鑰。
  8. 點擊 Save。
  9. 開啟 Smart Window,並開始使用小幫手。
提示:您可以在 OpenRouter 的模型頁面(直接連結)上搜尋「free」來尋找免費模型。
bringyourownmodel

使用本機模型

範例:Lemonade Server

  1. 至 https://lemonade-server.ai/ 下載並安裝 Lemonade Server。您必須使用 10.2.0 或更新版本。
  2. 執行 Lemonade Server,並根據應用程式的指示下載您選擇的模型。
  3. 在命令列終端機中,使用指令 lemonade config set ctx_size=8192 來設定較大的上下文大小。
  4. 從 UI 或使用指令 lemonade unload 重新載入模型(下次您向模型發出請求時,它將會以您的設定載入)。
  5. 在 Firefox 中:在畫面頂端的選單列點擊 Firefox 並選擇 設定(或在某些情況下為 偏好設定)。點擊選單按鈕 Fx89menuButton 後,選擇 設定。
  6. 前往 AI Controls > Smart Window Settings > Assistant model。
  7. 選取 Custom: Use your own LLM。
  8. 填寫欄位:
    • Model name:輸入您在步驟 2 中的模型名稱(例如,SmolLM3-3B-GGUF)。
    • Model endpoint:輸入 Lemonade Server 端點,通常是 http://localhost:13305/api/v1。
    • 請注意,Lemonade Server 不需要 API 金鑰。
  9. 點擊 Save。
  10. 開啟 Smart Window,並開始使用小幫手。

範例:Ollama

  1. 至 https://ollama.com/download 下載並安裝 Ollama。
  2. 執行 Ollama,並依照網站上的指示下載您選擇的本機模型。
  3. 開啟 Firefox 設定畫面,並前往 AI Controls > Smart Window Settings > Assistant model,然後選取 Custom: Use your own LLM。
  4. 填寫欄位:
    • Model name:輸入您在步驟 2 中的模型名稱(例如:qwen3.5:4b)。
    • Model endpoint:輸入 Ollama 端點,通常是 http://localhost:11434/v1。
    • 請注意,Ollama 不需要 API 金鑰。
  5. 點擊 Save。
  6. 開啟 Smart Window,並開始使用小幫手。

相關文章

這些好人幫助我們撰寫了這篇文章:

Illustration of hands

成為志工

在此回答問題並幫助我們改善知識庫內容,與其他人一起切磋琢磨專業能力。

了解更多