吴恩达发布的开源大模型套件 aisuite,不到半天就斩获了 1200 + 星标。
它把 11 家知名大模型平台集中到了一起,统一了接口,可以用相同的方式调用不同模型。
切换模型时,只需要改动一个字符串,不用在不同的 API 之间摸不着头脑了。

对需要在应用当中集成多个不同模型的开发者来说,这套工具可以提高不少的开发效率。
有网友评论说,aisuite 可以帮他在处理多个大模型时节省超过 500 行的代码。

十余家模型平台,一种方式调用
不同模型的 API 不尽相同,缺乏统一的调用方式,是让许多应用开发者感到头疼的一大难题。特别是当同一个应用需要调用不同模型时,模型间的切换会耗费开发者的不少精力。
所以,aisuite 设计了一个统一的调用接口,不管原模型的 API 是什么样,都可以用相同的方式来调用。
使用时,只需要改一个字符串,把模型平台和具体名称填入,就可以调用 aisuite 支持的模型。

目前,aisuite 一共支持 OpenAI、Anthropic 等 11 家模型平台,具体如下:

而且其中包括了拥有海量模型的 Hugging Face 这样的模型平台,所以 aisuite 实际上支持的模型更多。
搭配 Streamlit 等工具,还能用 aisuite 构建的简单聊天 UI 界面。

据介绍,目前 aisuite 套件主要关注于聊天功能,其他用例将在未来逐步扩展。

另外从 GitHub 的 issue 当中也可以得知,aisuite 套件目前比较基础,像函数调用等功能正在开发之中,将很快上线。

除了模型切换方便,aisuite 的安装配置过程也比较简单。
需要准备的内容包括 Python 环境,以及对应模型的 API 密钥和支持库。
首先需要通过 pip 安装 aisuite 框架,模型支持库可以在这一步进行选装。
pip install aisuite
pip install ‘aisuite[★]’
其中 ★ 处填入想安装的支持库名称,或者填 all 安装所有库(外侧方括号和单引号不可省略)。
此外还需要有对应模型的 API 密钥,可以设置为环境变量,也可以作为配置传递给 aisuite 中的构造函数。
One More Thing
除了吴恩达之外,开源社区对 aisuite 也拥有不可磨灭的贡献。
算上吴恩达本人,aisuite 的贡献者一共有六人,其余五人分别是(按姓氏字母排序):
在线继续教育平台 CLE Hero 联合创始人 Ryan Prinz;
前谷歌 Chronicle Security 工程主管 Rohit Prsad;
DeepLearning.AI(吴恩达创办的在线学习平台)特殊项目负责人 John Santerre;
在线酒水销售平台 Provi 高级工程师 Kevin Solorio;
Meta 生成式 AI 工程师、原高通高级工程师 Jeff Tang。
同时,这一项目也发布了贡献指南(Contributing Guide),欢迎整个开源社区帮助推动后续的工作。

GitHub:

“掌”握科技鲜闻 (微信搜索techsina或扫描左侧二维码关注)
