bedrock-wrapper 2.2.0 → 2.3.0
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 +17 -0
- package/README.md +74 -21
- package/bedrock-models.js +507 -419
- package/bedrock-wrapper.js +223 -36
- package/docs/bedrock-wrapper.jpg +0 -0
- package/interactive-example.js +1 -0
- package/package.json +42 -38
- package/test-image.jpg +0 -0
- package/test-models-output.txt +22 -6
- package/test-models.js +145 -145
- package/test-vision.js +71 -0
- package/utils.js +27 -27
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
## [2.3.0] - 2025-02-15 (Claude 3.7 & Image Support)
|
|
5
|
+
### Added
|
|
6
|
+
- Support for Claude 3.7 models
|
|
7
|
+
- Claude-3-7-Sonnet
|
|
8
|
+
- Claude-3-7-Sonnet-Thinking
|
|
9
|
+
- Image support for compatible Claude models
|
|
10
|
+
- Claude 3.5 Sonnet
|
|
11
|
+
- Claude 3.5 Sonnet v2
|
|
12
|
+
- Claude 3.7 Sonnet
|
|
13
|
+
- Claude 3.7 Sonnet Thinking
|
|
14
|
+
- Enhanced message handling for multimodal content
|
|
15
|
+
- Documentation for image support usage
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- Updated model configuration for image-capable models
|
|
19
|
+
- Improved response handling for multimodal inputs
|
|
20
|
+
|
|
4
21
|
## [2.2.0] - 2025-01-01 (Llama 3.3 70b)
|
|
5
22
|
### Added
|
|
6
23
|
- Support for Llama 3.3 70b
|
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# 🪨 Bedrock Wrapper
|
|
2
|
+
|
|
2
3
|
Bedrock Wrapper is an npm package that simplifies the integration of existing OpenAI-compatible API objects with AWS Bedrock's serverless inference LLMs. Follow the steps below to integrate into your own application, or alternativly use the 🔀 [Bedrock Proxy Endpoint](https://github.com/jparkerweb/bedrock-proxy-endpoint) project to spin up your own custom OpenAI server endpoint for even easier inference (using the standard `baseUrl`, and `apiKey` params).
|
|
3
4
|
|
|
5
|
+

|
|
6
|
+
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
### Maintained by
|
|
@@ -62,7 +65,7 @@ Bedrock Wrapper is an npm package that simplifies the integration of existing Op
|
|
|
62
65
|
]
|
|
63
66
|
```
|
|
64
67
|
|
|
65
|
-
***the `model` value should be
|
|
68
|
+
***the `model` value should be the corresponding `modelName` value in the `bedrock_models` section below (see Supported Models below)***
|
|
66
69
|
|
|
67
70
|
4. call the `bedrockWrapper` function and pass in the previously defined `awsCreds` and `openaiChatCompletionsCreateObject` objects
|
|
68
71
|
```javascript
|
|
@@ -98,26 +101,28 @@ Bedrock Wrapper is an npm package that simplifies the integration of existing Op
|
|
|
98
101
|
|
|
99
102
|
### Supported Models
|
|
100
103
|
|
|
101
|
-
| modelName
|
|
102
|
-
|
|
103
|
-
| Claude-3-
|
|
104
|
-
| Claude-3-
|
|
105
|
-
| Claude-3-5-
|
|
106
|
-
| Claude-3-
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
| Llama-3-
|
|
110
|
-
| Llama-3-2-
|
|
111
|
-
| Llama-3-2-
|
|
112
|
-
| Llama-3-
|
|
113
|
-
| Llama-3-
|
|
114
|
-
| Llama-3-1-
|
|
115
|
-
| Llama-3-
|
|
116
|
-
| Llama-3-
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
| Mistral-
|
|
120
|
-
|
|
104
|
+
| modelName | AWS Model Id | Image |
|
|
105
|
+
|----------------------------|----------------------------------------------|-------|
|
|
106
|
+
| Claude-3-7-Sonnet-Thinking | us.anthropic.claude-3-7-sonnet-20250219-v1:0 | ✅ |
|
|
107
|
+
| Claude-3-7-Sonnet | us.anthropic.claude-3-7-sonnet-20250219-v1:0 | ✅ |
|
|
108
|
+
| Claude-3-5-Sonnet-v2 | anthropic.claude-3-5-sonnet-20241022-v2:0 | ✅ |
|
|
109
|
+
| Claude-3-5-Sonnet | anthropic.claude-3-5-sonnet-20240620-v1:0 | ✅ |
|
|
110
|
+
| Claude-3-5-Haiku | anthropic.claude-3-5-haiku-20241022-v1:0 | ❌ |
|
|
111
|
+
| Claude-3-Haiku | anthropic.claude-3-haiku-20240307-v1:0 | ❌ |
|
|
112
|
+
| Llama-3-3-70b | us.meta.llama3-3-70b-instruct-v1:0 | ❌ |
|
|
113
|
+
| Llama-3-2-1b | us.meta.llama3-2-1b-instruct-v1:0 | ❌ |
|
|
114
|
+
| Llama-3-2-3b | us.meta.llama3-2-3b-instruct-v1:0 | ❌ |
|
|
115
|
+
| Llama-3-2-11b | us.meta.llama3-2-11b-instruct-v1:0 | ❌ |
|
|
116
|
+
| Llama-3-2-90b | us.meta.llama3-2-90b-instruct-v1:0 | ❌ |
|
|
117
|
+
| Llama-3-1-8b | meta.llama3-1-8b-instruct-v1:0 | ❌ |
|
|
118
|
+
| Llama-3-1-70b | meta.llama3-1-70b-instruct-v1:0 | ❌ |
|
|
119
|
+
| Llama-3-1-405b | meta.llama3-1-405b-instruct-v1:0 | ❌ |
|
|
120
|
+
| Llama-3-8b | meta.llama3-8b-instruct-v1:0 | ❌ |
|
|
121
|
+
| Llama-3-70b | meta.llama3-70b-instruct-v1:0 | ❌ |
|
|
122
|
+
| Mistral-7b | mistral.mistral-7b-instruct-v0:2 | ❌ |
|
|
123
|
+
| Mixtral-8x7b | mistral.mixtral-8x7b-instruct-v0:1 | ❌ |
|
|
124
|
+
| Mistral-Large | mistral.mistral-large-2402-v1:0 | ❌ |
|
|
125
|
+
|
|
121
126
|
To return the list progrmatically you can import and call `listBedrockWrapperSupportedModels`:
|
|
122
127
|
```javascript
|
|
123
128
|
import { listBedrockWrapperSupportedModels } from 'bedrock-wrapper';
|
|
@@ -129,6 +134,54 @@ Please modify the `bedrock_models.js` file and submit a PR 🏆 or create an Iss
|
|
|
129
134
|
|
|
130
135
|
---
|
|
131
136
|
|
|
137
|
+
### Image Support
|
|
138
|
+
|
|
139
|
+
For models with image support (Claude 3.5 Sonnet, Claude 3.7 Sonnet, and Claude 3.7 Sonnet Thinking), you can include images in your messages using the following format:
|
|
140
|
+
|
|
141
|
+
```javascript
|
|
142
|
+
messages = [
|
|
143
|
+
{
|
|
144
|
+
role: "system",
|
|
145
|
+
content: "You are a helpful AI assistant that can analyze images.",
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
role: "user",
|
|
149
|
+
content: [
|
|
150
|
+
{ type: "text", text: "What's in this image?" },
|
|
151
|
+
{
|
|
152
|
+
type: "image_url",
|
|
153
|
+
image_url: {
|
|
154
|
+
url: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEA..." // base64 encoded image
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
You can also use a direct URL to an image instead of base64 encoding:
|
|
163
|
+
|
|
164
|
+
```javascript
|
|
165
|
+
messages = [
|
|
166
|
+
{
|
|
167
|
+
role: "user",
|
|
168
|
+
content: [
|
|
169
|
+
{ type: "text", text: "Describe this image in detail." },
|
|
170
|
+
{
|
|
171
|
+
type: "image_url",
|
|
172
|
+
image_url: {
|
|
173
|
+
url: "https://example.com/path/to/image.jpg" // direct URL to image
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
You can include multiple images in a single message by adding more image_url objects to the content array.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
132
185
|
### 📢 P.S.
|
|
133
186
|
|
|
134
187
|
In case you missed it at the beginning of this doc, for an even easier setup, use the 🔀 [Bedrock Proxy Endpoint](https://github.com/jparkerweb/bedrock-proxy-endpoint) project to spin up your own custom OpenAI server endpoint (using the standard `baseUrl`, and `apiKey` params).
|