AI Agent 开发与评估平台Spring AI Alibaba Admin的安装部署

Spring AI Alibaba Admin是一个AI Agent 开发与评估平台,旨在为开发者和企业提供完整的 AI Agent 生命周期管理解决方案。平台支持从 Prompt 工程、数据集管理、评估器配置到实验执行和结果分析的完整工作流,协助用户快速构建、测试和优化 AI Agent 应用。

AI Agent 开发与评估平台Spring AI Alibaba Admin的安装部署

源码安装部署

1、下载源码

git clone https://github.com/spring-ai-alibaba/spring-ai-alibaba-admin.git

AI Agent 开发与评估平台Spring AI Alibaba Admin的安装部署

2、使用开发工具进行打开

AI Agent 开发与评估平台Spring AI Alibaba Admin的安装部署

3.配置您的 API 密钥

根据您的模型供应商,修改
spring-ai-alibaba-admin-server/model-config.yaml 的模型配置。

  • 如果您使用DashScope,请参照model-config-dashscope.yaml模版进行配置
  • 如果您使用DeepSeek,请参照model-config-deepseek.yaml模版进行配置
  • 如果您使用OpenAI,请参照model-config-openai.yaml模版进行配置

AI Agent 开发与评估平台Spring AI Alibaba Admin的安装部署

4.执行脚本和更改配置

脚本在
docker/middleware/init/mysql下面,执行完在配置文件中更改数据库配置,然后启动工程

AI Agent 开发与评估平台Spring AI Alibaba Admin的安装部署

前端安装运行

npm install
npm run dev

AI Agent 开发与评估平台Spring AI Alibaba Admin的安装部署

AI Agent 开发与评估平台Spring AI Alibaba Admin的安装部署

5、访问地址http://127.0.0.1:8080/,就可以打开工作台了

AI Agent 开发与评估平台Spring AI Alibaba Admin的安装部署

项目定位

  • 提供可视化界面,用于管理 Spring AI 应用中对接的大模型服务配置(特别是阿里云百炼、通义千问等)。
  • 支持动态切换模型、调试 Prompt、查看调用日志、管理 API Key 等运维操作。
  • 作为 Spring AI Alibaba Starter 的配套管理工具,提升开发与运维效率。

核心功能

  • 模型服务管理:聚焦配置多个大模型(如 qwen-max、qwen-plus 等)的 endpoint、API key、超参数。
  • Prompt 模板管理:可视化编辑、测试和版本化 Prompt 模板。
  • 调用监控与日志:记录每次 AI 调用的请求/响应、耗时、Token 消耗等。
  • 多环境支持:支持 dev/test/prod 等不同环境的配置隔离。

至此,您已经可以在平台中对 prompt 进行管理、调试、评估、可观测。如果您期望 Spring AI Alibaba Agent 应用能够集成 Nacos 以实现 prompt 加载以及动态更新,并且观测线上的运行情况。

连接您的 AI Agent 应用

在您的 Spring AI Alibaba Agent应用中,引入如下依赖

<dependencies>
    <!-- 引入spring ai alibaba agent nacos代理模块 -->
    <dependency>
        <groupId>com.alibaba.cloud.ai</groupId>
        <artifactId>spring-ai-alibaba-agent-nacos</artifactId>
        <version>{spring.ai.alibaba.version}</version>
    </dependency>

    <!-- 引入可观测模块 -->

    <dependency>
        <groupId>com.alibaba.cloud.ai</groupId>
        <artifactId>spring-ai-alibaba-autoconfigure-arms-observation</artifactId>
        <version>{spring.ai.alibaba.version}</version>
    </dependency>
    
    
    <!-- 用于实现各种 OTel 相关组件,如 Tracer、Exporter 的自动装载 -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    
    <!-- 用于将 micrometer 产生的指标数据对接到 otlp 格式 -->
    <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-registry-otlp</artifactId>
    </dependency>
    
    <!-- 用于将 micrometer 底层的链路追踪 tracer 替换为 OTel tracer -->
    <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-tracing-bridge-otel</artifactId>
    </dependency>
    
    <!-- 用于将 OTel tracer 产生的 span 按照 otlp 协议进行上报 -->
    <dependency>
        <groupId>io.opentelemetry</groupId>
        <artifactId>opentelemetry-exporter-otlp</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.ai</groupId>
        <artifactId>spring-ai-autoconfigure-model-tool</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>

指定nacos地址及prompKey

    spring.ai.alibaba.agent.proxy.nacos.serverAddr={ 替换 nacos address, 示例:127.0.0.1:8848}
    spring.ai.alibaba.agent.proxy.nacos.username={ 替换 nacos 用户名, 示例:nacos}
    spring.ai.alibaba.agent.proxy.nacos.password={ 替换 nacos 密码, 示例:nacos}
    spring.ai.alibaba.agent.proxy.nacos.promptKey={ 替换为promptKey,示例:mse-nacos-helper } 

设置可观察参数

    management.otlp.tracing.export.enabled=true
    management.tracing.sampling.probability=1.0
    management.otlp.tracing.endpoint=http://{admin address}:4318/v1/traces
    management.otlp.metrics.export.enabled=false
    management.otlp.logging.export.enabled=false
    management.opentelemetry.resource-attributes.service.name=agent-nacos-prompt-test
    management.opentelemetry.resource-attributes.service.version=1.0
    spring.ai.chat.client.observations.log-prompt=true
    spring.ai.chat.observations.log-prompt=true
    spring.ai.chat.observations.log-completion=true
    spring.ai.image.observations.log-prompt=true
    spring.ai.vectorstore.observations.log-query-response=true
    spring.ai.alibaba.arms.enabled=true
    spring.ai.alibaba.arms.tool.enabled=true
    spring.ai.alibaba.arms.model.capture-input=true
    spring.ai.alibaba.arms.model.capture-output=true
© 版权声明

相关文章

2 条评论

  • 二次元时光机
    二次元时光机 投稿者

    对开发者帮助很大👍

    回复
  • 肉桂卷女士
    肉桂卷女士 投稿者

    收藏了,感谢分享

    回复