Skip to content

Commit 8ce0af3

Browse files
Chris Kim (Hyunggun)claude
andcommitted
Replace deprecated model IDs with -latest aliases
The hardcoded Claude 3 model IDs (claude-3-haiku-20240307, claude-3-sonnet-20240229) are deprecated and broken. Replace them with -latest aliases (e.g., claude-haiku-4-5-latest) so the tutorials automatically use the newest model version without code changes. Changes: - Update MODEL_NAME in all 3 variants (Anthropic 1P, Bedrock/anthropic, Bedrock/boto3) - Update tool use notebooks from Sonnet 3 to claude-sonnet-4-5-latest - Update eval notebooks from Haiku 3 to claude-haiku-4-5-latest - Update markdown prose to reference "Claude Haiku (latest)" instead of "Claude 3 Haiku" - Unpin SDK versions in AmazonBedrock/requirements.txt for alias support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0d27754 commit 8ce0af3

9 files changed

Lines changed: 21 additions & 18 deletions

AmazonBedrock/anthropic/00_Tutorial_How-To.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"\n",
6767
"## Usage Notes & Tips 💡\n",
6868
"\n",
69-
"- This course uses Claude 3 Haiku with temperature 0. We will talk more about temperature later in the course. For now, it's enough to understand that these settings yield more deterministic results. All prompt engineering techniques in this course also apply to previous generation legacy Claude models such as Claude 2 and Claude Instant 1.2.\n",
69+
"- This course uses Claude Haiku (latest) with temperature 0. We will talk more about temperature later in the course. For now, it's enough to understand that these settings yield more deterministic results. All prompt engineering techniques in this course also apply to other Claude models as well.\n",
7070
"\n",
7171
"- You can use `Shift + Enter` to execute the cell and move to the next one.\n",
7272
"\n",
@@ -95,7 +95,8 @@
9595
"session = boto3.Session() # create a boto3 session to dynamically get and set the region name\n",
9696
"AWS_REGION = session.region_name\n",
9797
"print(\"AWS Region:\", AWS_REGION)\n",
98-
"MODEL_NAME = \"anthropic.claude-3-haiku-20240307-v1:0\"\n",
98+
"# \"latest\" alias auto-updates when new models release; pin a specific version if needed\n",
99+
"MODEL_NAME = \"anthropic.claude-haiku-4-5-latest-v1:0\"\n",
99100
"\n",
100101
"%store MODEL_NAME\n",
101102
"%store AWS_REGION"

AmazonBedrock/anthropic/10_2_Appendix_Tool_Use.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
"from anthropic import AnthropicBedrock\n",
3636
"\n",
3737
"# Override the MODEL_NAME variable in the IPython store to use Sonnet instead of the Haiku model\n",
38-
"MODEL_NAME='anthropic.claude-3-sonnet-20240229-v1:0'\n",
38+
"MODEL_NAME='anthropic.claude-sonnet-4-5-latest-v1:0'\n",
3939
"%store -r AWS_REGION\n",
4040
"\n",
4141
"client = AnthropicBedrock(aws_region=AWS_REGION)\n",
4242
"\n",
43-
"# Rewrittten to call Claude 3 Sonnet, which is generally better at tool use, and include stop_sequences\n",
43+
"# Rewritten to call Claude Sonnet, which is generally better at tool use, and include stop_sequences\n",
4444
"def get_completion(messages, system_prompt=\"\", prefill=\"\",stop_sequences=None):\n",
4545
" message = client.messages.create(\n",
4646
" model=MODEL_NAME,\n",

AmazonBedrock/anthropic/10_3_Appendix_Empirical_Performance_Evaluations.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"outputs": [],
3434
"source": [
3535
"# Store the model name and AWS region for later use\n",
36-
"MODEL_NAME = \"anthropic.claude-3-haiku-20240307-v1:0\"\n",
36+
"MODEL_NAME = \"anthropic.claude-haiku-4-5-latest-v1:0\"\n",
3737
"AWS_REGION = \"us-west-2\"\n",
3838
"\n",
3939
"%store MODEL_NAME\n",

AmazonBedrock/boto3/00_Tutorial_How-To.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"\n",
7272
"## Usage Notes & Tips 💡\n",
7373
"\n",
74-
"- This course uses Claude 3 Haiku with temperature 0. We will talk more about temperature later in the course. For now, it's enough to understand that these settings yield more deterministic results. All prompt engineering techniques in this course also apply to previous generation legacy Claude models such as Claude 2 and Claude Instant 1.2.\n",
74+
"- This course uses Claude Haiku (latest) with temperature 0. We will talk more about temperature later in the course. For now, it's enough to understand that these settings yield more deterministic results. All prompt engineering techniques in this course also apply to other Claude models as well.\n",
7575
"\n",
7676
"- You can use `Shift + Enter` to execute the cell and move to the next one.\n",
7777
"\n",
@@ -100,7 +100,8 @@
100100
"session = boto3.Session() # create a boto3 session to dynamically get and set the region name\n",
101101
"AWS_REGION = session.region_name\n",
102102
"print(\"AWS Region:\", AWS_REGION)\n",
103-
"MODEL_NAME = \"anthropic.claude-3-haiku-20240307-v1:0\"\n",
103+
"# \"latest\" alias auto-updates when new models release; pin a specific version if needed\n",
104+
"MODEL_NAME = \"anthropic.claude-haiku-4-5-latest-v1:0\"\n",
104105
"\n",
105106
"%store MODEL_NAME\n",
106107
"%store AWS_REGION"

AmazonBedrock/boto3/10_2_Appendix_Tool_Use.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"metadata": {},
2222
"outputs": [],
2323
"source": [
24-
"# Rewrittten to call Claude 3 Sonnet, which is generally better at tool use, and include stop_sequences\n",
24+
"# Rewritten to call Claude Sonnet, which is generally better at tool use, and include stop_sequences\n",
2525
"# Import python's built-in regular expression library\n",
2626
"import re\n",
2727
"import boto3\n",
@@ -35,7 +35,7 @@
3535
"from utils import hints\n",
3636
"\n",
3737
"# Override the MODEL_NAME variable in the IPython store to use Sonnet instead of the Haiku model\n",
38-
"MODEL_NAME='anthropic.claude-3-sonnet-20240229-v1:0'\n",
38+
"MODEL_NAME='anthropic.claude-sonnet-4-5-latest-v1:0'\n",
3939
"%store -r AWS_REGION\n",
4040
"\n",
4141
"client = boto3.client('bedrock-runtime',region_name=AWS_REGION)\n",

AmazonBedrock/boto3/10_3_Appendix_Empirical_Performance_Eval.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"import json\n",
4141
"\n",
4242
"# Store the model name and AWS region for later use\n",
43-
"MODEL_NAME = \"anthropic.claude-3-haiku-20240307-v1:0\"\n",
43+
"MODEL_NAME = \"anthropic.claude-haiku-4-5-latest-v1:0\"\n",
4444
"AWS_REGION = \"us-west-2\"\n",
4545
"\n",
4646
"%store MODEL_NAME\n",

AmazonBedrock/requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
awscli==1.32.74
2-
boto3==1.34.74
3-
botocore==1.34.74
4-
anthropic==0.21.3
1+
awscli
2+
boto3
3+
botocore
4+
anthropic>=0.39.0
55
pickleshare==0.7.5

Anthropic 1P/00_Tutorial_How-To.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"outputs": [],
4545
"source": [
4646
"API_KEY = \"your_api_key_here\"\n",
47-
"MODEL_NAME = \"claude-3-haiku-20240307\"\n",
47+
"# \"latest\" alias auto-updates when new models release; pin a specific version if needed\n",
48+
"MODEL_NAME = \"claude-haiku-4-5-latest\"\n",
4849
"\n",
4950
"# Stores the API_KEY & MODEL_NAME variables for use across notebooks within the IPython store\n",
5051
"%store API_KEY\n",
@@ -66,7 +67,7 @@
6667
"\n",
6768
"## Usage Notes & Tips 💡\n",
6869
"\n",
69-
"- This course uses Claude 3 Haiku with temperature 0. We will talk more about temperature later in the course. For now, it's enough to understand that these settings yield more deterministic results. All prompt engineering techniques in this course also apply to previous generation legacy Claude models such as Claude 2 and Claude Instant 1.2.\n",
70+
"- This course uses Claude Haiku (latest) with temperature 0. We will talk more about temperature later in the course. For now, it's enough to understand that these settings yield more deterministic results. All prompt engineering techniques in this course also apply to other Claude models as well.\n",
7071
"\n",
7172
"- You can use `Shift + Enter` to execute the cell and move to the next one.\n",
7273
"\n",

Anthropic 1P/10.2_Appendix_Tool Use.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
"\n",
3333
"client = anthropic.Anthropic(api_key=API_KEY)\n",
3434
"\n",
35-
"# Rewrittten to call Claude 3 Sonnet, which is generally better at tool use, and include stop_sequences\n",
35+
"# Rewritten to call Claude Sonnet, which is generally better at tool use, and include stop_sequences\n",
3636
"def get_completion(messages, system_prompt=\"\", prefill=\"\",stop_sequences=None):\n",
3737
" message = client.messages.create(\n",
38-
" model=\"claude-3-sonnet-20240229\",\n",
38+
" model=\"claude-sonnet-4-5-latest\",\n",
3939
" max_tokens=2000,\n",
4040
" temperature=0.0,\n",
4141
" system=system_prompt,\n",

0 commit comments

Comments
 (0)