Skip to content

Commit f9f8191

Browse files
committed
added support for meta 3.2 models
1 parent 1b781a0 commit f9f8191

22 files changed

+303
-7
lines changed

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"HEUN",
3333
"hhmmss",
3434
"Hmmss",
35+
"inferencing",
3536
"inpainting",
3637
"isnot",
3738
"jakemorrison",

docs/CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.2.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.22.0] - **BREAKING CHANGES**
8+
## [0.26.0] - **BREAKING CHANGES**
99

1010
- Module changes:
1111
- stability.ai
@@ -22,7 +22,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
- Cohere
2323
- `Invoke-CohereCommandRModel` - minor corrections to debug output
2424
- Meta
25-
- `Invoke-MetaModel` - minor corrections to debug output and help
25+
- `Invoke-MetaModel`
26+
- Added support for new 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`
27+
- minor corrections to debug output and help
2628
- Mistral
2729
- `Invoke-MistralAIModel` - minor corrections to debug output and help. Adjusted Max token limit validation.
2830
- Build changes:

docs/Invoke-MetaModel.md

+8
Original file line numberDiff line numberDiff line change
@@ -376,3 +376,11 @@ Author: Jake Morrison - @jakemorrison - https://www.techthoughts.info/
376376
[https://llama.meta.com/docs/model-cards-and-prompt-formats/meta-llama-3/](https://llama.meta.com/docs/model-cards-and-prompt-formats/meta-llama-3/)
377377
378378
[https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md](https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md)
379+
380+
[https://github.com/meta-llama/llama-models/blob/main/models/llama3_2/MODEL_CARD.md](https://github.com/meta-llama/llama-models/blob/main/models/llama3_2/MODEL_CARD.md)
381+
382+
[https://github.com/meta-llama/llama-models/blob/main/models/llama3_2/MODEL_CARD_VISION.md](https://github.com/meta-llama/llama-models/blob/main/models/llama3_2/MODEL_CARD_VISION.md)
383+
384+
[https://github.com/meta-llama/llama-models/blob/main/models/llama3_2/vision_prompt_format.md](https://github.com/meta-llama/llama-models/blob/main/models/llama3_2/vision_prompt_format.md)
385+
386+
[https://www.llama.com/docs/how-to-guides/vision-capabilities/](https://www.llama.com/docs/how-to-guides/vision-capabilities/)

docs/pwshBedrock.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Module Name: pwshBedrock
33
Module Guid: b4f9e4dc-0229-44ef-99a1-08be4c5e81f2
44
Download Help Link: NA
5-
Help Version: 0.22.0
5+
Help Version: 0.26.0
66
Locale: en-US
77
---
88

src/Tests/Integration/ConverseAPI.Tests.ps1

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ InModuleScope 'pwshBedrock' {
3737
'meta.llama3-1-8b-instruct-v1:0',
3838
'meta.llama3-1-70b-instruct-v1:0',
3939
'meta.llama3-1-405b-instruct-v1:0',
40+
'meta.llama3-2-1b-instruct-v1:0',
41+
'meta.llama3-2-3b-instruct-v1:0',
42+
'meta.llama3-2-11b-instruct-v1:0',
43+
'meta.llama3-2-90b-instruct-v1:0',
4044
'mistral.mistral-7b-instruct-v0:2',
4145
'mistral.mistral-large-2402-v1:0',
4246
'mistral.mistral-large-2407-v1:0',

src/Tests/Integration/SupportedModels-Checks.Tests.ps1

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Describe 'Supported Models Checks' -Tag Integration {
3232
'meta.llama3-1-8b-instruct-v1:0'
3333
'meta.llama3-1-70b-instruct-v1:0'
3434
'meta.llama3-1-405b-instruct-v1:0'
35+
'meta.llama3-2-1b-instruct-v1:0',
36+
'meta.llama3-2-3b-instruct-v1:0',
37+
'meta.llama3-2-11b-instruct-v1:0',
38+
'meta.llama3-2-90b-instruct-v1:0',
3539
'mistral.mistral-7b-instruct-v0:2'
3640
'mistral.mistral-large-2402-v1:0'
3741
'mistral.mistral-large-2407-v1:0',

src/Tests/Unit/Public/Get-ModelContext.Tests.ps1

+16
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,22 @@ InModuleScope 'pwshBedrock' {
167167
ModelId = 'meta.llama3-1-405b-instruct-v1:0'
168168
Context = 'test'
169169
}
170+
[PSCustomObject]@{
171+
ModelId = 'meta.llama3-2-1b-instruct-v1:0'
172+
Context = 'test'
173+
}
174+
[PSCustomObject]@{
175+
ModelId = 'meta.llama3-2-3b-instruct-v1:0'
176+
Context = 'test'
177+
}
178+
[PSCustomObject]@{
179+
ModelId = 'meta.llama3-2-11b-instruct-v1:0'
180+
Context = 'test'
181+
}
182+
[PSCustomObject]@{
183+
ModelId = 'meta.llama3-2-90b-instruct-v1:0'
184+
Context = 'test'
185+
}
170186
[PSCustomObject]@{
171187
ModelId = 'mistral.mistral-7b-instruct-v0:2'
172188
Context = 'test'

src/Tests/Unit/Public/Get-ModelTally.Tests.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ InModuleScope 'pwshBedrock' {
4343

4444
It 'should get the tally for all models' {
4545
$eval = Get-ModelTally -AllModels
46-
$eval.Count | Should -BeExactly 35
46+
$eval.Count | Should -BeExactly 39
4747
foreach ($model in $eval) {
4848
if ($null -ne $model.ImageCount) {
4949
$model.ImageCount | Should -BeExactly 0

src/Tests/Unit/Public/Reset-ModelContext.Tests.ps1

+56
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,62 @@ User: "Hi there!
401401
}
402402
)
403403
}
404+
[PSCustomObject]@{
405+
ModelID = 'meta.llama3-2-1b-instruct-v1:0'
406+
Context = @(
407+
[PSCustomObject]@{
408+
role = 'user'
409+
content = @(
410+
[PSCustomObject]@{
411+
type = 'text'
412+
text = 'Llama3 2 1b instruct v1 context'
413+
}
414+
)
415+
}
416+
)
417+
}
418+
[PSCustomObject]@{
419+
ModelID = 'meta.llama3-2-3b-instruct-v1:0'
420+
Context = @(
421+
[PSCustomObject]@{
422+
role = 'user'
423+
content = @(
424+
[PSCustomObject]@{
425+
type = 'text'
426+
text = 'Llama3 2 3b instruct v1 context'
427+
}
428+
)
429+
}
430+
)
431+
}
432+
[PSCustomObject]@{
433+
ModelID = 'meta.llama3-2-11b-instruct-v1:0'
434+
Context = @(
435+
[PSCustomObject]@{
436+
role = 'user'
437+
content = @(
438+
[PSCustomObject]@{
439+
type = 'text'
440+
text = 'Llama3 2 11b instruct v1 context'
441+
}
442+
)
443+
}
444+
)
445+
}
446+
[PSCustomObject]@{
447+
ModelID = 'meta.llama3-2-90b-instruct-v1:0'
448+
Context = @(
449+
[PSCustomObject]@{
450+
role = 'user'
451+
content = @(
452+
[PSCustomObject]@{
453+
type = 'text'
454+
text = 'Llama3 2 90b instruct v1 context'
455+
}
456+
)
457+
}
458+
)
459+
}
404460
[PSCustomObject]@{
405461
ModelID = 'mistral.mistral-7b-instruct-v0:2'
406462
Context = @(

src/pwshBedrock/Imports.ps1

+132
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,38 @@ $Global:pwshBedRockSessionModelTally = @(
211211
InputTokenCost = 0
212212
OutputTokenCost = 0
213213
}
214+
[PSCustomObject]@{
215+
ModelId = 'meta.llama3-2-1b-instruct-v1:0'
216+
TotalCost = 0
217+
InputTokenCount = 0
218+
OutputTokenCount = 0
219+
InputTokenCost = 0
220+
OutputTokenCost = 0
221+
}
222+
[PSCustomObject]@{
223+
ModelId = 'meta.llama3-2-3b-instruct-v1:0'
224+
TotalCost = 0
225+
InputTokenCount = 0
226+
OutputTokenCount = 0
227+
InputTokenCost = 0
228+
OutputTokenCost = 0
229+
}
230+
[PSCustomObject]@{
231+
ModelId = 'meta.llama3-2-11b-instruct-v1:0'
232+
TotalCost = 0
233+
InputTokenCount = 0
234+
OutputTokenCount = 0
235+
InputTokenCost = 0
236+
OutputTokenCost = 0
237+
}
238+
[PSCustomObject]@{
239+
ModelId = 'meta.llama3-2-90b-instruct-v1:0'
240+
TotalCost = 0
241+
InputTokenCount = 0
242+
OutputTokenCount = 0
243+
InputTokenCost = 0
244+
OutputTokenCost = 0
245+
}
214246
[PSCustomObject]@{
215247
ModelId = 'mistral.mistral-7b-instruct-v0:2'
216248
TotalCost = 0
@@ -382,6 +414,22 @@ $Global:pwshBedrockModelContext = @(
382414
ModelId = 'meta.llama3-1-405b-instruct-v1:0'
383415
Context = ''
384416
}
417+
[PSCustomObject]@{
418+
ModelId = 'meta.llama3-2-1b-instruct-v1:0'
419+
Context = ''
420+
}
421+
[PSCustomObject]@{
422+
ModelId = 'meta.llama3-2-3b-instruct-v1:0'
423+
Context = ''
424+
}
425+
[PSCustomObject]@{
426+
ModelId = 'meta.llama3-2-11b-instruct-v1:0'
427+
Context = ''
428+
}
429+
[PSCustomObject]@{
430+
ModelId = 'meta.llama3-2-90b-instruct-v1:0'
431+
Context = ''
432+
}
385433
[PSCustomObject]@{
386434
ModelId = 'mistral.mistral-7b-instruct-v0:2'
387435
Context = ''
@@ -1039,6 +1087,90 @@ $script:metaModelInfo = @(
10391087
InputTokenCost = 0.00532
10401088
OutputTokenCost = 0.016
10411089
}
1090+
[PSCustomObject]@{
1091+
ProviderName = 'Meta'
1092+
ModelName = 'Llama 3.2 1B Instruct'
1093+
ModelId = 'meta.llama3-2-1b-instruct-v1:0'
1094+
Description = 'The most lightweight model in the Llama 3.2 collection of models, perfect for retrieval and summarization for edge devices and mobile applications.'
1095+
Strength = 'ideal for the following use cases: personal information management and multilingual knowledge retrieval.'
1096+
Multilingual = $true
1097+
Text = $true
1098+
Document = $true
1099+
Vision = $false
1100+
SystemPrompt = $true
1101+
ToolUse = $false
1102+
ResponseStreamingSupported = $true
1103+
ChatHistorySupported = $true
1104+
ContextWindow = 128000
1105+
MaxOutput = 4096
1106+
TrainingCutoff = '12-01-2023'
1107+
PayloadLimit = ''
1108+
InputTokenCost = 0.0001
1109+
OutputTokenCost = 0.0001
1110+
}
1111+
[PSCustomObject]@{
1112+
ProviderName = 'Meta'
1113+
ModelName = 'Llama 3.2 3B Instruct'
1114+
ModelId = 'meta.llama3-2-3b-instruct-v1:0'
1115+
Description = 'Designed for applications requiring low-latency inferencing and limited computational resources.'
1116+
Strength = 'excels at text summarization, classification, and language translation tasks. This model is ideal for the following use cases: mobile AI-powered writing assistants and customer service applications.'
1117+
Multilingual = $true
1118+
Text = $true
1119+
Document = $true
1120+
Vision = $false
1121+
SystemPrompt = $true
1122+
ToolUse = $false
1123+
ResponseStreamingSupported = $true
1124+
ChatHistorySupported = $true
1125+
ContextWindow = 128000
1126+
MaxOutput = 4096
1127+
TrainingCutoff = '12-01-2023'
1128+
PayloadLimit = ''
1129+
InputTokenCost = 0.00015
1130+
OutputTokenCost = 0.00015
1131+
}
1132+
[PSCustomObject]@{
1133+
ProviderName = 'Meta'
1134+
ModelName = 'Llama 3.2 11B Instruct'
1135+
ModelId = 'meta.llama3-2-11b-instruct-v1:0'
1136+
Description = 'Well-suited for content creation, conversational AI, language understanding, and enterprise applications requiring visual reasoning.'
1137+
Strength = 'The model demonstrates strong performance in text summarization, sentiment analysis, code generation, and following instructions, with the added ability to reason about images. This model use cases are similar to the 90B version: image captioning, image-text-retrieval, visual grounding, visual question answering and visual reasoning, and document visual question answering.'
1138+
Multilingual = $true
1139+
Text = $true
1140+
Document = $true
1141+
Vision = $true
1142+
SystemPrompt = $true
1143+
ToolUse = $false
1144+
ResponseStreamingSupported = $true
1145+
ChatHistorySupported = $true
1146+
ContextWindow = 128000
1147+
MaxOutput = 4096
1148+
TrainingCutoff = '12-01-2023'
1149+
PayloadLimit = ''
1150+
InputTokenCost = 0.00035
1151+
OutputTokenCost = 0.00035
1152+
}
1153+
[PSCustomObject]@{
1154+
ProviderName = 'Meta'
1155+
ModelName = 'Llama 3.2 90B Instruct'
1156+
ModelId = 'meta.llama3-2-90b-instruct-v1:0'
1157+
Description = "Meta's most advanced model, ideal for enterprise-level applications."
1158+
Strength = 'excels at general knowledge, long-form text generation, multilingual translation, coding, math, and advanced reasoning. It also introduces image reasoning capabilities, allowing for image understanding and visual reasoning tasks. This model is ideal for the following use cases: image captioning, image-text retrieval, visual grounding, visual question answering and visual reasoning, and document visual question answering.'
1159+
Multilingual = $true
1160+
Text = $true
1161+
Document = $true
1162+
Vision = $true
1163+
SystemPrompt = $true
1164+
ToolUse = $false
1165+
ResponseStreamingSupported = $true
1166+
ChatHistorySupported = $true
1167+
ContextWindow = 128000
1168+
MaxOutput = 4096
1169+
TrainingCutoff = '12-01-2023'
1170+
PayloadLimit = ''
1171+
InputTokenCost = 0.002
1172+
OutputTokenCost = 0.002
1173+
}
10421174
) #metaModelInfo
10431175

10441176
#endregion

src/pwshBedrock/Private/Add-ModelCostEstimate.ps1

+20
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ function Add-ModelCostEstimate {
8080
'meta.llama3-1-8b-instruct-v1:0',
8181
'meta.llama3-1-70b-instruct-v1:0',
8282
'meta.llama3-1-405b-instruct-v1:0',
83+
'meta.llama3-2-1b-instruct-v1:0',
84+
'meta.llama3-2-3b-instruct-v1:0',
85+
'meta.llama3-2-11b-instruct-v1:0',
86+
'meta.llama3-2-90b-instruct-v1:0',
8387
'mistral.mistral-7b-instruct-v0:2',
8488
'mistral.mistral-large-2402-v1:0',
8589
'mistral.mistral-large-2407-v1:0',
@@ -208,6 +212,22 @@ function Add-ModelCostEstimate {
208212
$inputTokenCount = $Usage.prompt_token_count
209213
$outputTokenCount = $Usage.generation_token_count
210214
}
215+
'meta.llama3-2-1b-instruct-v1:0' {
216+
$inputTokenCount = $Usage.prompt_token_count
217+
$outputTokenCount = $Usage.generation_token_count
218+
}
219+
'meta.llama3-2-3b-instruct-v1:0' {
220+
$inputTokenCount = $Usage.prompt_token_count
221+
$outputTokenCount = $Usage.generation_token_count
222+
}
223+
'meta.llama3-2-11b-instruct-v1:0' {
224+
$inputTokenCount = $Usage.prompt_token_count
225+
$outputTokenCount = $Usage.generation_token_count
226+
}
227+
'meta.llama3-2-90b-instruct-v1:0' {
228+
$inputTokenCount = $Usage.prompt_token_count
229+
$outputTokenCount = $Usage.generation_token_count
230+
}
211231
'mistral.mistral-7b-instruct-v0:2' {
212232
$inputTokenCount = Get-TokenCountEstimate -Text $Message
213233
$outputTokenCount = Get-TokenCountEstimate -Text $Usage.outputs.text

src/pwshBedrock/Private/Format-MetaTextMessage.ps1

+5-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ function Format-MetaTextMessage {
6060
'meta.llama3-70b-instruct-v1:0',
6161
'meta.llama3-1-8b-instruct-v1:0',
6262
'meta.llama3-1-70b-instruct-v1:0',
63-
'meta.llama3-1-405b-instruct-v1:0'
63+
'meta.llama3-1-405b-instruct-v1:0',
64+
'meta.llama3-2-1b-instruct-v1:0',
65+
'meta.llama3-2-3b-instruct-v1:0',
66+
'meta.llama3-2-11b-instruct-v1:0',
67+
'meta.llama3-2-90b-instruct-v1:0'
6468
)]
6569
[string]$ModelID,
6670

src/pwshBedrock/Public/Get-ModelContext.ps1

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ function Get-ModelContext {
6060
'meta.llama3-1-8b-instruct-v1:0',
6161
'meta.llama3-1-70b-instruct-v1:0',
6262
'meta.llama3-1-405b-instruct-v1:0',
63+
'meta.llama3-2-1b-instruct-v1:0',
64+
'meta.llama3-2-3b-instruct-v1:0',
65+
'meta.llama3-2-11b-instruct-v1:0',
66+
'meta.llama3-2-90b-instruct-v1:0',
6367
'mistral.mistral-7b-instruct-v0:2',
6468
'mistral.mistral-large-2402-v1:0',
6569
'mistral.mistral-large-2407-v1:0',

src/pwshBedrock/Public/Get-ModelCostEstimate.ps1

+4
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ function Get-ModelCostEstimate {
9292
'meta.llama3-1-8b-instruct-v1:0',
9393
'meta.llama3-1-70b-instruct-v1:0',
9494
'meta.llama3-1-405b-instruct-v1:0',
95+
'meta.llama3-2-1b-instruct-v1:0',
96+
'meta.llama3-2-3b-instruct-v1:0',
97+
'meta.llama3-2-11b-instruct-v1:0',
98+
'meta.llama3-2-90b-instruct-v1:0',
9599
'mistral.mistral-7b-instruct-v0:2',
96100
'mistral.mistral-small-2402-v1:0',
97101
'mistral.mistral-large-2402-v1:0',

src/pwshBedrock/Public/Get-ModelInfo.ps1

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ function Get-ModelInfo {
6969
'meta.llama3-1-8b-instruct-v1:0',
7070
'meta.llama3-1-70b-instruct-v1:0',
7171
'meta.llama3-1-405b-instruct-v1:0',
72+
'meta.llama3-2-1b-instruct-v1:0',
73+
'meta.llama3-2-3b-instruct-v1:0',
74+
'meta.llama3-2-11b-instruct-v1:0',
75+
'meta.llama3-2-90b-instruct-v1:0',
7276
'mistral.mistral-7b-instruct-v0:2',
7377
'mistral.mistral-small-2402-v1:0',
7478
'mistral.mistral-large-2402-v1:0',

0 commit comments

Comments
 (0)