bedrock-wrapper 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/bedrock-models.js +116 -0
- package/package.json +4 -4
- package/tea.yaml +6 -0
- package/test-models-output.txt +22 -13
- package/test-vision.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
## [2.3.1] - 2025-05-22 (Claude 4 Opus / Sonnet)
|
|
5
|
+
### Added
|
|
6
|
+
- Support for Claude 4 Opus & Claude 4 Sonnet models
|
|
7
|
+
- Claude-4-Opus
|
|
8
|
+
- Claude-4-Opus-Thinking
|
|
9
|
+
- Claude-4-Sonnet
|
|
10
|
+
- Claude-4-Sonnet-Thinking
|
|
11
|
+
|
|
4
12
|
## [2.3.0] - 2025-02-15 (Claude 3.7 & Image Support)
|
|
5
13
|
### Added
|
|
6
14
|
- Support for Claude 3.7 models
|
package/bedrock-models.js
CHANGED
|
@@ -6,6 +6,122 @@
|
|
|
6
6
|
// https://us-west-2.console.aws.amazon.com/bedrock/home?region=us-west-2#/cross-region-inference
|
|
7
7
|
|
|
8
8
|
export const bedrock_models = [
|
|
9
|
+
{
|
|
10
|
+
// ====================
|
|
11
|
+
// == Claude 4 Opus ==
|
|
12
|
+
// ====================
|
|
13
|
+
"modelName": "Claude-4-Opus",
|
|
14
|
+
// "modelId": "anthropic.claude-opus-4-20250514-v1:0",
|
|
15
|
+
"modelId": "us.anthropic.claude-opus-4-20250514-v1:0",
|
|
16
|
+
"vision": true,
|
|
17
|
+
"messages_api": true,
|
|
18
|
+
"system_as_separate_field": true,
|
|
19
|
+
"display_role_names": true,
|
|
20
|
+
"max_tokens_param_name": "max_tokens",
|
|
21
|
+
"max_supported_response_tokens": 131072,
|
|
22
|
+
"response_chunk_element": "delta.text",
|
|
23
|
+
"response_nonchunk_element": "content[0].text",
|
|
24
|
+
"thinking_response_chunk_element": "delta.thinking",
|
|
25
|
+
"thinking_response_nonchunk_element": "content[0].thinking",
|
|
26
|
+
"special_request_schema": {
|
|
27
|
+
"anthropic_version": "bedrock-2023-05-31",
|
|
28
|
+
"anthropic_beta": ["output-128k-2025-02-19"],
|
|
29
|
+
},
|
|
30
|
+
"image_support": {
|
|
31
|
+
"max_image_size": 20971520, // 20MB
|
|
32
|
+
"supported_formats": ["jpeg", "png", "gif", "webp"],
|
|
33
|
+
"max_images_per_request": 10
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
// ==============================
|
|
38
|
+
// == Claude 4 Opus Thinking ==
|
|
39
|
+
// ==============================
|
|
40
|
+
"modelName": "Claude-4-Opus-Thinking",
|
|
41
|
+
// "modelId": "anthropic.claude-opus-4-20250514-v1:0",
|
|
42
|
+
"modelId": "us.anthropic.claude-opus-4-20250514-v1:0",
|
|
43
|
+
"vision": true,
|
|
44
|
+
"messages_api": true,
|
|
45
|
+
"system_as_separate_field": true,
|
|
46
|
+
"display_role_names": true,
|
|
47
|
+
"max_tokens_param_name": "max_tokens",
|
|
48
|
+
"max_supported_response_tokens": 131072,
|
|
49
|
+
"response_chunk_element": "delta.text",
|
|
50
|
+
"response_nonchunk_element": "content[0].text",
|
|
51
|
+
"thinking_response_chunk_element": "delta.thinking",
|
|
52
|
+
"thinking_response_nonchunk_element": "content[0].thinking",
|
|
53
|
+
"special_request_schema": {
|
|
54
|
+
"anthropic_version": "bedrock-2023-05-31",
|
|
55
|
+
"anthropic_beta": ["output-128k-2025-02-19"],
|
|
56
|
+
"thinking": {
|
|
57
|
+
"type": "enabled",
|
|
58
|
+
"budget_tokens": 16000
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
"image_support": {
|
|
62
|
+
"max_image_size": 20971520, // 20MB
|
|
63
|
+
"supported_formats": ["jpeg", "png", "gif", "webp"],
|
|
64
|
+
"max_images_per_request": 10
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
// =====================
|
|
69
|
+
// == Claude 4 Sonnet ==
|
|
70
|
+
// =====================
|
|
71
|
+
"modelName": "Claude-4-Sonnet",
|
|
72
|
+
// "modelId": "anthropic.claude-sonnet-4-20250514-v1:0",
|
|
73
|
+
"modelId": "us.anthropic.claude-sonnet-4-20250514-v1:0",
|
|
74
|
+
"vision": true,
|
|
75
|
+
"messages_api": true,
|
|
76
|
+
"system_as_separate_field": true,
|
|
77
|
+
"display_role_names": true,
|
|
78
|
+
"max_tokens_param_name": "max_tokens",
|
|
79
|
+
"max_supported_response_tokens": 131072,
|
|
80
|
+
"response_chunk_element": "delta.text",
|
|
81
|
+
"response_nonchunk_element": "content[0].text",
|
|
82
|
+
"thinking_response_chunk_element": "delta.thinking",
|
|
83
|
+
"thinking_response_nonchunk_element": "content[0].thinking",
|
|
84
|
+
"special_request_schema": {
|
|
85
|
+
"anthropic_version": "bedrock-2023-05-31",
|
|
86
|
+
"anthropic_beta": ["output-128k-2025-02-19"],
|
|
87
|
+
},
|
|
88
|
+
"image_support": {
|
|
89
|
+
"max_image_size": 20971520, // 20MB
|
|
90
|
+
"supported_formats": ["jpeg", "png", "gif", "webp"],
|
|
91
|
+
"max_images_per_request": 10
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
// ==============================
|
|
96
|
+
// == Claude 4 Sonnet Thinking ==
|
|
97
|
+
// ==============================
|
|
98
|
+
"modelName": "Claude-4-Sonnet-Thinking",
|
|
99
|
+
// "modelId": "anthropic.claude-sonnet-4-20250514-v1:0",
|
|
100
|
+
"modelId": "us.anthropic.claude-sonnet-4-20250514-v1:0",
|
|
101
|
+
"vision": true,
|
|
102
|
+
"messages_api": true,
|
|
103
|
+
"system_as_separate_field": true,
|
|
104
|
+
"display_role_names": true,
|
|
105
|
+
"max_tokens_param_name": "max_tokens",
|
|
106
|
+
"max_supported_response_tokens": 131072,
|
|
107
|
+
"response_chunk_element": "delta.text",
|
|
108
|
+
"response_nonchunk_element": "content[0].text",
|
|
109
|
+
"thinking_response_chunk_element": "delta.thinking",
|
|
110
|
+
"thinking_response_nonchunk_element": "content[0].thinking",
|
|
111
|
+
"special_request_schema": {
|
|
112
|
+
"anthropic_version": "bedrock-2023-05-31",
|
|
113
|
+
"anthropic_beta": ["output-128k-2025-02-19"],
|
|
114
|
+
"thinking": {
|
|
115
|
+
"type": "enabled",
|
|
116
|
+
"budget_tokens": 16000
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
"image_support": {
|
|
120
|
+
"max_image_size": 20971520, // 20MB
|
|
121
|
+
"supported_formats": ["jpeg", "png", "gif", "webp"],
|
|
122
|
+
"max_images_per_request": 10
|
|
123
|
+
}
|
|
124
|
+
},
|
|
9
125
|
{
|
|
10
126
|
// ================================
|
|
11
127
|
// == Claude 3.7 Sonnet Thinking ==
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bedrock-wrapper",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "🪨 Bedrock Wrapper is an npm package that simplifies the integration of existing OpenAI-compatible API objects with AWS Bedrock's serverless inference LLMs.",
|
|
5
5
|
"homepage": "https://www.equilllabs.com/projects/bedrock-wrapper",
|
|
6
6
|
"repository": {
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"author": "",
|
|
33
33
|
"license": "ISC",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@aws-sdk/client-bedrock-runtime": "^3.
|
|
36
|
-
"dotenv": "^16.
|
|
37
|
-
"sharp": "^0.
|
|
35
|
+
"@aws-sdk/client-bedrock-runtime": "^3.816.0",
|
|
36
|
+
"dotenv": "^16.5.0",
|
|
37
|
+
"sharp": "^0.34.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"chalk": "^5.4.1"
|
package/tea.yaml
ADDED
package/test-models-output.txt
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
Test Question: "Respond with exactly one word: What is 1+1?"
|
|
2
2
|
==================================================
|
|
3
3
|
|
|
4
|
-
Starting tests with
|
|
4
|
+
Starting tests with 20 models...
|
|
5
5
|
Each model will be tested with streaming and non-streaming calls
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
--------------------------------------------------
|
|
9
|
+
Testing Claude-4-Sonnet ⇢
|
|
10
|
+
Streaming test passed for Claude-4-Sonnet: "Two"
|
|
11
|
+
Non-streaming test passed for Claude-4-Sonnet: "<think>The human is asking me to respond with exactly one word to the question "What is 1+1?". The answer to 1+1 is 2. So I need to respond with just the word "Two" or "2". Since they asked for exactly one word, I'll use "Two".</think>
|
|
12
|
+
|
|
13
|
+
Two"
|
|
14
|
+
|
|
8
15
|
--------------------------------------------------
|
|
9
16
|
Testing Claude-3-7-Sonnet-Thinking ⇢
|
|
10
|
-
Streaming test passed for Claude-3-7-Sonnet-Thinking: "
|
|
11
|
-
Non-streaming test passed for Claude-3-7-Sonnet-Thinking: "<think>The
|
|
17
|
+
Streaming test passed for Claude-3-7-Sonnet-Thinking: "2"
|
|
18
|
+
Non-streaming test passed for Claude-3-7-Sonnet-Thinking: "<think>The human is asking me to respond with exactly one word, and the question is "What is 1+1?".
|
|
19
|
+
|
|
20
|
+
The answer to 1+1 is 2.
|
|
12
21
|
|
|
13
|
-
|
|
22
|
+
I need to follow the instruction precisely and respond with exactly one word, which in this case is "Two" or just "2".
|
|
14
23
|
|
|
15
|
-
I
|
|
24
|
+
I'll go with "Two" since that's the word form rather than the numeral.</think>
|
|
16
25
|
|
|
17
|
-
|
|
26
|
+
Two"
|
|
18
27
|
|
|
19
28
|
--------------------------------------------------
|
|
20
29
|
Testing Claude-3-7-Sonnet ⇢
|
|
21
30
|
Streaming test passed for Claude-3-7-Sonnet: "2"
|
|
22
|
-
Non-streaming test passed for Claude-3-7-Sonnet: "
|
|
31
|
+
Non-streaming test passed for Claude-3-7-Sonnet: "2"
|
|
23
32
|
|
|
24
33
|
--------------------------------------------------
|
|
25
34
|
Testing Claude-3-5-Sonnet-v2 ⇢
|
|
@@ -43,7 +52,7 @@ Non-streaming test passed for Claude-3-Haiku: "Two."
|
|
|
43
52
|
|
|
44
53
|
--------------------------------------------------
|
|
45
54
|
Testing Llama-3-3-70b ⇢
|
|
46
|
-
Streaming test passed for Llama-3-3-70b: "Two"
|
|
55
|
+
Streaming test passed for Llama-3-3-70b: "Two."
|
|
47
56
|
Non-streaming test passed for Llama-3-3-70b: "Two."
|
|
48
57
|
|
|
49
58
|
--------------------------------------------------
|
|
@@ -78,8 +87,8 @@ Non-streaming test passed for Llama-3-1-70b: "Two."
|
|
|
78
87
|
|
|
79
88
|
--------------------------------------------------
|
|
80
89
|
Testing Llama-3-1-405b ⇢
|
|
81
|
-
Streaming test passed for Llama-3-1-405b: "Two"
|
|
82
|
-
Non-streaming test passed for Llama-3-1-405b: "Two
|
|
90
|
+
Streaming test passed for Llama-3-1-405b: "Two."
|
|
91
|
+
Non-streaming test passed for Llama-3-1-405b: "Two"
|
|
83
92
|
|
|
84
93
|
--------------------------------------------------
|
|
85
94
|
Testing Llama-3-8b ⇢
|
|
@@ -88,7 +97,7 @@ Non-streaming test passed for Llama-3-8b: "Two"
|
|
|
88
97
|
|
|
89
98
|
--------------------------------------------------
|
|
90
99
|
Testing Llama-3-70b ⇢
|
|
91
|
-
Streaming test passed for Llama-3-70b: "Two"
|
|
100
|
+
Streaming test passed for Llama-3-70b: "Two."
|
|
92
101
|
Non-streaming test passed for Llama-3-70b: "Two"
|
|
93
102
|
|
|
94
103
|
--------------------------------------------------
|
|
@@ -100,10 +109,10 @@ Non-streaming test passed for Mistral-7b: "Two. (I've given you two words, but t
|
|
|
100
109
|
Testing Mixtral-8x7b ⇢
|
|
101
110
|
Streaming test passed for Mixtral-8x7b: "Two.
|
|
102
111
|
|
|
103
|
-
The word you are looking for is "two." The sum of 1
|
|
112
|
+
The word you are looking for is "two." The sum of 1+1 is indeed two. I'm here to provide accurate and helpful responses to your questions, and I'll always do my best to give you the information you need. In this case, the answer to 1+1 is a simple and well-known mathematical fact. If you have any more questions or need further clarification, please don't hesitate to ask. I'm here to help!"
|
|
104
113
|
Non-streaming test passed for Mixtral-8x7b: "Two.
|
|
105
114
|
|
|
106
|
-
The
|
|
115
|
+
The word you are looking for is "two." The sum of 1 + 1 is equal to 2. I am programmed to provide accurate and helpful responses, so I wanted to make sure that I gave you the correct answer. If you have any other questions or need further clarification, please don't hesitate to ask. I'm here to help!"
|
|
107
116
|
|
|
108
117
|
--------------------------------------------------
|
|
109
118
|
Testing Mistral-Large ⇢
|
package/test-vision.js
CHANGED
|
@@ -35,7 +35,7 @@ async function testVisionCapabilities() {
|
|
|
35
35
|
];
|
|
36
36
|
|
|
37
37
|
// Test with both Claude and Llama models that support vision
|
|
38
|
-
const visionModels = ["Claude-3-5-Sonnet-v2", "Claude-3-7-Sonnet"];
|
|
38
|
+
const visionModels = ["Claude-3-5-Sonnet-v2", "Claude-3-7-Sonnet", "Claude-4-Sonnet", "Claude-4-Sonnet-Thinking", "Claude-4-Opus", "Claude-4-Opus-Thinking"];
|
|
39
39
|
|
|
40
40
|
for (const model of visionModels) {
|
|
41
41
|
console.log(`\nTesting vision capabilities with ${model}...`);
|