跳到主要内容

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提供商说明
fireworksFireworks AIOpenAI 兼容
open_llmOpenLLMOpenAI 兼容
moonshot月之暗面 (Moonshot)OpenAI 兼容
mistralMistral AIOpenAI 兼容
yi零一万物 (Yi)OpenAI 兼容
geminiGoogle Gemini使用 Gemini 原生 API
zhipuai智谱 AIGLM 模型
spark讯飞星火星火 API
qianfan百度千帆百度 BCE
azureAzure OpenAI需要设置 api_versionbase_url
mushroomMushroomAgent内部路由

通过 OpenAI 兼容代理使用

对于不在原生支持列表中的提供商,可以使用提供 OpenAI 兼容适配的代理服务:

  • One API — 多提供商 OpenAI 兼容代理
  • LiteLLM — LLM 代理,提供 OpenAI 兼容 API
  • Ollama — 本地 LLM,提供 OpenAI 兼容 API
llm:
api_type: "openai"
api_key: "sk-..."
base_url: "http://localhost:11434/v1" # Ollama 示例
model: "llama3"

Embedding 提供商

config.yamlembedding 段支持的提供商:

api_type提供商
openaiOpenAI / OpenAI 兼容
dashscope阿里云 DashScope