mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-30 04:15:45 +08:00
- Add rerank model section to zh/en model configuration pages with supported providers table and Bailian extra_args guide - Update zh/en features pages with Cohere/Jina/Voyage providers and RAG rerank support - Add optional rerank configuration section to zh/en knowledge base pages
--- title: "配置模型 (Models)" --- ## LangBot Models LangBot Models 是 LangBot 官方提供的模型服务。当您使用 LangBot Space 账户初始化本地实例时,可用模型将被自动添加到您的实例中,无需进行任何配置。您将会获得一定的免费额度用于快速上手。 <img src="/images/zh/deploy/models/langbot_models.png" alt="langbot_models" /> 具体可用模型,请查看[LangBot Space](https://space.langbot.app/models)。 ## 自定义模型 您也可以添加其他来源的模型。LangBot 采用 **供应商(Provider)+ 模型(Model)** 的两层架构: - **供应商**:定义 API 地址(Base URL)和 API 密钥。同一供应商下的所有模型共享这些配置。 - **模型**:关联到一个供应商,指定具体的模型名称和能力。 ``` 供应商 (OpenAI) ├── Base URL: https://api.openai.com/v1 ├── API Keys: [sk-xxx] ├── LLM 模型: gpt-4o ├── LLM 模型: gpt-4o-mini ├── 向量模型: text-embedding-3-small └── 重排序模型: rerank-v3.5 ``` <Tip> 同一供应商下可以添加多个模型,它们会自动继承供应商的 API 地址和密钥,无需重复填写。 </Tip> ### 对话模型 (LLM Model) 对话模型将被流水线用于处理消息,您配置的第一个模型将被设置为默认流水线的模型。  可以添加多个模型,然后在流水线中选择具体使用什么模型。 <img width="400px" src="/images/zh/deploy/models/model_config.png" alt="model_config" /> 填入 `模型名称`、选择 `模型供应商`(或新建供应商并填入 `请求 URL` 和 `API Key`),然后提交即可。 模型能力方面,请根据具体模型特性来选择: - 视觉能力:需要启用才可以识图 - 函数调用:需要启用才可以在对话中使用 Agent 工具 ### 嵌入模型 (Embedding Model) 嵌入模型将被用于计算消息的向量,若您需要使用知识库,请配置此模型。 <img width="400px" src="/images/zh/deploy/models/embedding_model.png" alt="embedding_model" /> 填入 `模型名称`、选择 `模型供应商`,然后提交即可。之后请在知识库中配置使用此模型。 ### 使用 seekdb 内置嵌入模型(零配置) 系统已集成 seekdb 提供的官方嵌入模型,无需填写任何参数。 - 在”嵌入模型”页面选择「seekdb-内置」; - 点击「保存」即可立即使用; - 后续在知识库中选择该模型即可生效。 ### 重排序模型 (Rerank Model) 重排序模型用于对 RAG 检索结果进行重新评分排序,显著提升知识库回答的精准度。当知识库返回多个候选文档时,重排序模型会使用 cross-encoder 对每个文档与查询的相关性进行精确打分,筛选出最相关的内容。 填入 `模型名称`、选择 `模型供应商`,然后提交即可。之后请在流水线的”AI 能力”配置中选择此模型。 <Tip> 重排序模型是可选的。不配置时,知识库检索结果将按向量相似度排序直接使用。配置后,检索结果会经过重排序模型重新打分,只保留最相关的 Top-K 条结果。 </Tip> **支持的供应商和模型:** | 供应商 | 推荐模型 | 备注 | | --- | --- | --- | | [SiliconFlow](https://siliconflow.cn/) | `BAAI/bge-reranker-v2-m3`, `Qwen/Qwen3-Reranker-8B` | 国内推荐 | | [Jina](https://jina.ai/) | `jina-reranker-v2-base-multilingual` | 多语言支持 | | [Cohere](https://cohere.com/) | `rerank-v3.5` | 全球领先 | | [Voyage AI](https://voyageai.com/) | `rerank-2.5` | | | [GiteeAI](https://ai.gitee.com/) | `bge-reranker-v2-m3`, `Qwen3-Reranker-8B` | | | [阿里云百炼](https://bailian.console.aliyun.com/) | `qwen3-rerank`, `gte-rerank` | 需要额外参数,见下方 | | [OpenRouter](https://openrouter.ai/) | `cohere/rerank-v3.5`, `cohere/rerank-4-pro` | 通用网关 | | [302.AI](https://share.302.ai/SuTG99) | `jina-reranker-m0`, `qwen3-rerank` | | | OpenAI 兼容 | 任意支持 `/rerank` 的服务 | 通用 | ### 阿里云百炼使用重排序模型 阿里云百炼的重排序 API 端点路径与其 LLM 端点不同,需要在模型的**额外参数**中指定 `rerank_url`: 1. 添加模型时,选择 `阿里云百炼` 供应商 2. 填入模型名称(如 `qwen3-rerank`) 3. 在额外参数中添加一个参数: - Key: `rerank_url` - Type: `string` - Value: `https://dashscope.aliyuncs.com/compatible-api/v1/reranks` <Warning> 其他供应商(SiliconFlow、Jina、Cohere 等)无需填写额外参数,使用标准的 `/rerank` 端点即可。 </Warning>