Skip to content

Commit 53c9cf8

Browse files
Merge pull request #4 from Constantinople-AI/GGGG-417-sonnet-4-5-inference-after-tool-call
feat: add Claude Sonnet 4.5 support with global cross-region inference
2 parents f2bda42 + ecc8578 commit 53c9cf8

File tree

17 files changed

+450
-522
lines changed

17 files changed

+450
-522
lines changed

.github/workflows/aws-genai-cicd-suite.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

README.md

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[中文](./README_CN.md)
2-
31
# Bedrock Access Gateway
42

53
OpenAI-compatible RESTful APIs for Amazon Bedrock
64

75
## What's New 🔥
86

9-
This project supports reasoning for both **Claude 3.7 Sonnet** and **DeepSeek R1**, check [How to Use](./docs/Usage.md#reasoning) for more details. You need to first run the Models API to refresh the model list.
7+
This project now supports **Claude Sonnet 4.5**, Anthropic's most intelligent model with enhanced coding capabilities and complex agent support, available via global cross-region inference.
8+
9+
It also supports reasoning for both **Claude 3.7 Sonnet** and **DeepSeek R1**. Check [How to Use](./docs/Usage.md#reasoning) for more details. You need to first run the Models API to refresh the model list.
1010

1111
## Overview
1212

@@ -55,47 +55,75 @@ Alternatively, you can use Lambda Function URL to replace ALB, see [example](htt
5555

5656
### Deployment
5757

58-
Please follow the steps below to deploy the Bedrock Proxy APIs into your AWS account. Only supports regions where Amazon Bedrock is available (such as `us-west-2`). The deployment will take approximately **3-5 minutes** 🕒.
58+
Please follow the steps below to deploy the Bedrock Proxy APIs into your AWS account. Only supports regions where Amazon Bedrock is available (such as `us-west-2`). The deployment will take approximately **10-15 minutes** 🕒.
5959

6060
**Step 1: Create your own API key in Secrets Manager (MUST)**
6161

62-
6362
> **Note:** This step is to use any string (without spaces) you like to create a custom API Key (credential) that will be used to access the proxy API later. This key does not have to match your actual OpenAI key, and you don't need to have an OpenAI API key. please keep the key safe and private.
6463
6564
1. Open the AWS Management Console and navigate to the AWS Secrets Manager service.
66-
2. Click on "Store a new secret" button.
65+
2. Click on "Store a new secret" button.
6766
3. In the "Choose secret type" page, select:
6867

6968
Secret type: Other type of secret
7069
Key/value pairs:
7170
- Key: api_key
7271
- Value: Enter your API key value
73-
72+
7473
Click "Next"
7574
4. In the "Configure secret" page:
7675
Secret name: Enter a name (e.g., "BedrockProxyAPIKey")
7776
Description: (Optional) Add a description of your secret
7877
5. Click "Next" and review all your settings and click "Store"
7978

80-
After creation, you'll see your secret in the Secrets Manager console. Make note of the secret ARN.
79+
After creation, you'll see your secret in the Secrets Manager console. Make note of the secret ARN.
80+
81+
**Step 2: Build and push container images to ECR**
82+
83+
1. Clone this repository:
84+
```bash
85+
git clone https://github.com/aws-samples/bedrock-access-gateway.git
86+
cd bedrock-access-gateway
87+
```
88+
89+
2. Run the build and push script:
90+
```bash
91+
cd scripts
92+
bash ./push-to-ecr.sh
93+
```
94+
95+
3. Follow the prompts to configure:
96+
- ECR repository names (or use defaults)
97+
- Image tag (or use default: `latest`)
98+
- AWS region (or use default: `us-east-1`)
99+
100+
4. The script will build and push both Lambda and ECS/Fargate images to your ECR repositories.
101+
102+
5. **Important**: Copy the image URIs displayed at the end of the script output. You'll need these in the next step.
81103

104+
**Step 3: Deploy the CloudFormation stack**
82105

83-
**Step 2: Deploy the CloudFormation stack**
106+
1. Download the CloudFormation template you want to use:
107+
- For Lambda: [`deployment/BedrockProxy.template`](deployment/BedrockProxy.template)
108+
- For Fargate: [`deployment/BedrockProxyFargate.template`](deployment/BedrockProxyFargate.template)
84109

85-
1. Sign in to AWS Management Console, switch to the region to deploy the CloudFormation Stack to.
86-
2. Click the following button to launch the CloudFormation Stack in that region. Choose one of the following:
110+
2. Sign in to AWS Management Console and navigate to the CloudFormation service in your target region.
87111

88-
[<kbd> <br> ALB + Lambda 1-Click Deploy 🚀 <br> </kbd>](https://console.aws.amazon.com/cloudformation/home?#/stacks/quickcreate?templateURL=https://aws-gcr-solutions.s3.amazonaws.com/bedrock-access-gateway/latest/BedrockProxy.template&stackName=BedrockProxyAPI)
112+
3. Click "Create stack" → "With new resources (standard)".
113+
114+
4. Upload the template file you downloaded.
115+
116+
5. On the "Specify stack details" page, provide the following information:
117+
- **Stack name**: Enter a stack name (e.g., "BedrockProxyAPI")
118+
- **ApiKeySecretArn**: Enter the secret ARN from Step 1
119+
- **ContainerImageUri**: Enter the ECR image URI from Step 2 output
120+
- **DefaultModelId**: (Optional) Change the default model if needed
89121

90-
[<kbd> <br> ALB + Fargate 1-Click Deploy 🚀 <br> </kbd>](https://console.aws.amazon.com/cloudformation/home?#/stacks/quickcreate?templateURL=https://aws-gcr-solutions.s3.amazonaws.com/bedrock-access-gateway/latest/BedrockProxyFargate.template&stackName=BedrockProxyAPI)
91-
3. Click "Next".
92-
4. On the "Specify stack details" page, provide the following information:
93-
- Stack name: Change the stack name if needed.
94-
- ApiKeySecretArn: Enter the secret ARN you used for storing the API key.
95-
96122
Click "Next".
97-
5. On the "Configure stack options" page, you can leave the default settings or customize them according to your needs. Click "Next".
98-
6. On the "Review" page, review the details of the stack you're about to create. Check the "I acknowledge that AWS CloudFormation might create IAM resources" checkbox at the bottom. Click "Create stack".
123+
124+
6. On the "Configure stack options" page, you can leave the default settings or customize them according to your needs. Click "Next".
125+
126+
7. On the "Review" page, review all details. Check the "I acknowledge that AWS CloudFormation might create IAM resources" checkbox at the bottom. Click "Submit".
99127

100128
That is it! 🎉 Once deployed, click the CloudFormation stack and go to **Outputs** tab, you can find the API Base URL from `APIBaseUrl`, the value should look like `http://xxxx.xxx.elb.amazonaws.com/api/v1`.
101129

@@ -105,7 +133,7 @@ If you encounter any issues, please check the [Troubleshooting Guide](./docs/Tro
105133

106134
### SDK/API Usage
107135

108-
All you need is the API Key and the API Base URL. If you didn't set up your own key, then the default API Key (`bedrock`) will be used.
136+
All you need is the API Key and the API Base URL. If you didn't set up your own key following Step 1, the application will fail to start with an error message indicating that the API Key is not configured.
109137

110138
Now, you can try out the proxy APIs. Let's say you want to test Claude 3 Sonnet model (model ID: `anthropic.claude-3-sonnet-20240229-v1:0`)...
111139

@@ -247,12 +275,6 @@ Note that not all models are available in those regions.
247275

248276
You can use the [Models API](./docs/Usage.md#models-api) to get/refresh a list of supported models in the current region.
249277

250-
### Can I build and use my own ECR image
251-
252-
Yes, you can clone the repo and build the container image by yourself (`src/Dockerfile`) and then push to your ECR repo. You can use `scripts/push-to-ecr.sh`
253-
254-
Replace the repo url in the CloudFormation template before you deploy.
255-
256278
### Can I run this locally
257279

258280
Yes, you can run this locally, e.g. run below command under `src` folder:
@@ -279,13 +301,7 @@ Fine-tuned models and models with Provisioned Throughput are currently not suppo
279301

280302
### How to upgrade?
281303

282-
To use the latest features, you don't need to redeploy the CloudFormation stack. You simply need to pull the latest image.
283-
284-
To do so, depends on which version you deployed:
285-
286-
- **Lambda version**: Go to AWS Lambda console, find the Lambda function, then find and click the `Deploy new image` button and click save.
287-
- **Fargate version**: Go to ECS console, click the ECS cluster, go the `Tasks` tab, select the only task that is running and simply click `Stop selected` menu. A new task with latest image will start automatically.
288-
304+
To use the latest features, you need follow the deployment guide to redeploy the application. You can upgrade the existing CloudFormation stack to get the latest changes.
289305

290306
## Security
291307

0 commit comments

Comments
 (0)