基于Amazon Bedrock的企业级生成式AI平台

基于Amazon Bedrock的企业级生成式AI平台

  • 2023.12.2
  • 版权声明:本文为博主chszs的原创文章,未经博主允许不得转载。

Amazon Bedrock 是一项新的 AWS 服务,可让企业通过 API 轻松利用和自定义生成式 AI 模型。公司现在可以构建和扩展人工智能应用程序,而无需管理运行这些模型本身所需的复杂基础设施和维护。Amazon Bedrock 充当“基础模型即服务(Foundation Models as a Service)”平台,客户可以在其中探索开源和专有模型,以找到最适合其需求的模型。一个关键的好处是无服务器体验(serverless experience),它简化了使用公司自己的数据定制基础模型的过程。然后可以使用组织基础设施内的其他 AWS 工具无缝集成和部署定制模型。总体而言,Bedrock 的目标是通过消除模型管理和基础设施复杂性的障碍,使生成式人工智能的利用变得更容易。

AWS Bedrock 通过提供对文本和图像的高质量基础模型的便捷访问,帮助组织更轻松地采用生成式 AI。它提供来自多个供应商的开源和专有模型,包括亚马逊自己的 Titan 模型。这减轻了企业自行进行供应商评估的需要,因为亚马逊在其基础设施上运行所有内容。通过处理安全性、合规性和模型服务,Bedrock 消除了公司采用生成式 AI 的关键障碍。他们不再需要构建和维护自己的模型基础设施和功能。相反,Bedrock 允许他们通过简单的 API 利用强大的生成模型,而无需担心潜在的复杂性。

AWS Bedrock 通过以下方式降低了企业采用开源和商业生成式 AI 的障碍:

  1. 只需使用 Amazon S3 中的几个标记示例即可轻松微调现有开源或封闭基础模型,无需大规模数据注释或构建数据管道。这简化了定制并加快了新的基于人工智能的应用程序的开发。
  2. 提供无服务器、可扩展、可靠且安全的托管服务,让客户保持对其数据的完全控制和治理以进行定制。内置模型访问系统允许管理员控制模型使用,支持强大的人工智能治理。
  3. 通过 API 与 AWS SageMaker、Lambda、EKS、ECS 和其他 AWS 服务(例如 EC2)集成,以便开发人员可以轻松构建、扩展和部署 AI 应用程序,而无需管理基础设施或高级 LLM 部署流程。

总之,Bedrock 通过简化定制、与 AWS 无缝集成以及为企业提供对其数据和模型的完全控制、治理和安全性,加速了生成式 AI 的采用。这可以降低利用生成式人工智能功能时的风险和实现价值的时间。

Amazon Bedrock 服务演练

登录AWS控制台后,我们需要输入Amazon Bedrock来加载服务。
登录
目前,在撰写本文之前,Bedrock 仅在少数地区可用,并且他们正在不断向列表中添加新地区。在这里,我将选择美国东部(北弗吉尼亚州)。
选择区域
选择支持的区域后,Amazon Bedrock 的控制台将打开。
打开

这是 Amazon Bedrock 的仪表板,可让您使用模型或控制其他用户对模型的访问。由于我使用 root 用户帐户登录,仪表板向我显示了作为管理员 root 用户的所有功能和控件。右侧面板显示了许多知名的 LLM 或 FM 供应商,例如 AI21 Amazon 或 Anthropic。右侧面板显示了各种游乐场(playgrounds),人们可以通过注入提示来试验模型及其行为。

其中重要的环节之一是“模型访问(Model Access)”,它提供了控制模型访问的能力。您可以单击链接访问模型访问库。
模型访问

模型访问仪表板显示供应商 Amazon Bedrock 目前已配置的所有模型。其中一些模型,例如 Anthropic 的 Claude 模型,如果您想访问它们,则需要填写一份很长的表格。其余的都非常简单。您需要单击按钮来管理模型访问,该按钮会显示一个可编辑的清单来控制访问。
管理模型访问
授予访问权限
保存更改
提交“保存更改”按钮后,访问状态将更改为“进行中(In Progress)”。有时,您需要等待一个多小时或一天以上,具体取决于您请求访问的模型类型和您的帐户类型。
进行中
AWS 授予对您请求的模型的访问权限后,状态将更改为“已授予访问权限(Access Granted)”。现在,您可以使用 API 将模型集成到您自己的应用程序中。
授予访问权限

Cohere 命令模型的响应:
连贯

Context: MQTT, or Message Queuing Telemetry Transport, is a messaging protocol for the Internet of Things (IoT). It's a set of rules that defines how IoT devices can publish and subscribe to data over the internet. MQTT is used for machine-to-machine communication. It's lightweight and can be used in cases where clients need a small code footprint and are connected to unreliable networks or networks with limited bandwidth resources. 
Explain MQTT to a 12-year-old person.

MQTT is like a secret club for machines where they can all talk to each other and share cool stuff. You know how people use social media to post pictures and updates, and others can follow or see those posts if they're interested? MQTT is like that, but for machines.
Imagine you have a cool new gadget, like a smart watch or a smart home device. These gadgets can do amazing things, like track your steps, control your lights, or even order you a pizza! But for them to do those things, they need to talk to other machines. That's where MQTT comes in.
MQTT is like a special set of rules that these machines use to talk to each other over the internet. They can send messages to each other, kind of like sending emails or texts, but these messages are super fast and efficient. And just like you might subscribe to a celebrity's social media account to see all their posts, these machines can subscribe to messages that are important to them.
The best part is that MQTT is really lightweight, which means it doesn't use a lot of computer power or take up a lot of space. This is important because sometimes these machines don't have a lot of power or they're in places where the internet connection isn't very good. MQTT is designed to work even in these tough conditions.
So, think of MQTT as a secret club where machines can talk, share messages, and work together to make our lives easier and more fun. It's like a behind-the-scenes hero that helps all our cool gadgets work together!

我尝试使用 Meta 中的 LLama2 模型,但不断收到错误。看来亚马逊仍在努力稳定局面。
稳定

我们将探索 Sytable Diffusion 模型,它使用基于文本的提示来生成图像。
可调节扩散

API请求是:

aws bedrock-runtime invoke-model \
--model-id stability.stable-diffusion-xl-v0 \
--body "{\"text_prompts\":[{\"text\":\"highly detailed Albert Einstein with bubble tea in hands epic laboratory office, shelves with detailed items in background\"}],\"cfg_scale\":10,\"seed\":0,\"steps\":50}" \
--cli-binary-format raw-in-base64-out \
--region us-east-1 \
invoke-model-output.txt

由于 Amazon Bedrock 作为无服务器组件运行,因此与该平台的集成是真正的无服务器。基础模型可通过 REST API 访问以供下游使用,并且 AWS 提供 Bedrock SDK 客户端,任何应用程序都可以利用该客户端连接到 Amazon Bedrock。

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
青葱年少的头像青葱年少普通用户
上一篇 2023年12月12日
下一篇 2023年12月12日

相关推荐