LLM 提供商
MushroomAgent 支持多种 LLM 提供商。所有提供商在 config.yaml 中使用相同的 llm 配置块。未在下方列出的提供商将默认以 OpenAI 兼容模式运行。
OpenAI
llm:
api_type: "openai"
api_key: "sk-..."
base_url: "https://api.openai.com/v1"
model: "gpt-5.2"
默认提供商。大多数支持 OpenAI 兼容 API 的服务只需修改 base_url 即可使用。
使用 OpenAI Responses API 的模型可以设置 api_type: "openai_responses"。
DeepSeek
llm:
api_type: "deepseek"
api_key: "sk-..."
base_url: "https://api.deepseek.com"
model: "deepseek-chat"
使用原生 DeepSeek API 协议。
Anthropic(Claude)
llm:
api_type: "anthropic"
api_key: "sk-ant-..."
model: "claude-sonnet-4-20250514"
api_type: "claude" 也可以作为 "anthropic" 的别名使用。
Tip
Anthropic 不原生提供 OpenAI 兼容端点。要使用 Claude 模型,可直接设置 api_type: "anthropic",或通过代理服务暴露 OpenAI 兼容适配层(见下方说明)。
其他已注册的提供商
以下 api_type 值已在提供商系统中注册:
api_type | 提供商 | 说明 |
|---|---|---|
fireworks | Fireworks AI | OpenAI 兼容 |
open_llm | OpenLLM | OpenAI 兼容 |
moonshot | 月之暗面 (Moonshot) | OpenAI 兼容 |
mistral | Mistral AI | OpenAI 兼容 |
yi | 零一万物 (Yi) | OpenAI 兼容 |
gemini | Google Gemini | 使用 Gemini 原生 API |
zhipuai | 智谱 AI | GLM 模型 |
spark | 讯飞星火 | 星火 API |
qianfan | 百度千帆 | 百度 BCE |
azure | Azure OpenAI | 需要设置 api_version 和 base_url |
mushroom | MushroomAgent | 内部路由 |
通过 OpenAI 兼容代理使用
对于不在原生支持列表中的提供商,可以使用提供 OpenAI 兼容适配的代理服务:
llm:
api_type: "openai"
api_key: "sk-..."
base_url: "http://localhost:11434/v1" # Ollama 示例
model: "llama3"
Embedding 提供商
config.yaml 中 embedding 段支持的提供商:
api_type | 提供商 |
|---|---|
openai | OpenAI / OpenAI 兼容 |
dashscope | 阿里云 DashScope |