diff --git a/docs.json b/docs.json index 4d2037f6..3309a4b7 100644 --- a/docs.json +++ b/docs.json @@ -12,6 +12,7 @@ "light": "https://assets-docs.dify.ai/2025/05/d05cfc6ebe48f725d171dc71c64a5d16.svg", "dark": "https://assets-docs.dify.ai/2025/05/c51f1cda47c1d9a4a162d7736f6e4c53.svg" }, + "navigation": { "versions": [ { @@ -388,7 +389,8 @@ "en/development/models-integration/ollama", "en/development/models-integration/litellm", "en/development/models-integration/gpustack", - "en/development/models-integration/aws-bedrock-deepseek" + "en/development/models-integration/aws-bedrock-deepseek", + "en/development/models-integration/gpt-oss-local-deployment" ] }, { @@ -1048,7 +1050,8 @@ "zh-hans/development/models-integration/ollama", "zh-hans/development/models-integration/litellm", "zh-hans/development/models-integration/gpustack", - "zh-hans/development/models-integration/aws-bedrock-deepseek" + "zh-hans/development/models-integration/aws-bedrock-deepseek", + "zh-hans/development/models-integration/gpt-oss-local-deployment" ] }, { @@ -1691,7 +1694,8 @@ "ja-jp/development/models-integration/ollama", "ja-jp/development/models-integration/litellm", "ja-jp/development/models-integration/gpustack", - "ja-jp/development/models-integration/aws-bedrock-deepseek" + "ja-jp/development/models-integration/aws-bedrock-deepseek", + "ja-jp/development/models-integration/gpt-oss-local-deployment" ] }, { diff --git a/en/development/models-integration/gpt-oss Local Deployment with Ollama and Dify.md b/en/development/models-integration/gpt-oss Local Deployment with Ollama and Dify.md new file mode 100644 index 00000000..0218c9b8 --- /dev/null +++ b/en/development/models-integration/gpt-oss Local Deployment with Ollama and Dify.md @@ -0,0 +1,130 @@ +--- +title: " gpt-oss Local Deployment with Ollama and Dify " +--- +# I. Introduction + +The gpt-oss series is an open-source model first released by OpenAI in August 2025. + +> gpt-oss:20b (fits systems with ~16 GB memory) +> +> gpt-oss:120b (designed for ≥ 60 GB memory) + +You can run it locally with Ollama. No cloud calls. Data stays on your machine, which helps with privacy and latency. + +Dify is an open-source platform for building AI Agents and Workflows. This guide shows how to run gpt-oss with Ollama and plug it into Dify for a private, high-performance setup. + +* * * + +# II. Environment Setup + +## Step 1: Run gpt-oss with Ollama + +1. Install Ollama + + +[Download](https://ollama.com/) and install for macOS, Windows, or Linux. If anything is unclear, see the [official docs](https://docs.dify.ai/en/development/models-integration/ollama#integrate-local-models-deployed-by-ollama). + + + +2. Pull a model + + +```Bash +# Recommended for most dev machines +ollama pull gpt-oss:20b + +# For large GPUs or multi-GPU hosts +ollama pull gpt-oss:120b +``` + +Both models are pre‑quantized in **MXFP4** , suitable for local deployment. + + + +3. Start Ollama + + +The default endpoint is http://localhost:11434. + +## Step 2: Install Dify locally + +See the [Dify docs](https://docs.dify.ai/en/getting-started/install-self-hosted/readme) for full instructions. Or follow the quick tutorial below. + +### Prerequisites + +Install [Docker](https://www.docker.com/products/docker-desktop/) and make sure Docker Engine is running. + +![1](https://raw.githubusercontent.com/NanSike/image-host/main/images/1.png) + + + +### Install steps + +```Bash +git clone https://github.com/langgenius/Dify.git +cd Dify/docker +cp .env.example .env +docker compose up -d +``` + +![2](https://raw.githubusercontent.com/NanSike/image-host/main/images/2.png) + +Open your local Dify instance and complete the initial setup. + +![3](https://raw.githubusercontent.com/NanSike/image-host/main/images/3.png) + +# III. Add the model and test chat + +1. In **Settings → Model Providers → Ollama** , click **Add Ollama model type** . + + +![4](https://raw.githubusercontent.com/NanSike/image-host/main/images/4.png) + +2. Set **Base URL** to `http://localhost:11434`, select **Model name** `gpt-oss:20b`, and fill in the required fields. + + +![5](https://raw.githubusercontent.com/NanSike/image-host/main/images/5.png) + + + +3. Create a blank template + + +![6](https://raw.githubusercontent.com/NanSike/image-host/main/images/6.png) + + + +4. Select the app or workflow type you want to build. + + +![7](https://raw.githubusercontent.com/NanSike/image-host/main/images/7.png) + +* * * + +# IV. Verification and Usage + +* On Dify’s **model testing** page, send a prompt and check that the response looks correct. + +* In a workflow, add an **LLM** node, select `gpt-oss:20b`, and connect the nodes end to end. + + +![8](https://raw.githubusercontent.com/NanSike/image-host/main/images/8.png) + +![9](https://raw.githubusercontent.com/NanSike/image-host/main/images/9.png) + +* * * + +# V. Appendix — FAQ and tips + +**Model Pull Is Slow** + +* *Configure a Docker proxy or use an image mirror to speed up downloads.* + + +**Insufficient GPU Memory** + +* *Use* *`gpt-oss:20b`*. You can enable CPU offloading, but responses will be slower.* + +**Port Access Issues** + +* *Check firewall rules, port bindings, and Docker network settings to ensure connectivity.* \ No newline at end of file diff --git a/ja-jp/development/models-integration/Ollama+Dify による gpt-oss のローカルデプロイ.md b/ja-jp/development/models-integration/Ollama+Dify による gpt-oss のローカルデプロイ.md new file mode 100644 index 00000000..b56c5a3b --- /dev/null +++ b/ja-jp/development/models-integration/Ollama+Dify による gpt-oss のローカルデプロイ.md @@ -0,0 +1,99 @@ +--- +title: " Ollama+Dify による gpt-oss のローカルデプロイ" +--- + +## はじめに + +gpt-ossシリーズは、2025年8月にOpenAIからリリースされたオープンソースモデルです。 +- gpt-oss:20b(約16GBのメモリを持つシステム向け) +- gpt-oss:120b(60GB以上のメモリに対応) + +ローカルでOllamaを使用して実行できます。クラウド呼び出しは不要で、データは常にローカルに保存され、プライバシー保護と低遅延に貢献します。 + +DifyはAIエージェントやワークフローを構築するためのオープンソースプラットフォームです。このガイドでは、Ollamaを使ってgpt-ossを実行し、Difyに接続してプライベートかつ高性能な設定を行う方法を示します。 + +## 環境のセットアップ + +### ステップ1:Ollamaでgpt-ossを実行する + +**1. Ollamaをインストール** + +[Ollamaの公式サイト](https://ollama.com/)を通してmacOS、Windows、またはLinux用にダウンロードしてインストールしてください。 + +**2. gpt-ossモデルをインストール** + +```Bash +# 開発マシン用におすすめ +ollama pull gpt-oss:20b + +# 大規模GPUまたはマルチGPUホスト用におすすめ +ollama pull gpt-oss:120b +``` + +これらのモデルはすでに混合精度フォーマット(MXFP4)で量子化されており、ローカルデプロイに適しています。 + +**3. Ollamaの起動** + +デフォルトのエンドポイントはhttp://localhost:11434です。 + +### ステップ2:Difyをローカルにインストール + +Difyの[公式ドキュメント](https://docs.dify.ai/ja-jp/getting-started/install-self-hosted/readme)に完全な手順があります。もしくはこちらのシンプルなチュートリアルをご覧ください。 + +**前提条件** +[Docker](https://www.docker.com/products/docker-desktop/)をインストールし、Dockerエンジンが正常に動作していることを確認してください。 + +![1](https://raw.githubusercontent.com/NanSike/image-host/main/images/1.png) + +**インストール手順** + +```Bash +git clone https://github.com/langgenius/Dify.git +cd Dify/docker +cp .env.example .env +docker compose up -d +``` + +![2](https://raw.githubusercontent.com/NanSike/image-host/main/images/2.png) + +ローカルDifyインスタンスを開き、初期設定を完了させてください。 + +![3](https://raw.githubusercontent.com/NanSike/image-host/main/images/3.png) + +## モデルの追加とチャットのテスト + +1. **設定 > モデルプロバイダー > Ollama** に移動し、**「Ollamaモデルタイプを追加」**をクリックしてください。 + +![4](https://raw.githubusercontent.com/NanSike/image-host/main/images/4.png) + +2. 基本URLを`http://localhost:11434`に設定し、モデル名に`gpt-oss`を選択し、必要なフィールドを埋めてください。 + +![5](https://raw.githubusercontent.com/NanSike/image-host/main/images/5.png) + +3. 空のテンプレートを作成します。 + +![6](https://raw.githubusercontent.com/NanSike/image-host/main/images/6.png) + +4. 構築したいアプリのタイプを選択してください。 + +![7](https://raw.githubusercontent.com/NanSike/image-host/main/images/7.png) + +## 検証と使用 + +- Difyの**モデルテスト**ページでプロンプトを送信し、応答が期待通りであることを確認してください。 +- ワークフローに**LLMノード**を追加し、`gpt-oss:20b`を選択してノードをエンドツーエンドで接続してください。 + +![8](https://raw.githubusercontent.com/NanSike/image-host/main/images/8.png) + +![9](https://raw.githubusercontent.com/NanSike/image-host/main/images/9.png) + +## よくある質問 + +1. モデルのダウンロードが遅い + ダウンロードを高速化するために、Dockerプロキシを設定するか、イメージミラーを使用してください。 + +2. GPUメモリ不足 + `gpt-oss:20b`を使用してください。CPUオフローディングを有効にすることもできますが、その場合は応答が遅くなります。 + +3. ポートアクセスの問題 + 接続を確認するために、ファイアウォールのルール、ポートのバインディング、およびDockerネットワーク設定を確認してください。 \ No newline at end of file