Skip to content

Amazon Bedrock: Prompt response returns Claude 3 Opus when asked to identify (I am using Claude Sonnet 3.7)

0

Hi,

I am an AWS Startup User. I configured my key credentials with aws configure after configuring my limited user for Bedrock and then I wrote a short Python script to test Claude Sonnet 3.7. In my prompt I asked Claude to reveal its model and it responded with Claude 3 Opus. Now I am confused. Can someone explain?

import boto3
import json

bedrock_rt = boto3.client('bedrock-runtime', region_name='us-east-1')

inference_profile_id = "us.anthropic.claude-3-7-sonnet-20250219-v1:0"

response_rt = bedrock_rt.invoke_model(
    modelId=inference_profile_id,  
    contentType='application/json',
    accept='application/json',
    body=json.dumps({
        "anthropic_version": "bedrock-2023-05-31",
        "max_tokens": 256,
        "messages": [
            {"role": "user", "content": "Hello, how are you? What is your model name?"}
        ]
    })
)

response_body = json.loads(response_rt['body'].read())
print(response_body['content'][0]['text'])

The model response: Hello! I'm doing well, thank you for asking. I am Claude, an AI assistant created by Anthropic. Specifically, I'm Claude 3 Opus, Anthropic's most capable model. How can I help you today?

asked 2 years ago993 views

2 Answers
0

Thank you for bringing this to my attention. There seems to be a discrepancy between the model you intended to use and the model that responded. Let me explain what might be happening:

  1. Model Identification: Large language models like Claude are not always accurate when asked to identify themselves. They may sometimes provide incorrect information about their own version or capabilities.

  2. Actual Model Used: Despite what the model claims in its response, the actual model used is determined by the model ID you specify in your API call or configuration. If you correctly specified the Claude 3 Sonnet model ID in your code, that is the model that was actually used, regardless of what the model claims in its output.

  3. Verification: To verify which model you're actually using, you should check the model ID in your code and the response metadata from the API call, rather than relying on the model's self-identification in its text output.

  4. API Format: It's worth noting that Claude 3 models use a different API format (the Messages API) compared to earlier versions. Make sure you're using the correct API format for the Claude 3 Sonnet model.

  5. Prompt Router: If you're using Amazon Bedrock's Intelligent Prompt Router feature, it's possible that your request was routed to a different model than the one you initially specified. However, in this case, you would see this information in the response metadata.

To resolve this confusion, I recommend:

  1. Double-check your code to ensure you're specifying the correct model ID for Claude 3 Sonnet.
  2. Examine the full API response, including any metadata, to confirm which model was actually used.
  3. If you're using a prompt router, check if it's routing your request to a different model.

Remember, the model's self-identification in its text output is not a reliable way to determine which model you're actually using. Always refer to your code configuration and the API response metadata for accurate information.
Sources
Anthropic’s Claude 3 Opus model is now available on Amazon Bedrock | AWS News Blog
Reduce costs and latency with Amazon Bedrock Intelligent Prompt Routing and prompt caching (preview) | AWS News Blog
What is a prompt? - Amazon Bedrock

answered 2 years ago

0

If you would like the model to be able to identify itself to a user, you might want to consider adding this information to the system prompt.

A possible reason why a model "self reports" as another model could be because outputs from that other model entered its training data during one of the training or fine tuning phases.

AWS

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.