1
0
md/MultiAgentOptions.md
liushuang 5e91eadcdb add
2025-09-30 15:46:47 +08:00

66 lines
3.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 横评构建企业级 LLM 应用,主流的、开源框架
## 基础能力
| 对比项 | SAA| Spring AI | LangChain4J | LangChain |
|:-----|:-----|:-----|:-----|:-----|
| 语言 | Java | Java | Java | Python |
| 聊天模型 | ✅ | ✅ | ✅ | ✅ |
| 嵌入模型 | ✅ | ✅ | ✅ | ✅ |
| 图片、音视频模型 | ✅ | ✅ | ✅ | **百度千帆、百川智能支持多模态**<br/>**阿里百炼不支持多模态** |
| RAG | ✅ | ✅ | ✅ | ✅ |
| 向量数据库 | **除主流向量数据库外,还支持阿里云:<br/>AnalyticDB (ADB)、OpenSearch** | ✅ | ✅ | ✅ |
| MCP | **支持 Nacos MCP Registry** | ✅ | ✅ | ✅ |
| 函数调用 | ✅ | ✅ | ✅ | ✅ |
| 提示词模板 | **支持通过 Nacos 热更新,无需重启应用** | ✅ | ✅ | ✅ |
| 聊天记忆 | ✅ | ✅ | ✅ | ✅ |
| 模型评估 | ✅ | ✅ | ✅ | ✅ |
> 💡SAA 是 Spring AI Alibaba 的官方简称。**SAA 在对 MCP 工具、提示词模板的管理具有明显优势,尤其适合企业级 LLM 应用的构建。**
## 可观测性OpenTelemetry
**OpenTelemetry** 通常缩写为**OTel**,是一个开源的、厂商中立的可观测性框架,旨在实现遥测数据的标准化生成、收集和管理。遥测数据包括日志、指标和追踪,这些数据对于监控和理解软件系统的行为至关重要。
| Spring AI | SAA | LangChain4J | LangChain |
|:-----|:-----|:-----|:-----|
| ✅ | ✅ | ❌ | ✅ |
**Spring AI**框架定义了一系列endpoint为其核心组件提供了指标和追踪能力例如 ChatClient包括 Advisor、ChatModel、EmbeddingModel、ImageModel 和 VectorStore 等。**SAA**除了拥有**Spring AI**的能力还提供了配套工具无需额外编写代码即可扇出至阿里云ARMS。**LangChain4J**提供了一系列**Listener**,通过 OTel 扇出数据,需要自行实现。**LangChain**自带**LangSmith**并且支持了OTel仅需少量代码即可扇出数据。
#### Spring AI 对于 ChatModel 仅适配了部分模型提供商
| 阿里百炼 | 百度千帆 | 月之暗面 | 智谱 | Anthropic | OpenAI | Ollama | Xinference | GPUStack |
|:-----|:-----|:-----|:-----|:-----|:-----|:-----|:-----|:-----|
| ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
> 💡未提到的厂商,官方宣称将在未来支持。
## 云计算平台模型提供商对开源框架的适配
| 对比项 | Open AI | Anthropic | 阿里百炼 | 百度千帆 |
|:-----|:-----|:-----|:-----|:-----|
| SAA | ✅ | ✅ | 深度适配 | ✅ |
| Spring AI | ✅ | ✅ | ✅ | ✅ |
| LangChain4J | ✅ | ✅ | ✅ | ✅ |
| LangChain | ✅ | ✅ | 部分适配 | ✅ |
> 💡阿里百炼对于**LangChain**仅通过 langchain-openai 适配了部分模型:聊天模型、嵌入模型、重排序模型,**不支持多模态模型**。
## 适合用于智能体开发的框架对比
| 对比项 | SAA | LangGraph | AutoGen | Crew AI | Manus |
|:-----|:-----|:-----|:-----|:-----|:-----|
## 参考来源
- SAA 官网https://java2ai.com
- Spring AI 官网https://docs.springframework.org.cn/spring-ai/reference/index.html
- LangChain4J 官网https://docs.langchain4j.info/get-started
- LangChain 官网https://python.langchain.ac.cn/docs/introduction
- 使用 OpenTelemetry 跟踪 LangChainhttps://langsmith.langchain.ac.cn/observability/how_to_guides/trace_langchain_with_otel
- 使用 OpenTelemetry 客户端将记录到 LangSmithhttps://langsmith.langchain.ac.cn/observability/how_to_guides/trace_with_opentelemetry
- Spring AI 可观测性https://docs.springframework.org.cn/spring-ai/reference/observability/index.html
- Spring AI 官网对于聊天模型可观测性的支持说明https://docs.springframework.org.cn/spring-ai/reference/observability/index.html#_chat_model
- 阿里百炼对于langchain的适配https://help.aliyun.com/zh/model-studio/use-bailian-in-langchain
- 百度千帆对于langchain的适配https://cloud.baidu.com/doc/qianfan-docs/s/Mm9cr5bs6