Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

在readme补充千问使用方法 (#364)

JJF4a561476009e
diff --git a/README.md b/README.md
index 1a40a85d1..c8ddbeec7 100644
--- a/README.md
+++ b/README.md
@@ -168,9 +168,11 @@ You can also use a custom OpenAI-compatible endpoint:
</details>
<details>
-<summary><b>LiteLLM (Anthropic, DeepSeek, Gemini, vLLM, Ollama, etc.)</b></summary>
+<summary><b>LiteLLM (Anthropic, DeepSeek, Gemini, Qwen, vLLM, Ollama, etc.)</b></summary>
-LiteLLM provides unified access to various models. The `model` field should follow LiteLLM's naming convention:
+LiteLLM provides unified access to various models. The `model` field should follow LiteLLM's naming convention. Here we use Claude and Qwen as examples:
+
+**Anthropic:**
```json
{
@@ -182,6 +184,23 @@ LiteLLM provides unified access to various models. The `model` field should foll
}
```
+**Qwen (DashScope):**
+
+```json
+{
+ "vlm": {
+ "provider": "litellm",
+ "model": "dashscope/qwen-turbo", // see https://docs.litellm.ai/docs/providers/dashscope for more details
+ "api_key": "your-dashscope-api-key",
+ "api_base": "https://dashscope.aliyuncs.com/compatible-mode/v1"
+ }
+}
+```
+
+> 💡 **Tip for Qwen**:
+> - For **China/Beijing** region, use `api_base`: `https://dashscope.aliyuncs.com/compatible-mode/v1`
+> - For **International** region, use `api_base`: `https://dashscope-intl.aliyuncs.com/compatible-mode/v1`
+
**Common model formats:**
| Provider | Model Example | Notes |
@@ -189,6 +208,7 @@ LiteLLM provides unified access to various models. The `model` field should foll
| Anthropic | `claude-3-5-sonnet-20240620` | Auto-detected, uses `ANTHROPIC_API_KEY` |
| DeepSeek | `deepseek-chat` | Auto-detected, uses `DEEPSEEK_API_KEY` |
| Gemini | `gemini-pro` | Auto-detected, uses `GEMINI_API_KEY` |
+| Qwen | `dashscope/qwen-turbo` | Set `api_base` based on region (see above) |
| OpenRouter | `openrouter/openai/gpt-4o` | Full prefix required |
| vLLM | `hosted_vllm/llama-3.1-8b` | Set `api_base` to vLLM server |
| Ollama | `ollama/llama3.1` | Set `api_base` to Ollama server |
diff --git a/README_CN.md b/README_CN.md
index 44e367aa7..37009d2c5 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -167,9 +167,11 @@ Volcengine 支持模型名称和端点 ID。为简单起见,建议使用模型
</details>
<details>
-<summary><b>LiteLLM (Anthropic, DeepSeek, Gemini, vLLM, Ollama 等)</b></summary>
+<summary><b>LiteLLM (Anthropic, DeepSeek, Gemini, Qwen, vLLM, Ollama 等)</b></summary>
-LiteLLM 提供对各种模型的统一访问。`model` 字段应遵循 LiteLLM 的命名约定:
+LiteLLM 提供对各种模型的统一访问。`model` 字段应遵循 LiteLLM 的命名约定。以下以 Claude 和 Qwen 为例:
+
+**Anthropic:**
```json
{
@@ -181,6 +183,23 @@ LiteLLM 提供对各种模型的统一访问。`model` 字段应遵循 LiteLLM
}
```
+**Qwen (DashScope):**
+
+```json
+{
+ "vlm": {
+ "provider": "litellm",
+ "model": "dashscope/qwen-turbo",
+ "api_key": "your-dashscope-api-key",
+ "api_base": "https://dashscope.aliyuncs.com/compatible-mode/v1"
+ }
+}
+```
+
+> 💡 **Qwen 提示**:
+> - **中国/北京** 区域,使用 `api_base`:`https://dashscope.aliyuncs.com/compatible-mode/v1`
+> - **国际** 区域,使用 `api_base`:`https://dashscope-intl.aliyuncs.com/compatible-mode/v1`
+
**常见模型格式:**
| 提供商 | 模型示例 | 说明 |
@@ -188,6 +207,7 @@ LiteLLM 提供对各种模型的统一访问。`model` 字段应遵循 LiteLLM
| Anthropic | `claude-3-5-sonnet-20240620` | 自动检测,使用 `ANTHROPIC_API_KEY` |
| DeepSeek | `deepseek-chat` | 自动检测,使用 `DEEPSEEK_API_KEY` |
| Gemini | `gemini-pro` | 自动检测,使用 `GEMINI_API_KEY` |
+| Qwen | `dashscope/qwen-turbo` | 根据区域设置 `api_base`(见上方说明) |
| OpenRouter | `openrouter/openai/gpt-4o` | 需要完整前缀 |
| vLLM | `hosted_vllm/llama-3.1-8b` | 设置 `api_base` 为 vLLM 服务器 |
| Ollama | `ollama/llama3.1` | 设置 `api_base` 为 Ollama 服务器 |