Merge pull request #451 from langgenius/multi-credential/siqi

Add docs for multi-credential-management
This commit is contained in:
Chenhe Gu
2025-09-05 19:28:13 +09:00
committed by GitHub
34 changed files with 378 additions and 78 deletions

View File

@@ -56,6 +56,7 @@
"group": "Model Configuration",
"pages": [
"en/guides/model-configuration/readme",
"en/guides/model-configuration/manage-model-credential",
"en/guides/model-configuration/new-provider",
"en/guides/model-configuration/predefined-model",
"en/guides/model-configuration/customizable-model",
@@ -688,6 +689,7 @@
"group": "接入大模型",
"pages": [
"zh-hans/guides/model-configuration/readme",
"zh-hans/guides/model-configuration/manage-model-credential",
"zh-hans/guides/model-configuration/new-provider",
"zh-hans/guides/model-configuration/predefined-model",
"zh-hans/guides/model-configuration/customizable-model",
@@ -1372,6 +1374,7 @@
"group": "モデルの設定",
"pages": [
"ja-jp/guides/model-configuration/README",
"ja-jp/guides/model-configuration/manage-model-credential",
"ja-jp/guides/model-configuration/new-provider",
"ja-jp/guides/model-configuration/predefined-model",
"ja-jp/guides/model-configuration/customizable-model",

View File

@@ -98,3 +98,4 @@ It will be automatically generated by the script.
---
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-pipeline/authorize-data-source.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -72,3 +72,4 @@ It will be automatically generated by the script.
---
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-pipeline/create-knowledge-pipeline.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -521,4 +521,5 @@ It will be automatically generated by the script.
---
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-pipeline/knowledge-pipeline-orchestration.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-pipeline/knowledge-pipeline-orchestration.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -21,4 +21,5 @@ It will be automatically generated by the script.
---
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-pipeline/manage-knowledge-base.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-pipeline/manage-knowledge-base.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -47,4 +47,5 @@ It will be automatically generated by the script.
---
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-pipeline/publish-knowledge-pipeline.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-pipeline/publish-knowledge-pipeline.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -48,4 +48,5 @@ It will be automatically generated by the script.
---
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-pipeline/create-from-knowledge-pipeline.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-pipeline/readme.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -55,4 +55,5 @@ It will be automatically generated by the script.
---
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-pipeline/upload-files.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-pipeline/upload-files.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -1,40 +1,43 @@
---
title: Load Balancing
title: Configure Load Balancing
---
Model rate limits are restrictions imposed by model providers on the number of times users or customers can access API services within a specified time frame. These limits help prevent API abuse or misuse, ensure fair access for all users, and control the overall load on the infrastructure.
In enterprise-level large-scale model API calls, high concurrent requests can exceed rate limits and affect user access. Load balancing can distribute API requests across multiple API endpoints, ensuring all users receive the fastest response and the highest model invocation throughput, thereby ensuring stable business operations.
You can enable this feature by navigating to **Model Provider -- Model List -- Configure Model Load Balancing** and adding multiple credentials (API keys) for the same model.
![Model Load Balancing](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/model-configuration/9cabd37adbb8f566f55dacd4a214c84b.png)
## Introduction
<Info>
Model load balancing is a paid feature. You can enable it by [subscribing to SaaS paid services](/en/getting-started/cloud#subscription-plan) or purchasing the enterprise edition.
Load balancing is a paid feature. You can enable it through [a paid SaaS subscription or an Enterprise license](https://dify.ai/pricing).
</Info>
The default API key is the credential added when initially configuring the model provider. You need to click **Add Configuration** to add different API keys for the same model to use the load balancing feature properly.
Model providers typically enforce rate limits on API access within a specific timeframe to ensure stability and fair use. For enterprise applications, a high volume of concurrent requests from a single credential can easily trigger these limits, disrupting user access.
![Configuring Load Balancing](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/model-configuration/4652cb43949869667b4fdd1a4f28fe64.png)
An effective solution is load balancing, which distributes request traffic across multiple model credentials. This prevents rate limit issues and single points of failure, ensuring business continuity and faster response times for all users.
**At least one additional model credential** must be added to save and enable load balancing.
Dify employs a round-robin strategy for load balancing, sequentially routing model requests to each credential in the load balancing pool. If a credential hits a rate limit, it is temporarily removed from rotation for one minute to avoid futile retries.
You can also **temporarily disable** or **delete** configured credentials.
## Procedure
![](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/model-configuration/625abfbd3ac73092fd446940d48652ae.png)
To configure load balancing for a model, follow these steps:
Once configured, all models with load balancing enabled will be displayed in the model list.
1. In the model list, find the target model, click the corresponding **Config**, and select **Load balancing**.
![Enabling Load Balancing](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/model-configuration/94125c036a277d962fdb50ada5ddf936.png)
2. In the load balancing pool, click **Add credential** to select from existing credentials or add a new one.
<Info>
By default, load balancing uses the Round-robin strategy. If the rate limit is triggered, a 1-minute cooldown period will be applied.
**Default Config** refers to the default credential currently specified for that model.
</Info>
You can also configure load balancing from **Add Model**, following the same process as above.
<Tip>
If a credential has a higher quota or better performance, you can add it multiple times to increase its weight in the load balancing rotation, allowing it to handle a larger share of the request load.
</Tip>
![Configuring Load Balancing from Add Model](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/model-configuration/f583fd97b2a954ab67db567af16236c0.png)
![Add credentials for load balancing](/images/add_load_balancing_credential.png)
3. Enable at least two credentials in the load balancing pool, then click **Save**. Models with load balancing enabled will be marked with a special icon.
![Load balancing icon](/images/load_balancing_icon.png)
<Info>
When you switch from load-balancing mode back to the default single-credential mode, your load-balancing configuration is preserved for future use.
</Info>
{/*
Contributing Section

View File

@@ -0,0 +1,89 @@
---
title: "Manage Model Credentials"
---
## Introduction
You can add multiple credentials for a model provider's predefined and custom models, and easily switch between, delete, or modify these credentials.
Here are some scenarios where adding multiple credentials is particularly helpful:
- **Environment Isolation**: Configure separate model credentials for different environments, such as development, testing, and production. For example, use a rate-limited credential in the development environment for debugging, and a paid credential with stable performance and a sufficient quota in the production environment to ensure service quality.
- **Cost Optimization**: Add and switch between multiple credentials from different accounts or model providers to maximize the use of free or low-cost quotas, thereby reducing application development and operational costs.
- **Model Testing**: During model fine-tuning or iteration, you may create multiple model versions. By adding credentials for these different versions, you can quickly switch between them to test and evaluate their performance.
<Tip>
You can also use multiple credentials to configure load balancing for a model. For more information, see [Configure Load Balancing](/en/guides/model-configuration/load-balancing).
</Tip>
## Procedure
<Tabs>
<Tab title="Predefined Model">
After installing a model provider and configuring the first credential, click **Config** in the upper-right corner to perform the following actions:
- Add a new credential
- Select a credential as the default for all predefined models
- Edit a credential
- Delete a credential
<Note>
If the default credential is deleted, you must manually specify a new one.
</Note>
![Manage credentials for predefined models](/images/predefined_model_credential.png)
</Tab>
<Tab title="Custom Model">
### Manage Credentials for a Single Custom Model
After installing a model provider and adding a custom model, follow these steps:
1. In the model list, click the corresponding **Config**.
2. In the **Specify model credential** panel, click the default credential to open the credential list, then perform the following actions:
- Add a new credential
- Select a credential as the default for that custom model
- Edit a credential
- Delete a credential
<Warning>
If you delete the only credential for a custom model, the model will also be deleted.
</Warning>
![Manage credentials for a single custom model](/images/custom_model_credential.png)
<Info>
When you add a new custom model with a name and type identical to an existing custom model, the system will add the new credential to that existing model rather than creating a duplicate.
</Info>
### Manage Credentials for All Custom Models
You can click **Manage Credentials** to view, edit, or delete the credentials for all custom models.
![Manage credentials for all custom models](/images/custom_model_credential_list.png)
After a custom model is removed, its credentials will remain in the **Manage Credentials** list. When you click **Add Model**, the system will display all removed custom models whose credentials still exist, allowing you to quickly re-add them.
![Removed models displayed for quick re-add](/images/removed_custom_model_re-add.png)
If you delete all credentials for a removed custom model from the **Manage Credentials** list, that model will no longer appear when you click **Add Model**.
</Tab>
</Tabs>
{/*
Contributing Section
DO NOT edit this section!
It will be automatically generated by the script.
*/}
---
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/model-configuration/manage-model-credential.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

View File

@@ -107,4 +107,5 @@ It will be automatically generated by the script.
---
[このページを編集](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/authorize-data-source.mdx) | [問題を報告](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/authorize-data-source.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -76,4 +76,5 @@ It will be automatically generated by the script.
---
[このページを編集](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/create-knowledge-pipeline.mdx) | [問題を報告](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/create-knowledge-pipeline.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -509,4 +509,5 @@ It will be automatically generated by the script.
---
[このページを編集](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/knowledge-pipeline-orchestration.mdx) | [問題を報告](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/knowledge-pipeline-orchestration.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -22,4 +22,5 @@ It will be automatically generated by the script.
---
[このページを編集](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/manage-knowledge-base.mdx) | [問題を報告](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/manage-knowledge-base.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -49,4 +49,5 @@ It will be automatically generated by the script.
---
[このページを編集](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/publish-knowledge-pipeline.mdx) | [問題を報告](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/publish-knowledge-pipeline.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -48,4 +48,5 @@ It will be automatically generated by the script.
---
[このページを編集](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/create-from-knowledge-pipeline.mdx) | [問題を報告](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/readme.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -53,4 +53,5 @@ It will be automatically generated by the script.
---
[このページを編集](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/upload-files.mdx) | [問題を報告](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/knowledge-base/knowledge-pipeline/upload-files.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -1,41 +1,44 @@
---
title: 負荷分散
title: "負荷分散の構成"
---
モデルのレート制限Rate limitsとは、モデルプロバイダーがユーザーまたは顧客に対し、指定された時間内にAPIサービスへアクセスする回数に対して設ける制限のことです。これにより、APIの乱用や誤用を防ぎ、すべてのユーザーが公平にAPIにアクセスできるようにし、インフラ全体の負荷を管理することができます。
企業レベルで大規模にモデルAPIを呼び出す際、高い同時リクエストがレート制限を超えてしまい、ユーザーのアクセスに影響を及ぼすことがあります。負荷分散は、複数のAPIエンドポイント間でAPIリクエストを分配することで、すべてのユーザーが最速の応答と最高のモデル呼び出しスループットを得られるようにし、ビジネスの安定した運用を保障します。
**モデルプロバイダー -- モデルリスト -- 負荷分散の設定** でこの機能を有効にし、同じモデルに複数の資格情報APIキーを追加することができます。
![モデルを負荷分散する](https://assets-docs.dify.ai/dify-enterprise-mintlify/jp/guides/model-configuration/5caa857ac9c263d557e970cb33558b1b.png)
## はじめに
<Info>
モデル負荷分散は有料機能です。[SaaS有料サービスのサブスクリプション](/ja-jp/getting-started/cloud)または企業版の購入を通じてこの機能を有効にすることができます。
ロードバランシングは有料機能です。[SaaS有料プランのサブスクリプションまたはエンタープライズ版の購入](https://dify.ai/jp/pricing)によって有効化できます。
</Info>
デフォルト設定では、APIキーは初回設定時にモデルプロバイダーに追加された資格情報です。**設定の追加** をクリックして、同じモデルの異なるAPIキーを追加することで、負荷分散機能を正常に使用できます。
モデルプロバイダーは通常、安定性と公平な利用を確保するため、特定の時間枠内でのAPIアクセスにレート制限を設けています。エンタープライズアプリケーションでは、単一の認証情報に対して大量の同時リクエストが発生すると、この制限に容易に達してしまい、ユーザーアクセスが中断される可能性があります。
![負荷分散の設定](https://assets-docs.dify.ai/dify-enterprise-mintlify/jp/guides/model-configuration/d8bfe128e70293392fcfa9df1505a2f4.png)
効果的な解決策はロードバランシングです。これは、リクエストのトラフィックを複数のモデル認証情報に分散させる手法です。これにより、レート制限の問題や単一障害点を回避し、ビジネスの継続性を確保するとともに、すべてのユーザーに対してより速い応答時間を実現します。
**少なくとも1つの追加モデル資格情報**を追加することで、保存し負荷分散を有効にできます。
Difyはロードバランシングにラウンドロビン方式を採用しており、モデルへのリクエストをロードバランシングプール内の各認証情報に順番にルーティングします。ある認証情報がレート制限に達した場合、無駄な再試行を避けるために、その認証情報は1分間、ローテーションから一時的に除外されます。
既に設定されている資格情報を**一時的に無効化**または**削除**することも可能です。
## 手順
![](https://assets-docs.dify.ai/dify-enterprise-mintlify/jp/guides/model-configuration/642c0ff7edfdfe77fba43aa22cc3fa71.png)
モデルのロードバランシングを設定するには、次の手順に従います。
設定完了後、モデルリスト内にすべての有効な負荷分散モデルが表示されます。
1. モデルリストで対象のモデルを探し、対応する **コンフィグ** をクリックして **負荷分散** を選択します。
![負荷分散の有効化](https://assets-docs.dify.ai/dify-enterprise-mintlify/jp/guides/model-configuration/6123eff333b31660fe2f92b0c2e16365.png)
2. ロードバランシングプールで **認証情報を追加する** をクリックし、既存の認証情報を選択するか、新しい認証情報を追加します。
<Info>
デフォルトでは、負荷分散はラウンドロビン戦略を使用します。レート制限を超えた場合、1分間のクールダウンタイムが適用されます。
**デフォルトの設定** は、そのモデルに現在指定されているデフォルトの認証情報を指します。
</Info>
**モデルの追加**からも負荷分散を設定することができ、設定手順は上記と同じです。
<Tip>
特定の認証情報がより高いクォータを持つ、またはより優れたパフォーマンスを示す場合は、その認証情報を複数回追加することでロードバランシングにおける重みを増し、より多くのリクエストを処理させることができます。
</Tip>
![モデルの追加から負荷分散を設定](https://assets-docs.dify.ai/dify-enterprise-mintlify/jp/guides/model-configuration/12970502b2e202d1f890dcecadf2dcbd.png)
![Add credentials for load balancing](/images/add_load_balancing_credential.png)
3. 負荷分散プールで少なくとも2つの認証情報を有効にし、**保存** をクリックします。負荷分散が有効になったモデルには、特別なアイコンが表示されます。
![Load balancing icon](/images/load_balancing_icon.png)
<Info>
ロード バランシング モードからデフォルトの単一認証情報モードに戻しても、ロード バランシングの設定は将来の使用のために保持されます。
</Info>
{/*
Contributing Section

View File

@@ -0,0 +1,89 @@
---
title: "モデルの認証情報を管理"
---
## はじめに
モデルプロバイダーの定義済みモデルやカスタムモデルに対して、複数の認証情報を追加し、それらの認証情報の切り替え、削除、変更を簡単に行うことができます。
以下のシナリオでは、複数のモデル認証情報を追加することをお勧めします。
- **環境の分離**: 開発、テスト、本番など、環境ごとに別々のモデル認証情報を設定します。例えば、開発環境ではデバッグ用にレート制限のある認証情報を使用し、本番環境ではサービスの品質を確保するために、安定したパフォーマンスと十分なクォータを持つ有料の認証情報を使用します。
- **コストの最適化**: 異なるアカウントやモデルプロバイダーから複数の認証情報を追加して切り替えることで、無料または低コストのクォータを最大限に活用し、アプリケーションの開発・運用コストを削減します。
- **モデルのテスト**: モデルのファインチューニングやイテレーションの過程で、複数のモデルバージョンを作成することがあります。これらの異なるバージョンの認証情報を追加することで、素早く切り替えてパフォーマンスのテストや評価を行うことができます。
<Tip>
複数の認証情報を使用して、モデルのロードバランシングを設定することもできます。詳細については、「[負荷分散の構成](/ja/guides/model-configuration/load-balancing)」を参照してください。
</Tip>
## 手順
<Tabs>
<Tab title="定義済みモデル">
モデルプロバイダーをインストールして最初の認証情報を設定した後、右上の **コンフィグ** をクリックして、以下の操作を実行します。
- 新しい認証情報を追加する
- すべての定義済みモデルのデフォルトとして認証情報を選択する
- 認証情報を編集する
- 認証情報を削除する
<Note>
デフォルトの認証情報を削除した場合は、手動で新しい認証情報を指定する必要があります。
</Note>
![Manage credentials for predefined models](/images/predefined_model_credential.png)
</Tab>
<Tab title="カスタムモデル">
### 個別のカスタムモデルの認証情報を管理する
モデルプロバイダーをインストールし、カスタムモデルを追加したら、以下の手順に従います。
1. モデルリストで、対応する **コンフィグ** をクリックします。
2. **モデルの資格情報を指定してください** パネルで、デフォルトの認証情報をクリックして認証情報リストを開き、次の操作を行います。
- 新しい認証情報を追加する
- 認証情報をそのカスタムモデルのデフォルトとして選択する
- 認証情報を編集する
- 認証情報を削除する
<Warning>
カスタムモデルの唯一の認証情報を削除すると、そのモデルも削除されます。
</Warning>
![Manage credentials for a single custom model](/images/custom_model_credential.png)
<Info>
既存のカスタムモデルと名前およびタイプが同一の新しいカスタムモデルを追加しようとすると、システムは重複したモデルを作成する代わりに、その既存モデルに新しい認証情報を追加します。
</Info>
### すべてのカスタムモデルの認証情報を管理する
**Manage Credentials** をクリックすると、すべてのカスタムモデルの認証情報を表示、編集、または削除できます。
![Manage credentials for all custom models](/images/custom_model_credential_list.png)
カスタムモデルを削除した後も、その認証情報は **Manage Credentials** リストに残ります。**モデルの追加** をクリックすると、認証情報が残っている削除済みのカスタムモデルがすべて表示され、それらをすばやく再追加できます。
![Removed models displayed for quick re-add](/images/removed_custom_model_re-add.png)
削除したカスタムモデルの認証情報をすべて **Manage Credentials** リストから削除した場合、そのモデルは **モデルの追加** をクリックしても表示されなくなります。
</Tab>
</Tabs>
{/*
Contributing Section
DO NOT edit this section!
It will be automatically generated by the script.
*/}
---
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/model-configuration/manage-model-credential.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -94,4 +94,5 @@ It will be automatically generated by the script.
---
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/authorize-data-source.mdx) | [报告问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/authorize-data-source.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -75,4 +75,5 @@ It will be automatically generated by the script.
---
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/create-knowledge-pipeline.mdx) | [报告问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/create-knowledge-pipeline.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -491,4 +491,5 @@ It will be automatically generated by the script.
---
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/knowledge-pipeline-orchestration.mdx) | [报告问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/knowledge-pipeline-orchestration.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -22,4 +22,5 @@ It will be automatically generated by the script.
---
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/manage-knowledge-base.mdx) | [报告问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/manage-knowledge-base.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -48,4 +48,5 @@ It will be automatically generated by the script.
---
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/publish-knowledge-pipeline.mdx) | [报告问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/publish-knowledge-pipeline.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -48,4 +48,5 @@ It will be automatically generated by the script.
---
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/create-from-knowledge-pipeline.mdx) | [报告问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/readme.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -54,4 +54,5 @@ It will be automatically generated by the script.
---
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/upload-files.mdx) | [报告问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/upload-files.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

View File

@@ -1,40 +1,44 @@
---
title: 负载均衡
title: 配置负载均衡
---
模型速率限制Rate limits是模型厂商对用户或客户在指定时间内访问 API 服务次数所添加的限制。它有助于防止 API 的滥用或误用,有助于确保每个用户都能公平地访问 API控制基础设施的总体负载。
在企业级大规模调用模型 API 时,高并发请求会导致超过请求速率限制并影响用户访问。负载均衡可以通过在多个 API 端点之间分配 API 请求,确保所有用户都能获得最快的响应和最高的模型调用吞吐量,保障业务稳定运行。
你可以在 **模型供应商 -- 模型列表 -- 设置模型负载均衡** 打开该功能,并在同一个模型上添加多个凭据 (API key)。
![模型负载均衡](https://assets-docs.dify.ai/dify-enterprise-mintlify/zh_CN/guides/model-configuration/c2781fddfb5c7e76023ac59c926d9e37.png)
## 介绍
<Info>
模型负载均衡为付费特性,你可以通过[订阅 SaaS 付费服务](../../getting-started/cloud.md#ding-yue-ji-hua)或者购买企业版来开启该功能
负载均衡为付费特性,通过[订阅 SaaS 付费服务或者购买企业版](https://dify.ai/zh/pricing)以启用
</Info>
默认配置中的 API Key 为初次配置模型供应商时添加的凭据,你需要点击 **增加配置** 添加同一模型的不同 API Key 来正常使用负载均衡功能
通常,模型供应商会限制用户在指定时间内访问 API 服务的次数(模型速率限制),以确保服务的稳定性与合理使用。对于企业级应用,来自单一凭据的高并发请求容易触发模型速率限制,从而影响用户访问
![配置负载均衡](https://assets-docs.dify.ai/dify-enterprise-mintlify/zh_CN/guides/model-configuration/cbf2149eb7fcf613599f50ff58381889.png)
而负载均衡可将请求流量分配至多个模型凭据,有效避免模型速率限制和单点故障,并为所有用户提供更快的响应速度,保障业务稳定运行。
**需要额外添加至少 1 个模型凭据**即可保存并开启负载均衡
Dify 采用轮询策略的负载均衡机制,即:将模型请求按顺序依次分配给负载均衡池中的各个凭据。若某个凭据触发模型速率限制,系统将在接下来一分钟内的轮询中暂时跳过该凭据,以避免无效重试
你也可以将已配置的凭据**临时停用**或者**删除**。
## 步骤
![](https://assets-docs.dify.ai/dify-enterprise-mintlify/zh_CN/guides/model-configuration/8012d5be22981efe0e59b81f32a961fe.png)
为模型配置负载均衡,按照以下步骤操作:
配置完成后再模型列表内会显示所有已开启负载均衡的模型
1. 在模型列表中找到目标模型,点击对应的 **配置**,选择 **负载均衡** 模式
![开启负载均衡](https://assets-docs.dify.ai/dify-enterprise-mintlify/zh_CN/guides/model-configuration/f69088f1f5a176aa0819a68950ac595c.png)
2. 在负载均衡池中,点击 **添加凭据**,从已有凭据中选择或添加新凭据。
<Info>
默认情况下,负载均衡使用 Round-robin 策略。如果触发速率限制,将应用 1 分钟的冷却时间
**默认配置** 为当前指定的默认凭据
</Info>
你也可以从 **添加模型** 配置负载均衡,配置流程与上面一致。
<Tip>
若某个凭据的配额充足或性能更优,可重复添加该凭据以增加其在负载均衡中的权重,使其承担更大比例的请求负载。
</Tip>
![从添加模型配置负载均衡](https://assets-docs.dify.ai/dify-enterprise-mintlify/zh_CN/guides/model-configuration/12970502b2e202d1f890dcecadf2dcbd.png)
![Add credentials for load balancing](/images/add_load_balancing_credential.png)
3. 在负载均衡池中启用至少 2 个凭据,点击 **保存**。已启用负载均衡的模型将带有特殊标识。
![Load balancing icon](/images/load_balancing_icon.png)
<Info>
从负载均衡模式切换回默认的单凭据模式时,系统将保留负载均衡配置以备后用。
</Info>
{/*
Contributing Section

View File

@@ -0,0 +1,88 @@
---
title: "管理模型凭据"
---
## 介绍
你可以为模型供应商的预定义模型和自定义模型添加多个凭据,并轻松进行切换、删除、修改等操作。
在以下场景中,推荐添加多个模型凭据:
- **环境隔离**:为开发、测试、生产等不同环境配置独立的模型凭据。例如,在开发环境中选择有速率限制的凭据用于功能调试,在生产环境中选择性能稳定、配额充足的付费凭据以保障服务质量。
- **成本优化**:通过添加和切换来自不同账户或模型供应商的多个凭据,最大限度地利用免费或低成本额度,降低应用开发与运营成本。
- **模型实验**:在模型微调或迭代过程中,可能会产出多个模型版本。通过添加不同模型版本的凭据,快速切换并测试其应用效果。
<Tip>
你可以使用多个凭据为模型配置负载均衡。更多信息,请阅读 [配置负载均衡](/zh-hans/guides/model-configuration/load-balancing)。
</Tip>
## 步骤
<Tabs>
<Tab title="预定义模型">
安装模型供应商并配置首个凭据后,点击供应商面板右上角的 **配置**,可进行以下操作:
- 添加新凭据
- 选择任一凭据作为所有预定义模型的默认凭据
- 修改凭据
- 删除凭据
<Note>
若默认凭据被删除,需手动指定新的默认凭据。
</Note>
![Manage credentials for predefined models](/images/predefined_model_credential.png)
</Tab>
<Tab title="自定义模型">
### 管理单个自定义模型的凭据
安装模型供应商并添加自定义模型后,按照以下步骤操作:
1. 在模型列表中,点击模型对应的 **配置**。
2. 在 **指定模型凭据** 面板中,点击默认凭据以打开凭据列表,可进行以下操作:
- 添加新凭据
- 选择任一凭据作为该自定义模型的默认凭据
- 修改凭据
- 删除凭据
<Warning>
若删除某个自定义模型的唯一凭据,该模型将被一同删除。
</Warning>
![Manage credentials for a single custom model](/images/custom_model_credential.png)
<Info>
添加自定义模型时,若填写的模型名称与模型类型与一个已存在的自定义模型完全相同,系统将不会创建重复的模型,而是会为已存在的模型添加一个新的凭据。
</Info>
### 管理所有自定义模型的凭据
你可以点击 **管理凭据**,查看、修改或删除所有自定义模型的凭据。
![Manage credentials for all custom models](/images/custom_model_credential_list.png)
对于被移除的自定义模型,其所有凭据仍将保留在 **管理凭据** 列表中。当你点击 **添加模型** 时,系统将展示所有已移除但凭据尚存的自定义模型,供你快速重新添加。
![Removed models displayed for quick re-add](/images/removed_custom_model_re-add.png)
若从 **管理凭据** 列表中删除某个已移除的自定义模型的所有凭据,该模型将不会在点击 **添加模型** 时出现。
</Tab>
</Tabs>
{/*
Contributing Section
DO NOT edit this section!
It will be automatically generated by the script.
*/}
---
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/model-configuration/manage-model-credential.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)