> ## Documentation Index
> Fetch the complete documentation index at: https://relevanceai.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Anthropic LLM models

> Learn more about Anthropic LLM models and how to connect your AWS Bedrock or Google Cloud Platform account to access Anthropic models

Anthropic's Claude LLM models are focused on safe, reliable, and ethical AI responses. They are often better at reasoning and 'thoughtful' tasks.

<AccordionGroup>
  <Accordion title="What are they good for?">
    They're good for detailed explanations, structured outputs, and sensitive industries.
  </Accordion>

  <Accordion title="How much do they cost?">
    Credits charged per 1,000 tokens processed if you do not connect your AWS Bedrock account.
  </Accordion>

  <Accordion title="What native files can they process?">
    Anthropic models can process each of the following files:

    * .jpg
    * .jpeg
    * .png
    * .webp
    * .gif
  </Accordion>
</AccordionGroup>

## Setting Up AWS Bedrock with Relevance

Relevance supports two secure methods for connecting your AWS Bedrock account to access Anthropic models. Choose the option that best fits your organization's security requirements.

### Key Benefits

**Cross-Region Inference**: Ensure that you pick a model that has cross region inferencing available.

**Usage Oversight**: Both setup methods provide access to all supported Anthropic Claude models available in your selected AWS regions. You will be able to have increased cost control and insight into model usage.

### Option 1: IAM Credentials (Quick Setup)

**Best for**: Testing, proof-of-concepts, and organizations with flexible security policies.

#### Prerequisites

* AWS account with Anthropic models enabled in Bedrock
* Administrative access to create IAM users and policies

### Setup Steps

<Steps>
  <Step title="1. Create IAM Policy">
    In your AWS console, create a new policy with these permissions:

    ```json theme={null}
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "bedrock:InvokeModel*"
          ],
          "Resource": [
            "arn:aws:bedrock:*:*:inference-profile/*",
            "arn:aws:bedrock:*::foundation-model/anthropic.*"
          ]
        }
      ]
    }
    ```
  </Step>

  <Step title="2. Create IAM user">
    * Create a new IAM user in your AWS account
    * Attach the policy created in step 1
    * Generate access keys for this user
  </Step>

  <Step title="3. Configure Relevance">
    In your Relevance dashboard:

    1. Navigate to **Integrations & API Keys** → **AWS Bedrock**
    2. Enter your credentials:
       * **Access Key ID**
       * **Secret Access Key**
       * **Region** (your preferred AWS region)
    3. Select your desired Claude model
  </Step>
</Steps>

### Option 2: Role Assumption (Enterprise Security)

**Best for**: Enterprise organisations requiring enhanced security, short-lived credentials, and detailed usage tracking.

#### Prerequisites

* Enterprise Relevance plan
* AWS account with Anthropic models enabled in Bedrock
* Administrative access to create IAM roles and policies

<Steps>
  <Step title="1. Contact your account team">
    Reach out to your Relevance Account Executive to initiate the role assumption setup. They will coordinate with our implementation team to exchange the necessary account details.
  </Step>

  <Step title="2. Create AWS role">
    Create an IAM role in your AWS account with this trust policy:

    ```json theme={null}
      {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Effect": "Allow",
            "Principal": {
              "AWS": "arn:aws:iam::<RELEVANCE_ACCOUNT_ID>:root"
            },
            "Action": "sts:AssumeRole",
            "Condition": {
              "StringEquals": {
                "sts:ExternalId": "relevance:<YOUR_PROJECT_ID>"
              }
            }
          }
        ]
      }
    ```
  </Step>

  <Step title="3. Create and attach permissions policy">
    Create a policy with Bedrock permissions and attach it to your role:

    ```json theme={null}
      {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Effect": "Allow",
            "Action": [
              "bedrock:InvokeModel*"
            ],
            "Resource": [
              "arn:aws:bedrock:*:*:inference-profile/*",
              "arn:aws:bedrock:*::foundation-model/anthropic.*"
            ]
          }
        ]
      }
    ```
  </Step>

  <Step title="4. Configure Relevance">
    In your Relevance dashboard:

    1. Navigate to **Integrations** → **AWS Bedrock**
    2. Enter your configuration:
       * **Region** (your preferred AWS region)
       * **Role ARN** (the ARN of the role you created)
  </Step>
</Steps>

<Note>
  If you run into any issues with either of these options, please reach out to your Account Executive or [our support team](https://relevanceai.com/docs/get-started/support).
</Note>

***

## AWS Bedrock Guardrails (Optional)

You can optionally configure AWS Bedrock Guardrails to apply content filtering and safety controls to your model invocations. Guardrails allow you to implement safeguards for your generative AI applications.

### Prerequisites

Before configuring guardrails in Relevance AI, you must:

1. Create a guardrail in AWS Bedrock console
2. Note the Guardrail ID or ARN
3. Optionally note the specific version you want to use
4. Enable Cross-region inferencing on the guardrail

<Note>
  For instructions on creating guardrails, see the [AWS Bedrock Guardrails documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html).
</Note>

***

### Configuration

In the Relevance AI dashboard under **Project Settings > API Keys**, add the following:

| Key Name                         | Value                      | Required                                          |
| -------------------------------- | -------------------------- | ------------------------------------------------- |
| AWS Bedrock Guardrail Identifier | Your guardrail ID or ARN   | Yes (if using guardrails)                         |
| AWS Bedrock Guardrail Version    | Version number (e.g., "1") | No (defaults to DRAFT if you don't have versions) |

***

### IAM Policy Update

If you're using guardrails, add the following permission to your IAM policy:

```json theme={null}
{
  "Effect": "Allow",
  "Action": [
    "bedrock:ApplyGuardrail"
  ],
  "Resource": [
    "arn:aws:bedrock:<REGION>:<ACCOUNT ID>:guardrail/<GUARD RAIL ID>",
    "arn:aws:bedrock:<REGION>:<ACCOUNT ID>:guardrail-profile/<PROFILE ID>"
  ]
}
```

<Warning>
  Remember to add this permission to both the IAM user policy (Option 1) or the IAM role policy (Option 2) depending on which setup method you're using.
</Warning>

***

### Important considerations

#### Multi-Region Support

For optimal performance and availability, ensure your AWS policies include permissions for multiple regions. Use `*` in the region field or explicitly list all regions where you want Bedrock access.

#### Model Availability

Different Claude models are available in different AWS regions. Verify model availability in your chosen region using the [AWS Bedrock documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html).

#### Security Precedence

If both IAM credentials and role ARN are configured, Relevance will automatically use the more secure role assumption method.

### Additional Resources

* [AWS Bedrock Inference Profiles Prerequisites](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-prereq.html)
* [Cross-Region Inference Documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html)
* [Supported Models by Region](https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html)

***

## Accessing Claude models using Vertex AI on Google Cloud Platform

If you use Google Cloud Platform, you can connect your Vertex AI API key to Relevance AI, which will allow you to use your Google Cloud Platform credits as opposed to your Relevance AI credits for Claude models.

You can do this by following these steps:

<Steps>
  <Step title="Enable your Vertex AI API key">
    In Google Cloud Console, enable the Vertex AI API by following the instructions [here](https://cloud.google.com/vertex-ai/docs/featurestore/setup#configure_project).
  </Step>

  <Step title="Enable the Claude models you wish to access">
    Enable the Claude model you want to use via [https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/claude](https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/claude) (click on the model card, then Enable)
  </Step>

  <Step title="Create a service account">
    Create a service account in the Google Cloud Console following the instructions at [https://cloud.google.com/iam/docs/service-accounts-create](https://cloud.google.com/iam/docs/service-accounts-create). **Make note of the project ID used to create the account.** The service account can have any name and description desired.

    <img src="https://mintcdn.com/relevanceai/OWgDVEd91vN6behf/images/gemini_service_account.png?fit=max&auto=format&n=OWgDVEd91vN6behf&q=85&s=e1c84a20037ae42f6e4a540c239a84e5" alt="Screenshot of creating a Gemini service account" width="2260" height="1202" data-path="images/gemini_service_account.png" />
  </Step>

  <Step title="Add IAM role">
    Give the service account the Vertex AI Service Agent IAM role. This means the service account is permitted to use Vertex AI and call LLMs in Google Cloud.
  </Step>

  <Step title="Create private key">
    Create a JSON private key for the service account, and download the key file.
  </Step>

  <Step title="Extract the client_email and private_key fields">
    In the key file, extract the client\_email and private\_key fields exactly as they are written, removing the quotation marks.

    The client\_email should be an email address that normally ends with iam.gserviceaccount.com.

    The private\_key should be formatted as follows:

    ```shell theme={null}
    -----BEGIN PRIVATE KEY-----\nLOTS OF LETTERS AND NUMBERS HERE\n-----END PRIVATE KEY-----\n


    ```
  </Step>

  <Step title="Add details to Relevance AI">
    Log into Relevance AI and head to 'Integrations & API Keys'. Search for Google Cloud Platform, and add the Client Email and Private Key, and the Project ID from earlier in step 3.
  </Step>
</Steps>

Once your Google Cloud Platform details are added correctly, you will not be charged Relevance AI credits for Anthropic Claude models under the `gcp-vertexai` group of models.
