Amazon free AI code assistent, also provide 50 per month code security analysis
- Install on VSCode the extension
- Connect your local machine with AWS services by logging
- Go back to VSCode and
try example
to check out the AWS CodeWhisperer introduction tutorial
With Amazon Bedrock you can train (fine tune) an AI giving a simple input like a PDF file and then create a chatbot to ask things about this PDF, also you can consume this created AI via API.
BILLED BY TOKEN USAGE
- Go to IAM policies permissions
- Click on the tab JSON
- insert there:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BedrockConsole",
"Effect": "Allow",
"Action": [
"bedrock:ListFoundationModels",
"bedrock:GetFoundationModel",
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream",
"bedrock:CreateModelCustomizationJob",
"bedrock:GetModelCustomizationJob",
"bedrock:GetFoundationModelAvailability",
"bedrock:ListModelCustomizationJobs",
"bedrock:StopModelCustomizationJob",
"bedrock:GetCustomModel",
"bedrock:ListCustomModels",
"bedrock:DeleteCustomModel",
"bedrock:CreateProvisionedModelThroughput",
"bedrock:UpdateProvisionedModelThroughput",
"bedrock:GetProvisionedModelThroughput",
"bedrock:DeleteProvisionedModelThroughput",
"bedrock:ListProvisionedModelThroughputs",
"bedrock:ListTagsForResource",
"bedrock:UntagResource",
"bedrock:TagResource",
"bedrock:CreateAgent",
"bedrock:UpdateAgent",
"bedrock:GetAgent",
"bedrock:ListAgents",
"bedrock:CreateAgentActionGroup",
"bedrock:UpdateAgentActionGroup",
"bedrock:GetAgentActionGroup",
"bedrock:ListAgentActionGroups",
"bedrock:PrepareAgent",
"bedrock:GetAgentVersion",
"bedrock:ListAgentVersions",
"bedrock:CreateAgentAlias",
"bedrock:UpdateAgentAlias",
"bedrock:GetAgentAlias",
"bedrock:ListAgentAliases",
"bedrock:InvokeAgent",
"bedrock:PutFoundationModelEntitlement",
"bedrock:GetModelInvocationLoggingConfiguration",
"bedrock:PutModelInvocationLoggingConfiguration",
"bedrock:CreateFoundationModelAgreement",
"bedrock:DeleteFoundationModelAgreement",
"bedrock:ListFoundationModelAgreementOffers",
"bedrock:GetUseCaseForModelAccess",
"bedrock:PutUseCaseForModelAccess"
],
"Resource": "*"
}
]
}
- Go to users tab
- Click
create user
- On
Specify user details
give it a Name e.g.bedrock_user
- Click
Next
going toSet permissions
- Click on tab
Attach policies directly
- Search for your policy e.g.
bedrock_policy
and select it Next
>Review tab
>Create
- Go to bedrock models access page
- Click on
Manage models access
- Select the ones that you want
- Click on
Save changes
- Install AWS CLI
- Go to your created
bedrock_user
and generate anaccess key
(users tab) - On terminal execute
aws configure
and enter the key and secret from youraccess key
generated above - Code to test bedrock access:
import boto3
print(boto3.__version__)
boto_session = boto3.Session()
credentials = boto_session.get_credentials()
bedrock_models = boto3.client('bedrock')
print(bedrock_models.list_foundation_models())
Cases to practice bedrock solutions!
- token: some words represented, this is used to estimate costs based on prompt text, response text
- temperature: lower = assertive responses || higher = creative responses
- length: maximum tokens on output
Allows to personalize deeper Gen AI models!
BILLED BY INSTANCE HOUR
- Create a sagemaker domain
- Create a user for the domain created above
- Select a jumpstart model
- Begin the instance with the cheapest one
- Configure autoscallling (when needed the infrastructure automatically changes to a better one)
- AWS - Documentação sobre precificação
- AWS - Documentação sobre o Inferentia 2
- AWS - Documentação sobre o Trainium
- Turn a big file into smaller ones
- Transform them in vectors
- Use it to fine tune