Open moritalous opened 3 weeks ago
Thanks for the report, do you know what the expected HTTP path is? What endpoint is .invoke_model()
hitting?
I try output debug log.
use boto3
response = bedrock_runtime.invoke_model(
modelId=inference_profile_arn,
body=json.dumps(
{
"anthropic_version": "bedrock-2023-05-31",
"max_tokens": 1000,
"messages": [
{
"role": "user",
"content": "Hello!",
}
],
}
),
)
2024-11-08 15:51:17,031 botocore.auth [DEBUG] CanonicalRequest:
POST
/model/arn%253Aaws%253Abedrock%253Aus-west-2%253A637423213562%253Aapplication-inference-profile%252Fhq2of259skzs/invoke
host:bedrock-runtime.us-west-2.amazonaws.com
x-amz-date:20241108T155117Z
x-amz-security-token:**********
host;x-amz-date;x-amz-security-token
dec27b832eccd8d562578f99b60945183245f8876193a23d309e951df15eaab9
use Anthropic SDK
response = anthropic.messages.create(
model=inference_profile_arn,
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}],
)
2024-11-08 15:55:34,077 botocore.auth [DEBUG] CanonicalRequest:
POST
/model/arn%3Aaws%3Abedrock%3Aus-west-2%3A637423213562%3Aapplication-inference-profile/hq2of259skzs/invoke
accept:application/json
accept-encoding:gzip, deflate
content-length:116
content-type:application/json
host:bedrock-runtime.us-west-2.amazonaws.com
x-amz-date:20241108T155534Z
x-amz-security-token:*****
x-stainless-arch:x64
x-stainless-lang:python
x-stainless-os:Linux
x-stainless-package-version:0.39.0
x-stainless-retry-count:0
x-stainless-runtime:CPython
x-stainless-runtime-version:3.10.12
accept;accept-encoding;content-length;content-type;host;x-amz-date;x-amz-security-token;x-stainless-arch;x-stainless-lang;x-stainless-os;x-stainless-package-version;x-stainless-retry-count;x-stainless-runtime;x-stainless-runtime-version
33fcea8bfcee2180d557bf027b19a7e6b4394deee5c905ef5afe381afd0b4d83
I hope this helps
Amazon Bedrock has added a new feature called "application inference profiles".
Using application inference profiles is like adding an alias to a base model.
For Bedrock's Invoke Model, you can specify the application inference profile as the modelId.
However, when using the Anthropic SDK, specifying the application inference profile as the model results in an error.
This is likely because the model parameter is not expecting an ARN to be set.
Please let me know if you have any further questions regarding this.