当前位置: 首页 > news >正文

AutoGen【部署 01】Windows环境安装部署AutoGen、AutoGenStudio和LiteLLM流程说明

Windows环境安装部署AutoGen、AutoGenStudio和LiteLLM

  • 1.AutoGen 环境搭建
    • 1.1 Anaconda 创建虚拟环境
    • 1.2 安装 AutoGen 及扩展
    • 1.3 安装 AutoGenStudio
  • 2.安装 LiteLLM

AutoGen is a framework for creating multi-agent AI applications that can act autonomously or work alongside humans.

AutoGen 是一个用于开发多智能体 AI 应用的框架,此类应用既可自主运行,亦可与人类协同工作。

1.AutoGen 环境搭建

1.1 Anaconda 创建虚拟环境

Anaconda 的安装操作这里不再赘述,官网说明 AutoGen requiresPython 3.10 or later

# 创建虚拟环境conda create -n AutoGenpython=3.10

也可以直接安装 Python3.10 版本。

1.2 安装 AutoGen 及扩展

AutoGen 的 GitHub 地址:https://github.com/microsoft/autogen,亲测使用 conda 安装失败,使用 pip 进行安装:

# 安装AutoGen和扩展模块,提供模型客户端和外部工具的支持。# Install AgentChat and OpenAI client from Extensionspipinstall-U"autogen-agentchat""autogen-ext[openai]"

1.3 安装 AutoGenStudio

AutoGenStudio 的 GitHub 地址:https://github.com/microsoft/autogen/tree/main/python/packages/autogen-studio

# Install AutoGen Studio for no-code GUIpipinstall-U"autogenstudio"
# 启动 Web Uiautogenstudio ui --port8081# 输出的信息INFO: Loading environment from'C:\Users\Lenovo\.autogenstudio\temp_env_vars.env'C:\Users\Lenovo\.conda\envs\AutoGen\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work warn("Couldn'tfindffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)2025-12-2518:05:52.424|INFO|autogenstudio.web.initialization:__init__:39 - Initializing application data folder: C:\Users\Lenovo\.autogenstudio2025-12-2518:05:52.424|INFO|autogenstudio.web.auth.manager:__init__:26 - Initialized auth manager with provider: none INFO: Started server process[20352]INFO: Waitingforapplication startup.2025-12-2518:05:52.544|INFO|autogenstudio.database.db_manager:initialize_database:82 - Creating database tables...2025-12-2518:05:52.604|INFO|autogenstudio.database.schema_manager:_initialize_alembic:133 - Alembic initialization complete INFO[alembic.runtime.migration]Context impl SQLiteImpl. INFO[alembic.runtime.migration]Will assume non-transactional DDL.2025-12-2518:05:52.751|INFO|autogenstudio.web.app:lifespan:39 - Application startup complete. Navigate to http://127.0.0.1:8081

AutoGen Studio 还接受多个参数来自定义应用程序:

  • –host :指定主机地址。默认情况下是本机 localhost。
  • –appdir :指定应用程序文件(例如,数据库和生成的用户文件)的存储目录。默认情况下,它设置为用户主目录中的 .autogenstudio 目录。
  • –port :指定端口号。默认情况下,它设置为 8080。
  • –reload :在代码更改时启用服务器自动重新加载。默认情况下,它设置为 False。
  • –database-uri :指定数据库 URI。示例值包括 SQLite 的 sqlite:///database.sqlite 和 PostgreSQL 的 postgresql+psycopg://user:password@localhost/dbname。如果未指定,数据库 URL 默认为 --appdir 目录中的 database.sqlite 文件。
  • –upgrade-database :将数据库架构升级到最新版本。默认情况下,该参数设置为 False。

访问 Web UI http://127.0.0.1:8081:

2.安装 LiteLLM

AutoGen 支持的模型说明:https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/tutorial/models.html,想要使用本地模型就要借助 Ollama,先安装:

pipinstall-U"autogen-ext[ollama]"

安装 LiteLLM,用于桥接 AutoGen Studio 与本地模型服务。

pipinstall"litellm"

安装依赖litellm[proxy]

pipinstall"litellm[proxy]"# 否则启用模型时会报错ImportError: Missing dependency No module named'backoff'.Run`pipinstall'litellm[proxy]'`

安装过程中报以下错误,再次执行安装命令后未再次报错,有知道原因的小伙伴儿吗?

Installing build dependencies... error error: subprocess-exited-with-error × installing build dependenciesforuvloop did not run successfully. │exitcode:1╰─>[2lines of output]ERROR: Could notfinda version that satisfies the requirement setuptools>=60(from versions: none)ERROR: No matching distribution foundforsetuptools>=60[end of output]note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed to build'uvloop'when installing build dependenciesforuvloop

启用模型:

# 启用模型命令litellm --model ollama/qwen2.5:1.5b# 输出信息INFO: Started server process[16984]INFO: Waitingforapplication startup. ██╗ ██╗████████╗███████╗██╗ ██╗ ███╗ ███╗ ██║ ██║╚══██╔══╝██╔════╝██║ ██║ ████╗ ████║ ██║ ██║ ██║ █████╗ ██║ ██║ ██╔████╔██║ ██║ ██║ ██║ ██╔══╝ ██║ ██║ ██║╚██╔╝██║ ███████╗██║ ██║ ███████╗███████╗███████╗██║ ╚═╝ ██║ ╚══════╝╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝ ╚═╝#------------------------------------------------------------## ## 'This feature doesn't meet my needs because...' ## https://github.com/BerriAI/litellm/issues/new ## ##------------------------------------------------------------#Thank youforusing LiteLLM!- Krrish&Ishaan Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:4000(Press CTRL+C to quit)

可视化界面:

http://www.cnnetsun.cn/news/484262.html

相关文章:

  • 汽车制造数字大脑:驱动未来智能制造的核心引擎
  • 新能源电动汽车整车控制器VCU原理图与PCB图详解:控制策略及程序实现探讨
  • springboot基于vue的新疆旅游平台的 可视化大屏4t007914
  • 虎贲等考 AI:AI 驱动学术创作,全流程智能辅助新范式
  • MongoDB 远程连不上?用cpolar告别局域网束缚,跨网访问就这么简单
  • CPU密集型任务与I/O密集型任务详解
  • 副业封神!挖 SRC 漏洞一个就赚 2W+,网安人轻松躺赚,平均日收入看完馋哭了!
  • 进程的创建——如何理解fork()系统调用
  • 学长亲荐!9款AI论文软件测评:研究生开题报告必备工具
  • 【VTK手册034】 vtkGeometryFilter 深度解析:高性能几何提取与转换专家
  • 抗干扰更强!8路PWM输出模块:隔离RS485/CAN通讯+占空比精准调节
  • vscode修改背景颜色为白色或者黑色-简单
  • 做开发找不到合适工作,程序员还有哪些新选择?
  • 程序员开发岗位求职难?这些优质出路值得一试
  • 别再死磕知识库了!2025 年大模型 TOP 5 场景出炉,第一名早就变天了!
  • Qoder NEXT 来了:补全功能全新升级,AI 代码采纳率提升 65%
  • django-python基于大数据技术的地铁短时客流预测系统的设计与实现_xk3513ir
  • springboot+vue的旅游数据分析可视化系统的设计与实现_149477ud
  • 安防摄像头电源接口阿赛姆TVS管防护方案
  • nginx接口超时,增加接口超时时间
  • 低耗能蓝牙信标:关键技术演变和部署深度选型指南详解
  • 通用、高效、且能处理复杂关联关系(多对多)的 “不同环境下实现数据“ 解决方案
  • Linux定时任务与自动化脚本实战
  • 深度测评继续教育AI论文网站TOP10:选对工具轻松写好论文
  • ROS-Industrial 安装及使用
  • 程序员必看!大模型“卖Token“模式即将崩盘?这才是真正的护城河与价值突围之路!
  • 课程论文还在 “东拼西凑”?虎贲等考 AI:3 小时产出 “高分范本”,逻辑深度双在线
  • 【Java毕设源码分享】基于springboot+vue的OA管理系统的设计与实现(程序+文档+代码讲解+一条龙定制)
  • 算法题 最大频率栈
  • 知识管理工具又添新锐,notion vs sward一文对比解析