Setup LLM model for Amazon AWS

We take data security very seriously. Your code will sit on your premises and go to a model that you control, sitting in your cloud.

Step 1: Get Access to Mixtral 8x7B on AWS Bedrock
  1. AWS Bedrock is a fully managed service providing foundational Model Access. It is in scope for SOC2, HIPAA and ISO and is in compliance with GDPR. For more details on data security, click here.

  2. Visit here. Click Model Access. Select Mixtral 8x7B Instruct and hit “Save Changes”

  3. You should see the below after a few seconds.

Note: Mixtral 8x7B is a completely open source model that is publicly available. This means none of your data is used to train Mixtral 8x7B.

Step 2: Give us access to Mixtral 8x7B on AWS Bedrock
Option #1: via IAM user
  1. You will have to create an IAM user so that p0 can access AWS Bedrock on your behalf.

  2. Click here. Create an user name (bedrock). Click Next.

  3. Click Attach Policies Directly. Search for Bedrock. Select AmazonBedrockFullAccess

  4. Click Next

  5. Click Create User

  6. Change your IAM user in the link here and paste in your browser:

https://us-east-1.console.aws.amazon.com/iamv2/home?region=us-west-2#/users/details/<<<IAM_USER_HERE>>>?section=security_credentials

https://us-east-1.console.aws.amazon.com/iamv2/home?region=us-west-2#/users/details/<<<IAM_USER_HERE>>>?section=security_credentials

https://us-east-1.console.aws.amazon.com/iamv2/home?region=us-west-2#/users/details/<<<IAM_USER_HERE>>>?section=security_credentials

  1. Create Access Key —> Local Code —> Next —> Create access key. Keep your Access Key and Secret Access handy for the product.

Option #1: via IAM user
Option #2: via IAM role
  1. Create a new IAM Policy for Bedrock access

    1. Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/

    2. In the navigation pane on the left, choose Policies.

    3. Choose Create policy.

    4. In the Policy editor section, choose the JSON option.

    5. Copy and paste the policy mentioned below in the Policy editor. In case your region of AWS instance is different, edit it in the policy below under Resources attribute where it says us-west-2.

{ "Version": "2012-10-17", "Statement": [ { "Sid": "Invocation", "Effect": "Allow", "Action": [ "bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream" ], "Resource": [ "arn:aws:bedrock:us-west-2::foundation-model/mistral.mixtral-8x7b-instruct-v0:1" ] } ] }

{ "Version": "2012-10-17", "Statement": [ { "Sid": "Invocation", "Effect": "Allow", "Action": [ "bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream" ], "Resource": [ "arn:aws:bedrock:us-west-2::foundation-model/mistral.mixtral-8x7b-instruct-v0:1" ] } ] }

{ "Version": "2012-10-17", "Statement": [ { "Sid": "Invocation", "Effect": "Allow", "Action": [ "bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream" ], "Resource": [ "arn:aws:bedrock:us-west-2::foundation-model/mistral.mixtral-8x7b-instruct-v0:1" ] } ] }

  1. Click Next at the bottom-right of the page

  2. Add the Policy name. Make sure to remember this as it will be used later. You can leave the rest of the settings as is.

  3. Hit Create policy button at the end of the page.

  1. Assign the above policy to an IAM role

    1. Click here to create a new IAM role.

    2. OR, to use an existing IAM role, make sure it has Amazon EC2 Use case enabled and follow the below steps:

      1. Open the details page of the IAM role you want to use with your EC2 instance.

      2. On the roles detail page, look for add Add Permissions in middle-right of the page.

      3. In the dropdown, select Attach Policies. You will be taken to the Attach Policy to Role screen.

  1. Here, search for the policy you just created in the above step and select it. Then, click Add Permission button at the bottom-right of the screen.

Create an EC2 IAM role with Bedrock policy
  1. Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam

  2. In the navigation pane, select Roles, then select Create role.

  3. For Select trusted entity, under Trusted entity type, choose AWS service.

  4. Under Use case, choose Amazon EC2, then select Next.

  5. For Add permissions, select the checkbox for the policy you have created for Bedrock from the policy list, then select Next.

  6. Enter a name for the role, then select Create role. Remember this name because you'll need it when you create your Amazon EC2 instance.

Contact us

If you are facing any trouble setting up your on-prem application, reach out to us at contact[at]p0[dot]inc

Contact us

If you are facing any trouble setting up your on-prem application, reach out to us at contact[at]p0[dot]inc

Contact us

If you are facing any trouble setting up your on-prem application, reach out to us at contact[at]p0[dot]inc

© 2024 p

0

. All rights reserved.

© 2024 p

0

. All rights reserved.

© 2024 p

0

. All rights reserved.