From 0fa7a74016d2843cf8c960f887ccdaaadd9a7221 Mon Sep 17 00:00:00 2001 From: Oussama Hansal Date: Fri, 1 May 2026 07:46:12 -0700 Subject: [PATCH] Feature/Parameterize Bedrock model ID in CloudFormation templates --- ...kit-neptune-analytics-aurora-postgres.json | 24 ++++++++++++------- ...ptune-analytics-opensearch-serverless.json | 24 ++++++++++++------- ...-toolkit-neptune-analytics-s3-vectors.json | 24 ++++++++++++------- .../graphrag-toolkit-neptune-analytics.json | 24 ++++++++++++------- ...ptune-db-aurora-postgres-existing-vpc.json | 24 ++++++++++++------- ...ag-toolkit-neptune-db-aurora-postgres.json | 24 ++++++++++++------- ...lkit-neptune-db-opensearch-serverless.json | 24 ++++++++++++------- ...raphrag-toolkit-neptune-db-s3-vectors.json | 24 ++++++++++++------- .../assets/graphrag-toolkit-workshop.json | 4 ++-- integration-tests/build-tests.sh | 1 + ...g-toolkit-neo4j-opensearch-serverless.json | 24 ++++++++++++------- .../graphrag-toolkit-tests.json | 12 ++++++++-- 12 files changed, 148 insertions(+), 85 deletions(-) diff --git a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics-aurora-postgres.json b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics-aurora-postgres.json index 32f7fbfa..b3556953 100644 --- a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics-aurora-postgres.json +++ b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics-aurora-postgres.json @@ -73,6 +73,11 @@ "Type": "String", "Description": "URL of a zip file containing example notebooks to be installed on SageMaker instance (optional)", "Default": "https://github.com/awslabs/graphrag-toolkit/releases/latest/download/lexical-graph-examples-latest.zip" + }, + "BedrockModelId": { + "Description": "Bedrock model ID used for extraction, response, and evaluation LLMs", + "Type": "String", + "Default": "anthropic.claude-sonnet-4-6" } }, "Metadata": { @@ -83,7 +88,8 @@ "default": "Setup" }, "Parameters": [ - "ApplicationId" + "ApplicationId", + "BedrockModelId" ] }, { @@ -792,10 +798,10 @@ ], "Resource": [ { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/${BedrockModelId}" }, { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.${BedrockModelId}" }, { "Fn::Sub": "arn:${AWS::Partition}:bedrock:${AWS::Region}::foundation-model/cohere.embed-english-v3" @@ -943,15 +949,15 @@ }, "\" >> ~/.bashrc\n", "echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> ~/.bashrc\n", "echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_AUTH_MODE=IAM\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_SSL=True\" >> ~/.bashrc\n", @@ -1111,15 +1117,15 @@ }, "\" >> .env\n", " echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> .env\n", " echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> .env\n", " echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " if [ -f \"./run_test_suite.sh\" ]\n", " then\n", diff --git a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics-opensearch-serverless.json b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics-opensearch-serverless.json index 6debda34..aaca8433 100644 --- a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics-opensearch-serverless.json +++ b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics-opensearch-serverless.json @@ -68,6 +68,11 @@ "true", "false" ] + }, + "BedrockModelId": { + "Description": "Bedrock model ID used for extraction, response, and evaluation LLMs", + "Type": "String", + "Default": "anthropic.claude-sonnet-4-6" } }, "Metadata": { @@ -78,7 +83,8 @@ "default": "Setup" }, "Parameters": [ - "ApplicationId" + "ApplicationId", + "BedrockModelId" ] }, { @@ -353,10 +359,10 @@ ], "Resource": [ { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/${BedrockModelId}" }, { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.${BedrockModelId}" }, { "Fn::Sub": "arn:${AWS::Partition}:bedrock:${AWS::Region}::foundation-model/cohere.embed-english-v3" @@ -791,15 +797,15 @@ }, "\" >> ~/.bashrc\n", "echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> ~/.bashrc\n", "echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_AUTH_MODE=IAM\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_SSL=True\" >> ~/.bashrc\n", @@ -947,15 +953,15 @@ }, "\" >> .env\n", " echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> .env\n", " echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> .env\n", " echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " if [ -f \"./run_test_suite.sh\" ]\n", " then\n", diff --git a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics-s3-vectors.json b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics-s3-vectors.json index d13f8512..32f11c17 100644 --- a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics-s3-vectors.json +++ b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics-s3-vectors.json @@ -47,6 +47,11 @@ "Type": "String", "Description": "URL of a zip file containing example notebooks to be installed on SageMaker instance (optional)", "Default": "https://github.com/awslabs/graphrag-toolkit/releases/latest/download/lexical-graph-examples-latest.zip" + }, + "BedrockModelId": { + "Description": "Bedrock model ID used for extraction, response, and evaluation LLMs", + "Type": "String", + "Default": "anthropic.claude-sonnet-4-6" } }, "Metadata": { @@ -57,7 +62,8 @@ "default": "Setup" }, "Parameters": [ - "ApplicationId" + "ApplicationId", + "BedrockModelId" ] }, { @@ -409,10 +415,10 @@ ], "Resource": [ { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/${BedrockModelId}" }, { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.${BedrockModelId}" }, { "Fn::Sub": "arn:${AWS::Partition}:bedrock:${AWS::Region}::foundation-model/cohere.embed-english-v3" @@ -1019,15 +1025,15 @@ }, "\" >> ~/.bashrc\n", "echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> ~/.bashrc\n", "echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_AUTH_MODE=IAM\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_SSL=True\" >> ~/.bashrc\n", @@ -1167,15 +1173,15 @@ }, "\" >> .env\n", " echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> .env\n", " echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> .env\n", " echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " if [ -f \"./run_test_suite.sh\" ]\n", " then\n", diff --git a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics.json b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics.json index d010d29f..fa58c44b 100644 --- a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics.json +++ b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-analytics.json @@ -47,6 +47,11 @@ "Type": "String", "Description": "URL of a zip file containing example notebooks to be installed on SageMaker instance (optional)", "Default": "https://github.com/awslabs/graphrag-toolkit/releases/latest/download/lexical-graph-examples-latest.zip" + }, + "BedrockModelId": { + "Description": "Bedrock model ID used for extraction, response, and evaluation LLMs", + "Type": "String", + "Default": "anthropic.claude-sonnet-4-6" } }, "Metadata": { @@ -57,7 +62,8 @@ "default": "Setup" }, "Parameters": [ - "ApplicationId" + "ApplicationId", + "BedrockModelId" ] }, { @@ -305,10 +311,10 @@ ], "Resource": [ { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/${BedrockModelId}" }, { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.${BedrockModelId}" }, { "Fn::Sub": "arn:${AWS::Partition}:bedrock:${AWS::Region}::foundation-model/cohere.embed-english-v3" @@ -448,15 +454,15 @@ }, "\" >> ~/.bashrc\n", "echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> ~/.bashrc\n", "echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_AUTH_MODE=IAM\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_SSL=True\" >> ~/.bashrc\n", @@ -604,15 +610,15 @@ }, "\" >> .env\n", " echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> .env\n", " echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> .env\n", " echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " if [ -f \"./run_test_suite.sh\" ]\n", " then\n", diff --git a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-aurora-postgres-existing-vpc.json b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-aurora-postgres-existing-vpc.json index dff2a302..ac9ab882 100644 --- a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-aurora-postgres-existing-vpc.json +++ b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-aurora-postgres-existing-vpc.json @@ -134,6 +134,11 @@ "Type": "String", "Description": "URL of a zip file containing example notebooks to be installed on SageMaker instance (optional)", "Default": "https://github.com/awslabs/graphrag-toolkit/releases/latest/download/lexical-graph-examples-latest.zip" + }, + "BedrockModelId": { + "Description": "Bedrock model ID used for extraction, response, and evaluation LLMs", + "Type": "String", + "Default": "anthropic.claude-sonnet-4-6" } }, "Metadata": { @@ -144,7 +149,8 @@ "default": "Setup" }, "Parameters": [ - "ApplicationId" + "ApplicationId", + "BedrockModelId" ] }, { @@ -732,10 +738,10 @@ ], "Resource": [ { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/${BedrockModelId}" }, { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.${BedrockModelId}" }, { "Fn::Sub": "arn:${AWS::Partition}:bedrock:${AWS::Region}::foundation-model/cohere.embed-english-v3" @@ -1382,15 +1388,15 @@ "Ref": "AWS::StackId" }, "echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> ~/.bashrc\n", "echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_AUTH_MODE=IAM\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_SSL=True\" >> ~/.bashrc\n", @@ -1564,15 +1570,15 @@ }, "\" >> .env\n", " echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> .env\n", " echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> .env\n", " echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export LOCAL_EXTRACT_S3=", { diff --git a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-aurora-postgres.json b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-aurora-postgres.json index 1c18d00b..59d3939f 100644 --- a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-aurora-postgres.json +++ b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-aurora-postgres.json @@ -98,6 +98,11 @@ "Type": "String", "Description": "URL of a zip file containing example notebooks to be installed on SageMaker instance (optional)", "Default": "https://github.com/awslabs/graphrag-toolkit/releases/latest/download/lexical-graph-examples-latest.zip" + }, + "BedrockModelId": { + "Description": "Bedrock model ID used for extraction, response, and evaluation LLMs", + "Type": "String", + "Default": "anthropic.claude-sonnet-4-6" } }, "Metadata": { @@ -108,7 +113,8 @@ "default": "Setup" }, "Parameters": [ - "ApplicationId" + "ApplicationId", + "BedrockModelId" ] }, { @@ -683,10 +689,10 @@ ], "Resource": [ { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/${BedrockModelId}" }, { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.${BedrockModelId}" }, { "Fn::Sub": "arn:${AWS::Partition}:bedrock:${AWS::Region}::foundation-model/cohere.embed-english-v3" @@ -1334,15 +1340,15 @@ }, "\" >> ~/.bashrc\n", "echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> ~/.bashrc\n", "echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_AUTH_MODE=IAM\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_SSL=True\" >> ~/.bashrc\n", @@ -1509,15 +1515,15 @@ }, "\" >> .env\n", " echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> .env\n", " echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> .env\n", " echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " if [ -f \"./run_test_suite.sh\" ]\n", " then\n", diff --git a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-opensearch-serverless.json b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-opensearch-serverless.json index 42fb1702..ab95d33b 100644 --- a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-opensearch-serverless.json +++ b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-opensearch-serverless.json @@ -81,6 +81,11 @@ "true", "false" ] + }, + "BedrockModelId": { + "Description": "Bedrock model ID used for extraction, response, and evaluation LLMs", + "Type": "String", + "Default": "anthropic.claude-sonnet-4-6" } }, "Metadata": { @@ -91,7 +96,8 @@ "default": "Setup" }, "Parameters": [ - "ApplicationId" + "ApplicationId", + "BedrockModelId" ] }, { @@ -556,10 +562,10 @@ ], "Resource": [ { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/${BedrockModelId}" }, { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.${BedrockModelId}" }, { "Fn::Sub": "arn:${AWS::Partition}:bedrock:${AWS::Region}::foundation-model/cohere.embed-english-v3" @@ -1328,15 +1334,15 @@ }, "\" >> ~/.bashrc\n", "echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> ~/.bashrc\n", "echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_AUTH_MODE=IAM\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_SSL=True\" >> ~/.bashrc\n", @@ -1491,15 +1497,15 @@ }, "\" >> .env\n", " echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> .env\n", " echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> .env\n", " echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " if [ -f \"./run_test_suite.sh\" ]\n", " then\n", diff --git a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-s3-vectors.json b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-s3-vectors.json index 0a9ef2b6..89f1fa64 100644 --- a/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-s3-vectors.json +++ b/examples/lexical-graph/cloudformation-templates/graphrag-toolkit-neptune-db-s3-vectors.json @@ -72,6 +72,11 @@ "Type": "String", "Description": "URL of a zip file containing example notebooks to be installed on SageMaker instance (optional)", "Default": "https://github.com/awslabs/graphrag-toolkit/releases/latest/download/lexical-graph-examples-latest.zip" + }, + "BedrockModelId": { + "Description": "Bedrock model ID used for extraction, response, and evaluation LLMs", + "Type": "String", + "Default": "anthropic.claude-sonnet-4-6" } }, "Metadata": { @@ -82,7 +87,8 @@ "default": "Setup" }, "Parameters": [ - "ApplicationId" + "ApplicationId", + "BedrockModelId" ] }, { @@ -614,10 +620,10 @@ ], "Resource": [ { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/${BedrockModelId}" }, { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.${BedrockModelId}" }, { "Fn::Sub": "arn:${AWS::Partition}:bedrock:${AWS::Region}::foundation-model/cohere.embed-english-v3" @@ -1492,15 +1498,15 @@ }, "\" >> ~/.bashrc\n", "echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> ~/.bashrc\n", "echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_AUTH_MODE=IAM\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_SSL=True\" >> ~/.bashrc\n", @@ -1647,15 +1653,15 @@ }, "\" >> .env\n", " echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> .env\n", " echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> .env\n", " echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " if [ -f \"./run_test_suite.sh\" ]\n", " then\n", diff --git a/examples/lexical-graph/workshop/assets/graphrag-toolkit-workshop.json b/examples/lexical-graph/workshop/assets/graphrag-toolkit-workshop.json index b1269fa7..f754fe24 100644 --- a/examples/lexical-graph/workshop/assets/graphrag-toolkit-workshop.json +++ b/examples/lexical-graph/workshop/assets/graphrag-toolkit-workshop.json @@ -477,7 +477,7 @@ ], "Resource": [ { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.${ModelId}" } ] }, @@ -490,7 +490,7 @@ ], "Resource": [ { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/${ModelId}" } ] }, diff --git a/integration-tests/build-tests.sh b/integration-tests/build-tests.sh index b9984b87..0a223750 100644 --- a/integration-tests/build-tests.sh +++ b/integration-tests/build-tests.sh @@ -411,6 +411,7 @@ if [[ -z "$DRY_RUN" ]]; then ParameterKey=NotebookInstanceType,ParameterValue="$NOTEBOOK_INSTANCE_TYPE" \ ParameterKey=IamPolicyArn,ParameterValue="$ADDITIONAL_IAM_POLICY_ARN" \ ParameterKey=SSHCIDR,ParameterValue="$SSHCIDR" \ + ParameterKey=BedrockModelId,ParameterValue="${TEST_EXTRACTION_LLM#*.}" \ --capabilities CAPABILITY_NAMED_IAM \ --tags \ Key=ApplicationName,Value="graphrag-toolkit test" \ diff --git a/integration-tests/cloudformation-templates/graphrag-toolkit-neo4j-opensearch-serverless.json b/integration-tests/cloudformation-templates/graphrag-toolkit-neo4j-opensearch-serverless.json index d0f777d2..7dda3ac9 100644 --- a/integration-tests/cloudformation-templates/graphrag-toolkit-neo4j-opensearch-serverless.json +++ b/integration-tests/cloudformation-templates/graphrag-toolkit-neo4j-opensearch-serverless.json @@ -75,6 +75,11 @@ "true", "false" ] + }, + "BedrockModelId": { + "Description": "Bedrock model ID used for extraction, response, and evaluation LLMs", + "Type": "String", + "Default": "anthropic.claude-sonnet-4-6" } }, "Metadata": { @@ -85,7 +90,8 @@ "default": "Setup" }, "Parameters": [ - "ApplicationId" + "ApplicationId", + "BedrockModelId" ] }, { @@ -539,10 +545,10 @@ ], "Resource": [ { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/${BedrockModelId}" }, { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.${BedrockModelId}" }, { "Fn::Sub": "arn:${AWS::Partition}:bedrock:${AWS::Region}::foundation-model/cohere.embed-english-v3" @@ -1156,15 +1162,15 @@ }, "\" >> ~/.bashrc\n", "echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> ~/.bashrc\n", "echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> ~/.bashrc\n", "echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_AUTH_MODE=IAM\" >> ~/.bashrc\n", "echo \"export GRAPH_NOTEBOOK_SSL=True\" >> ~/.bashrc\n", @@ -1309,15 +1315,15 @@ }, "\" >> .env\n", " echo \"export EXTRACTION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EMBEDDINGS_MODEL=cohere.embed-english-v3\" >> .env\n", " echo \"export EMBEDDINGS_DIMENSIONS=1024\" >> .env\n", " echo \"export RESPONSE_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " echo \"export EVALUATION_MODEL=", - "anthropic.claude-sonnet-4-6", + {"Ref": "BedrockModelId"}, "\" >> .env\n", " if [ -f \"./run_test_suite.sh\" ]\n", " then\n", diff --git a/integration-tests/cloudformation-templates/graphrag-toolkit-tests.json b/integration-tests/cloudformation-templates/graphrag-toolkit-tests.json index 3363365c..c6989e15 100644 --- a/integration-tests/cloudformation-templates/graphrag-toolkit-tests.json +++ b/integration-tests/cloudformation-templates/graphrag-toolkit-tests.json @@ -73,6 +73,11 @@ "true", "false" ] + }, + "BedrockModelId": { + "Description": "Bedrock model ID used for extraction, response, and evaluation LLMs", + "Type": "String", + "Default": "anthropic.claude-sonnet-4-6" } }, "Mappings": { @@ -301,10 +306,10 @@ "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/openai.gpt-oss-120b-1:0" }, { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*::foundation-model/${BedrockModelId}" }, { - "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.anthropic.*" + "Fn::Sub": "arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*.${BedrockModelId}" } ] }, @@ -499,6 +504,9 @@ "Ref": "AWS::NoValue" } ] + }, + "BedrockModelId": { + "Ref": "BedrockModelId" } }, "TimeoutInMinutes": "60"