mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-17 11:07:11 +08:00
feat(web): integrate custom providers into the provider credentials section
- Merge the separate custom-providers section into the unified provider grid; "Custom" in the add-provider picker now acts as an add-new action (trailing + mark) and opens the dedicated modal, supporting multiple OpenAI-compatible endpoints - Simplify the custom provider modal: drop the default-model field, add an inline delete button, align colors with the theme - Keep the legacy single "custom" card visible (models page, chat dropdown and legacy config page) while custom_api_key/custom_api_base is still in use, so existing single-provider setups don't disappear - Unify user-facing wording from "vendor" to "provider" in UI and docs - Restructure custom provider docs (zh/en/ja) around Web console and config file usage
This commit is contained in:
@@ -1,69 +1,31 @@
|
||||
---
|
||||
title: Custom
|
||||
description: Custom vendor configuration for third-party API proxies and local models
|
||||
title: カスタム
|
||||
description: サードパーティ API プロキシやローカルモデル向けのカスタムプロバイダー設定
|
||||
---
|
||||
|
||||
For model services accessed via the OpenAI-compatible protocol or locally deployed models, such as:
|
||||
OpenAI 互換プロトコルで接続するモデルサービス向けの設定です。例えば:
|
||||
|
||||
- **Third-party API proxies**: call multiple models through a unified API base
|
||||
- **Local models**: models deployed locally with tools like Ollama, vLLM, LocalAI
|
||||
- **Private deployments**: model services deployed inside an enterprise
|
||||
- **サードパーティ API プロキシ**:統一された API アドレスで複数のモデルを呼び出す
|
||||
- **ローカルモデル**:Ollama、vLLM などのツールでローカルにデプロイしたモデル
|
||||
- **プライベートデプロイ**:企業内部にデプロイされたモデルサービス
|
||||
|
||||
<Note>
|
||||
Difference from the `openai` vendor: when a custom vendor is selected, switching models via `/config model` does not automatically switch the vendor type — the custom API address is always used.
|
||||
</Note>
|
||||
## Web コンソールでの設定
|
||||
|
||||
## Text Chat
|
||||
推奨方法です。Web コンソールの「モデル」ページで「プロバイダーを追加」をクリックし、「カスタム」を選択して、名称・API Base・API Key を入力します。複数のカスタムプロバイダーを追加でき、追加後は「メインモデル」でプロバイダーとモデルを選択すると有効になります。
|
||||
|
||||
### Third-party API proxy
|
||||
<img width="900" src="https://cdn.jsdelivr.net/gh/zhayujie/cowagent-assets@main/screenshots/en/web-console-custom-model-config.png" />
|
||||
|
||||
```json
|
||||
{
|
||||
"bot_type": "custom",
|
||||
"model": "",
|
||||
"custom_api_key": "YOUR_API_KEY",
|
||||
"custom_api_base": "https://{your-proxy.com}/v1"
|
||||
}
|
||||
```
|
||||
主なローカルデプロイツールのデフォルトアドレス:
|
||||
|
||||
| Parameter | Description |
|
||||
| --- | --- |
|
||||
| `bot_type` | Must be set to `custom` |
|
||||
| `model` | Model name; any model name supported by the proxy service |
|
||||
| `custom_api_key` | API key provided by the proxy service |
|
||||
| `custom_api_base` | API endpoint provided by the proxy service; must be OpenAI-compatible |
|
||||
|
||||
### Local models
|
||||
|
||||
Local models usually do not require an API key — only the API base needs to be filled in:
|
||||
|
||||
```json
|
||||
{
|
||||
"bot_type": "custom",
|
||||
"model": "qwen3.5:27b",
|
||||
"custom_api_base": "http://localhost:11434/v1"
|
||||
}
|
||||
```
|
||||
|
||||
Common local deployment tools and their default endpoints:
|
||||
|
||||
| Tool | Default API Base |
|
||||
| ツール | デフォルト API Base |
|
||||
| --- | --- |
|
||||
| [Ollama](https://ollama.com) | `http://localhost:11434/v1` |
|
||||
| [vLLM](https://docs.vllm.ai) | `http://localhost:8000/v1` |
|
||||
| [LocalAI](https://localai.io) | `http://localhost:8080/v1` |
|
||||
|
||||
### Switching Models
|
||||
## 設定ファイルでの設定
|
||||
|
||||
Switching models under a custom vendor only changes `model` — `bot_type` and the API endpoint remain unchanged:
|
||||
|
||||
```
|
||||
/config model qwen3.5:27b
|
||||
```
|
||||
|
||||
## Configuring Multiple Custom Providers
|
||||
|
||||
If you need to configure several OpenAI-compatible third-party services at once (e.g. SiliconFlow, Qiniu), use the `custom_providers` list and activate one by setting `bot_type` to `"custom:<id>"`:
|
||||
`config.json` を直接編集することもできます。`custom_providers` リストに複数のプロバイダーを定義し、`bot_type` を `"custom:<id>"` に設定していずれかを有効化します:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -71,34 +33,30 @@ If you need to configure several OpenAI-compatible third-party services at once
|
||||
"custom_providers": [
|
||||
{
|
||||
"id": "3f2a9c1b",
|
||||
"name": "siliconflow",
|
||||
"api_key": "YOUR_SILICONFLOW_KEY",
|
||||
"api_base": "https://api.siliconflow.cn/v1",
|
||||
"model": "deepseek-ai/DeepSeek-V3"
|
||||
"name": "プロバイダーA",
|
||||
"api_key": "YOUR_API_KEY_A",
|
||||
"api_base": "https://api.a.com/v1",
|
||||
"model": "deepseek-v3"
|
||||
},
|
||||
{
|
||||
"id": "a1b2c3d4",
|
||||
"name": "qiniu",
|
||||
"api_key": "YOUR_QINIU_KEY",
|
||||
"api_base": "https://api.qnaigc.com/v1",
|
||||
"model": "deepseek-v3"
|
||||
"name": "プロバイダーB",
|
||||
"api_key": "YOUR_API_KEY_B",
|
||||
"api_base": "https://api.b.com/v1",
|
||||
"model": "qwen3-max"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
| Parameter | Description |
|
||||
| パラメータ | 説明 |
|
||||
| --- | --- |
|
||||
| `custom_providers` | List of custom providers; each item has `id`, `name`, `api_key`, `api_base`, and an optional `model` |
|
||||
| `bot_type` | Set to `"custom:<id>"` to activate a specific provider; `id` is the provider's unique identifier |
|
||||
| `id` | Server-generated short identifier (8-char hex); used as the primary key for each provider |
|
||||
| `name` | User-facing display label — can be freely renamed without breaking anything |
|
||||
| `model` | Optional; when set, this model is used instead of the global `model` field |
|
||||
| `custom_providers` | カスタムプロバイダーのリスト。各項目は `id`、`name`、`api_base`、`api_key`(任意)、`model`(任意)を含む |
|
||||
| `bot_type` | `"custom:<id>"` に設定して対応するプロバイダーを有効化 |
|
||||
| `id` | 一意の識別子(8 桁の 16 進数)。Web コンソールから追加すると自動生成され、手動設定の場合は重複しない任意の文字列でよい |
|
||||
| `name` | 表示名。自由に変更可能 |
|
||||
| `model` | このプロバイダーで使用するモデル。有効化時に適用される |
|
||||
|
||||
<Note>
|
||||
The `id` is auto-generated by the web console when you add a provider — you don't need to create it manually. If editing `config.json` by hand, use any unique 8-character hex string (e.g. run `python3 -c "import uuid; print(uuid.uuid4().hex[:8])"`).
|
||||
</Note>
|
||||
|
||||
<Note>
|
||||
When `bot_type` is exactly `"custom"` (no colon suffix), CowAgent uses the legacy single-provider `custom_api_key` / `custom_api_base` fields, so existing configurations keep working without any changes.
|
||||
従来の単一プロバイダー設定(`bot_type` を `"custom"` にし、`custom_api_key` / `custom_api_base` を使用)は引き続き互換性があり、変更なしでそのまま利用できます。
|
||||
</Note>
|
||||
|
||||
Reference in New Issue
Block a user