Enterprise-grade generative AI platform based on Amazon Bedrock

Enterprise-grade generative AI platform based on Amazon Bedrock

  • 2023.12.2
  • Copyright statement: This article is an original article by blogger chszs and may not be reproduced without the permission of the blogger.

Amazon Bedrock is a new AWS service that makes it easy for enterprises to leverage and customize generative AI models through APIs. Companies can now build and scale AI applications without having to manage the complex infrastructure and maintenance required to run the models themselves. Amazon Bedrock serves as a "Foundation Models as a Service" platform where customers can explore open source and proprietary models to find the one that best suits their needs. A key benefit is a serverless experience, which simplifies the process of customizing the underlying model using a company's own data. Custom models can then be seamlessly integrated and deployed using other AWS tools within your organization's infrastructure. Overall, Bedrock's goal is to make leveraging generative AI easier byremoving the barriersof model management and infrastructure complexity.

AWS Bedrock helps organizations more easily adopt generative AI byproviding easy access to high-quality underlying models of text and images. It offers open source and proprietary models from multiple vendors, including Amazon's own Titan model. This alleviates the need for businesses to do their own vendor evaluations because Amazon runs everything on its infrastructure. By handling security, compliance, and model services, Bedrock removes key barriers for companies adopting generative AI. They no longer need to build and maintain their own model infrastructure and functionality. Instead, Bedrock allows them to leverage powerful generative models through a simple API without worrying about potential complexity.

AWS Bedrock lowers the barriers to enterprise adoption of open source and commercial generative AI by:

  1. Easily fine-tune existing open source or closed base models using just a few tagged examples in Amazon S3, without the need for large-scale data annotation or building data pipelines. This simplifies customization and speeds up the development of new AI-based applications.
  2. Providing serverless, scalable, reliable and secure hosting services that allow customers to maintain full control and governance of their data for customization. A built-in model access system allows administrators to control model usage, supporting strong AI governance.
  3. Integrate with AWS SageMaker, Lambda, EKS, ECS, and other AWS services (such as EC2) via API so developers can easily build, scale, and deploy AI applications without having to manage infrastructure or advanced LLM deployment processes.

In summary, Bedrock accelerates the adoption of generative AI by simplifying customization, seamlessly integrating with AWS, and providing enterprises with complete control, governance, and security over their data and models. This reduces risk and time to value when leveraging generative AI capabilities.

Amazon Bedrock Service Walkthrough

After logging into the AWS console, we need to enter Amazon Bedrock to load the service.
Log in
Currently, as of this writing, Bedrock is only available in a handful of regions, and they are constantly adding new regions to the list. Here, I'll select US East (Northern Virginia).
select area
After selecting a supported region, Amazon Bedrock's console will open.
Open

This is the dashboard for Amazon Bedrock that allows you to use models or control other users' access to models. Since I am logged in using the root user account, the dashboard shows me all the features and controls available to me as the administrator root user. The right panel shows many well-known LLM or FM providers, such as AI21 Amazon or Anthropic. The right panel shows various playgrounds where one can experiment with the model and its behavior by injecting prompts.

One of the important links is "Model Access", which provides the ability to control model access. You can click on the link to access the model access library.
model access

The Model Access dashboard displays all models currently configured by the provider Amazon Bedrock. Some of these models, like Anthropic's Claude model, require you to fill out a long form if you want to access them. The rest is very simple. You need to click the button to manage model access, which displays an editable list to control access.
Manage model access
grant access
save Changes
After submitting the Save Changes button, the access status will change to "In Progress". Sometimes you'll need to wait more than an hour or a day, depending on the type of model you're requesting access to and your account type.
in progress
Once AWS grants access to the model you requested, the status will change to "Access Granted". Now you can use the API to integrate the model into your own applications.
grant access
We can call the text generation playground by returning to the original dashboard and clicking on the "Text" link, Here we can use some prompt engineering to evaluate the model by selecting the vendor and corresponding model from the drop-down list. You can also customize the model's response by changing the configuration shown in the right panel. The "temperature" element determines the output of the model. The higher the temperature value, the more creative or dynamic the model's response will be. If the value is zero, you can expect the model to produce the same static response to a specific prompt or question or NLP task.
Word Playground
Now, on the playground, we will explore using the same text prompt project to play with different models. First, we'll explore the output of the Jurassic model from vendor AI21 Labs. We entered text on MQTT, a communication mode used in IoT devices, and asked the model to explain MQTT to a 12-year-old human. The green text output is the text generated by the model Jurrasic -2 Ultra with a temperature of 0.7
MQTT
If you click "View API request (View API request) at the bottom a>" button, which will display the API request sent by the Playground console to the base model.
View API requests

Cohere command model response:
coherent

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!

I'm trying to use the LLama2 model from Meta but I keep getting errors. It appears Amazon is still trying to stabilize the situation.
Stablize

We'll explore the Sytable Diffusion model, which uses text-based prompts to generate images.
adjustable diffusion

The API request is:

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

Because Amazon Bedrock runs as a serverless component, integration with the platform is truly serverless. The underlying model is accessible through a REST API for downstream use, and AWS provides a Bedrock SDK client that any application can leverage to connect to Amazon Bedrock.

Guess you like

Origin blog.csdn.net/chszs/article/details/134761149