Skip to content

Commit 4ddc702

Browse files
authored
feat(bedrock): support meta llama3-2 (#31568)
### Issue # (if applicable) Closes #<issue number here>. ### Reason for this change Added Meta Llama 3.2 models. - meta.llama3-2-1b-instruct-v1:0 - meta.llama3-2-3b-instruct-v1:0 - meta.llama3-2-11b-instruct-v1:0 - meta.llama3-2-90b-instruct-v1:0 ref - https://aws.amazon.com/about-aws/whats-new/2024/09/llama-3-2-generative-ai-models-amazon-bedrock/ - https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html ### Description of changes Added the models. ### Description of how you validated changes ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 4b00ffe commit 4ddc702

File tree

9 files changed

+628
-44
lines changed

9 files changed

+628
-44
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/bedrock/integ.invoke-model.js.snapshot/InvokeModelDefaultTestDeployAssert9C0D2DFC.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/bedrock/integ.invoke-model.js.snapshot/aws-stepfunctions-tasks-bedrock-invoke-model-integ.assets.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/bedrock/integ.invoke-model.js.snapshot/aws-stepfunctions-tasks-bedrock-invoke-model-integ.template.json

+195
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,201 @@
144144
],
145145
"UpdateReplacePolicy": "Delete",
146146
"DeletionPolicy": "Delete"
147+
},
148+
"LlamaStateMachineRoleA1E51172": {
149+
"Type": "AWS::IAM::Role",
150+
"Properties": {
151+
"AssumeRolePolicyDocument": {
152+
"Statement": [
153+
{
154+
"Action": "sts:AssumeRole",
155+
"Effect": "Allow",
156+
"Principal": {
157+
"Service": "states.amazonaws.com"
158+
}
159+
}
160+
],
161+
"Version": "2012-10-17"
162+
}
163+
}
164+
},
165+
"LlamaStateMachineRoleDefaultPolicy36666B63": {
166+
"Type": "AWS::IAM::Policy",
167+
"Properties": {
168+
"PolicyDocument": {
169+
"Statement": [
170+
{
171+
"Action": "bedrock:InvokeModel",
172+
"Effect": "Allow",
173+
"Resource": [
174+
{
175+
"Fn::Join": [
176+
"",
177+
[
178+
"arn:",
179+
{
180+
"Ref": "AWS::Partition"
181+
},
182+
":bedrock:",
183+
{
184+
"Ref": "AWS::Region"
185+
},
186+
"::foundation-model/meta.llama3-2-11b-instruct-v1:0"
187+
]
188+
]
189+
},
190+
{
191+
"Fn::Join": [
192+
"",
193+
[
194+
"arn:",
195+
{
196+
"Ref": "AWS::Partition"
197+
},
198+
":bedrock:",
199+
{
200+
"Ref": "AWS::Region"
201+
},
202+
"::foundation-model/meta.llama3-2-1b-instruct-v1:0"
203+
]
204+
]
205+
},
206+
{
207+
"Fn::Join": [
208+
"",
209+
[
210+
"arn:",
211+
{
212+
"Ref": "AWS::Partition"
213+
},
214+
":bedrock:",
215+
{
216+
"Ref": "AWS::Region"
217+
},
218+
"::foundation-model/meta.llama3-2-3b-instruct-v1:0"
219+
]
220+
]
221+
},
222+
{
223+
"Fn::Join": [
224+
"",
225+
[
226+
"arn:",
227+
{
228+
"Ref": "AWS::Partition"
229+
},
230+
":bedrock:",
231+
{
232+
"Ref": "AWS::Region"
233+
},
234+
"::foundation-model/meta.llama3-2-90b-instruct-v1:0"
235+
]
236+
]
237+
}
238+
]
239+
},
240+
{
241+
"Action": [
242+
"s3:GetObject",
243+
"s3:PutObject"
244+
],
245+
"Effect": "Allow",
246+
"Resource": {
247+
"Fn::Join": [
248+
"",
249+
[
250+
"arn:",
251+
{
252+
"Ref": "AWS::Partition"
253+
},
254+
":s3:::*"
255+
]
256+
]
257+
}
258+
}
259+
],
260+
"Version": "2012-10-17"
261+
},
262+
"PolicyName": "LlamaStateMachineRoleDefaultPolicy36666B63",
263+
"Roles": [
264+
{
265+
"Ref": "LlamaStateMachineRoleA1E51172"
266+
}
267+
]
268+
}
269+
},
270+
"LlamaStateMachineD0B74BA3": {
271+
"Type": "AWS::StepFunctions::StateMachine",
272+
"Properties": {
273+
"DefinitionString": {
274+
"Fn::Join": [
275+
"",
276+
[
277+
"{\"StartAt\":\"LlamaPrompt1\",\"States\":{\"LlamaPrompt1\":{\"Next\":\"LlamaPrompt2\",\"Type\":\"Task\",\"ResultPath\":\"$\",\"ResultSelector\":{\"names.$\":\"$.Body.results[0].outputText\"},\"Resource\":\"arn:",
278+
{
279+
"Ref": "AWS::Partition"
280+
},
281+
":states:::bedrock:invokeModel\",\"Parameters\":{\"ModelId\":\"arn:",
282+
{
283+
"Ref": "AWS::Partition"
284+
},
285+
":bedrock:",
286+
{
287+
"Ref": "AWS::Region"
288+
},
289+
"::foundation-model/meta.llama3-2-1b-instruct-v1:0\",\"Body\":{\"inputText\":\"Generate a list of five first names.\",\"textGenerationConfig\":{\"maxTokenCount\":100,\"temperature\":1}}}},\"LlamaPrompt2\":{\"Next\":\"LlamaPrompt3\",\"Type\":\"Task\",\"ResultPath\":\"$\",\"ResultSelector\":{\"names.$\":\"$.Body.results[0].outputText\"},\"Resource\":\"arn:",
290+
{
291+
"Ref": "AWS::Partition"
292+
},
293+
":states:::bedrock:invokeModel\",\"Parameters\":{\"ModelId\":\"arn:",
294+
{
295+
"Ref": "AWS::Partition"
296+
},
297+
":bedrock:",
298+
{
299+
"Ref": "AWS::Region"
300+
},
301+
"::foundation-model/meta.llama3-2-3b-instruct-v1:0\",\"Body\":{\"inputText.$\":\"States.Format('Alphabetize this list of first names:/n{}', $.names)\",\"textGenerationConfig\":{\"maxTokenCount\":100,\"temperature\":1}}}},\"LlamaPrompt3\":{\"Next\":\"LlamaPrompt4\",\"Type\":\"Task\",\"OutputPath\":\"$.Body.results[0].outputText\",\"Resource\":\"arn:",
302+
{
303+
"Ref": "AWS::Partition"
304+
},
305+
":states:::bedrock:invokeModel\",\"Parameters\":{\"ModelId\":\"arn:",
306+
{
307+
"Ref": "AWS::Partition"
308+
},
309+
":bedrock:",
310+
{
311+
"Ref": "AWS::Region"
312+
},
313+
"::foundation-model/meta.llama3-2-11b-instruct-v1:0\",\"Body\":{\"inputText.$\":\"States.Format('Echo list of first names: {}', $.names)\",\"textGenerationConfig\":{\"maxTokenCount\":100,\"temperature\":1}}}},\"LlamaPrompt4\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:",
314+
{
315+
"Ref": "AWS::Partition"
316+
},
317+
":states:::bedrock:invokeModel\",\"Parameters\":{\"ModelId\":\"arn:",
318+
{
319+
"Ref": "AWS::Partition"
320+
},
321+
":bedrock:",
322+
{
323+
"Ref": "AWS::Region"
324+
},
325+
"::foundation-model/meta.llama3-2-90b-instruct-v1:0\",\"Input\":{\"S3Uri\":\"$.names\"},\"Output\":{\"S3Uri\":\"$.names\"}}}},\"TimeoutSeconds\":30}"
326+
]
327+
]
328+
},
329+
"RoleArn": {
330+
"Fn::GetAtt": [
331+
"LlamaStateMachineRoleA1E51172",
332+
"Arn"
333+
]
334+
}
335+
},
336+
"DependsOn": [
337+
"LlamaStateMachineRoleDefaultPolicy36666B63",
338+
"LlamaStateMachineRoleA1E51172"
339+
],
340+
"UpdateReplacePolicy": "Delete",
341+
"DeletionPolicy": "Delete"
147342
}
148343
},
149344
"Parameters": {

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/bedrock/integ.invoke-model.js.snapshot/cdk.out

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/bedrock/integ.invoke-model.js.snapshot/integ.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/bedrock/integ.invoke-model.js.snapshot/manifest.json

+22-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)