bedrock-wrapper 2.7.2 → 2.9.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/AGENTS.md +123 -0
- package/CHANGELOG.md +101 -4
- package/README.md +54 -32
- package/bedrock-models.js +409 -11
- package/bedrock-wrapper.js +22 -6
- package/package.json +2 -2
- package/specs--completed/llama-4-model-support/PLAN-DRAFT-20260108-130000.md +241 -0
- package/test-converse-output.txt +7477 -0
- package/test-final-output.txt +7577 -0
- package/test-run-output.txt +7629 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to AI coding agents like Claude Code (claude.ai/code), Cursor AI, Codex, Gemini CLI, GitHub Copilot, and other AI coding assistants when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Purpose
|
|
6
|
+
|
|
7
|
+
Bedrock Wrapper translates OpenAI-compatible API objects to AWS Bedrock's serverless inference LLMs. It acts as an adapter layer allowing applications using the OpenAI API format to seamlessly call AWS Bedrock models.
|
|
8
|
+
|
|
9
|
+
## Development Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install # Install dependencies
|
|
13
|
+
npm run clean # Clean reinstall (removes node_modules and package-lock.json)
|
|
14
|
+
npm run test # Test all models with both Invoke and Converse APIs
|
|
15
|
+
npm run test:invoke # Test with Invoke API only
|
|
16
|
+
npm run test:converse # Test with Converse API only
|
|
17
|
+
npm run test-vision # Test vision capabilities
|
|
18
|
+
npm run test-stop # Test stop sequences
|
|
19
|
+
npm run interactive # Interactive CLI for testing specific models
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Architecture Overview
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
bedrock-wrapper.js (main entry)
|
|
26
|
+
│
|
|
27
|
+
├── Converse API Path (useConverseAPI: true)
|
|
28
|
+
│ └── Unified format for all models
|
|
29
|
+
│
|
|
30
|
+
└── Invoke API Path (default)
|
|
31
|
+
└── Model-specific request/response handling
|
|
32
|
+
│
|
|
33
|
+
└── bedrock-models.js
|
|
34
|
+
└── Model configurations registry
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Key Functions in bedrock-wrapper.js
|
|
38
|
+
|
|
39
|
+
| Function | Line | Purpose |
|
|
40
|
+
|----------|------|---------|
|
|
41
|
+
| `bedrockWrapper()` | ~501 | Main entry point, async generator |
|
|
42
|
+
| `convertToConverseFormat()` | ~86 | OpenAI messages → Converse API format |
|
|
43
|
+
| `processMessagesForInvoke()` | ~168 | Model-specific message processing |
|
|
44
|
+
| `buildInvokePrompt()` | ~234 | Constructs model-specific prompts |
|
|
45
|
+
| `buildInvokeRequest()` | ~300 | Creates model-specific request objects |
|
|
46
|
+
| `executeInvokeAPI()` | ~409 | Handles streaming and non-streaming |
|
|
47
|
+
| `findAwsModelWithId()` | ~763 | Model lookup by name or ID |
|
|
48
|
+
|
|
49
|
+
### Model Configuration Schema (bedrock-models.js)
|
|
50
|
+
|
|
51
|
+
Each model entry requires:
|
|
52
|
+
- `modelName`: Consumer-facing name (e.g., "Claude-4-5-Sonnet")
|
|
53
|
+
- `modelId`: AWS Bedrock identifier
|
|
54
|
+
- `vision`: Boolean for image support
|
|
55
|
+
- `messages_api`: Boolean (true = structured messages, false = prompt string)
|
|
56
|
+
- `response_chunk_element`: JSON path for streaming response extraction
|
|
57
|
+
- `response_nonchunk_element`: JSON path for non-streaming response
|
|
58
|
+
|
|
59
|
+
### Two API Paths
|
|
60
|
+
|
|
61
|
+
1. **Converse API** (`useConverseAPI: true`): Unified format, handles all models consistently
|
|
62
|
+
2. **Invoke API** (default): Model-specific formatting required
|
|
63
|
+
|
|
64
|
+
Some models (e.g., DeepSeek-V3.1) have `converse_api_only: true` and automatically use the Converse API.
|
|
65
|
+
|
|
66
|
+
## Model Family Patterns
|
|
67
|
+
|
|
68
|
+
| Family | API Type | Special Handling |
|
|
69
|
+
|--------|----------|------------------|
|
|
70
|
+
| Claude | Messages API | Thinking tags: `<think>`, anthropic_version required |
|
|
71
|
+
| Nova | Messages API | Content as array `[{text: content}]`, schemaVersion: "messages-v1" |
|
|
72
|
+
| Llama | Prompt-based | Role tags: `<\|begin_of_text\|>`, `<\|start_header_id\|>` |
|
|
73
|
+
| Mistral | Prompt-based (older) / Messages (v3+) | `[INST]`/`[/INST]` tags for older models |
|
|
74
|
+
| GPT-OSS | Messages API | Reasoning tags: `<reasoning>`, streaming not supported |
|
|
75
|
+
| Qwen | Messages API | Standard messages format |
|
|
76
|
+
| DeepSeek | Messages API | V3.1 requires Converse API only |
|
|
77
|
+
| Gemma | Messages API | Standard messages format with vision |
|
|
78
|
+
| Kimi | Messages API | preserve_reasoning for thinking models |
|
|
79
|
+
|
|
80
|
+
## Adding a New Model
|
|
81
|
+
|
|
82
|
+
1. Add entry to `bedrock_models` array in `bedrock-models.js`
|
|
83
|
+
2. For prompt-based models, define all role prefix/suffix tokens
|
|
84
|
+
3. For vision models, set `vision: true` and add `image_support` config
|
|
85
|
+
4. For thinking models, add `thinking` config in `special_request_schema`
|
|
86
|
+
5. Test with `npm run test` to verify both API paths
|
|
87
|
+
|
|
88
|
+
## Key Implementation Details
|
|
89
|
+
|
|
90
|
+
### Image Processing
|
|
91
|
+
- Uses Sharp library to resize images to max 2048x2048
|
|
92
|
+
- Converts all formats to JPEG for consistency
|
|
93
|
+
- Handles base64, data URLs, and HTTP URLs
|
|
94
|
+
|
|
95
|
+
### Thinking Mode
|
|
96
|
+
- Claude: `<think>` tags, budget_tokens in special_request_schema
|
|
97
|
+
- GPT-OSS: `<reasoning>` tags, preserve_reasoning flag
|
|
98
|
+
- Temperature auto-set to 1.0, budget_tokens constrained to 80% of max_tokens
|
|
99
|
+
|
|
100
|
+
### Stop Sequences
|
|
101
|
+
- Claude: `stop_sequences` (up to 8,191)
|
|
102
|
+
- Nova: `stopSequences` (up to 4)
|
|
103
|
+
- Mistral: `stop` (up to 10)
|
|
104
|
+
- Llama: Not supported by AWS Bedrock
|
|
105
|
+
|
|
106
|
+
## Environment Setup
|
|
107
|
+
|
|
108
|
+
Create `.env` file:
|
|
109
|
+
```
|
|
110
|
+
AWS_REGION=us-west-2
|
|
111
|
+
AWS_ACCESS_KEY_ID=your_key
|
|
112
|
+
AWS_SECRET_ACCESS_KEY=your_secret
|
|
113
|
+
LLM_MAX_GEN_TOKENS=1024
|
|
114
|
+
LLM_TEMPERATURE=0.2
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Test Output Files
|
|
118
|
+
|
|
119
|
+
After running tests, check these files for results:
|
|
120
|
+
- `test-models-output.txt`
|
|
121
|
+
- `test-vision-models-output.txt`
|
|
122
|
+
- `test-stop-sequences-output.txt`
|
|
123
|
+
- `test-converse-api-output.txt`
|
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,63 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
|
|
2
3
|
All notable changes to this project will be documented in this file.
|
|
3
4
|
|
|
5
|
+
## [2.9.0] - 2026-01-08 (Llama 4 Models)
|
|
6
|
+
|
|
7
|
+
### ✨ Added
|
|
8
|
+
|
|
9
|
+
- Support for Llama 4 Scout and Maverick models
|
|
10
|
+
- Llama-4-Scout-17b (vision support, 2K max output tokens)
|
|
11
|
+
- Llama-4-Maverick-17b (vision support, 2K max output tokens)
|
|
12
|
+
- First Llama models with multimodal/vision capabilities in this wrapper
|
|
13
|
+
- Cross-region inference profile IDs (us.meta.llama4-*)
|
|
14
|
+
|
|
15
|
+
### ⚙️ Technical Details
|
|
16
|
+
|
|
17
|
+
- **Vision Support**: Both models support image inputs (first Llama models with vision)
|
|
18
|
+
- **API Compatibility**: Both Invoke API and Converse API paths supported
|
|
19
|
+
- **Streaming**: Full streaming and non-streaming support
|
|
20
|
+
- **Stop Sequences**: Not supported (AWS Bedrock limitation for all Llama models)
|
|
21
|
+
|
|
22
|
+
## [2.8.0] - 2025-12-05 (New Models: Claude Opus 4.5, Gemma, Kimi, MiniMax, Mistral, Nova)
|
|
23
|
+
|
|
24
|
+
### ✨ Added
|
|
25
|
+
|
|
26
|
+
- Support for Claude Opus 4.5 models
|
|
27
|
+
- Claude-4-5-Opus (128K max output tokens, vision support)
|
|
28
|
+
- Claude-4-5-Opus-Thinking (with extended thinking capabilities)
|
|
29
|
+
- Support for Amazon Nova 2 Lite model
|
|
30
|
+
- Nova-2-Lite (vision support, 5K max output tokens)
|
|
31
|
+
- Support for Qwen3 Next model
|
|
32
|
+
- Qwen3-Next-80B-A3B (MoE architecture, 32K max output tokens)
|
|
33
|
+
- Support for new Mistral models (Converse API)
|
|
34
|
+
- Mistral-Large-3 (675B parameters, vision support, 32K max output tokens)
|
|
35
|
+
- Ministral-3-3b (vision support, 8K max output tokens)
|
|
36
|
+
- Ministral-3-8b (vision support, 8K max output tokens)
|
|
37
|
+
- Ministral-3-14b (vision support, 16K max output tokens)
|
|
38
|
+
- Magistral-Small-2509 (text-only, 8K max output tokens)
|
|
39
|
+
- Support for Google Gemma 3 models (new provider)
|
|
40
|
+
- Gemma-3-4b (vision support, 8K max output tokens)
|
|
41
|
+
- Gemma-3-12b (vision support, 8K max output tokens)
|
|
42
|
+
- Gemma-3-27b (vision support, 8K max output tokens)
|
|
43
|
+
- Support for Moonshot AI Kimi K2 models (new provider)
|
|
44
|
+
- Kimi-K2 (1T total parameters, 32B active MoE, 32K max output tokens)
|
|
45
|
+
- Kimi-K2-Thinking (with reasoning tag preservation)
|
|
46
|
+
- Support for MiniMax M2 model (new provider)
|
|
47
|
+
- MiniMax-M2 (230B total parameters, 10B active MoE, 32K max output tokens)
|
|
48
|
+
|
|
49
|
+
### ⚙️ Technical Details
|
|
50
|
+
|
|
51
|
+
- **New Model Families**: Google Gemma, Moonshot AI Kimi, MiniMax
|
|
52
|
+
- **Vision Support**: All Gemma 3 models, Mistral-Large-3, Ministral 3 series, Nova-2-Lite
|
|
53
|
+
- **Thinking Mode**: Kimi-K2-Thinking uses `preserve_reasoning: true` for reasoning tag preservation
|
|
54
|
+
- **API Compatibility**: All new models use Converse API (`messages_api: true`)
|
|
55
|
+
- **New Mistral Models**: Unlike older Mistral models (Invoke API), new models use Converse API
|
|
56
|
+
|
|
4
57
|
## [2.7.0] - 2025-11-18 (DeepSeek & Qwen 3)
|
|
58
|
+
|
|
5
59
|
### ✨ Added
|
|
60
|
+
|
|
6
61
|
- Support for DeepSeek foundation models
|
|
7
62
|
- DeepSeek-R1 (reasoning model with chain-of-thought capabilities, 8K max output tokens)
|
|
8
63
|
- DeepSeek-V3.1 (hybrid thinking mode for complex reasoning, 8K max output tokens, **Converse API only**)
|
|
@@ -21,10 +76,12 @@ All notable changes to this project will be documented in this file.
|
|
|
21
76
|
- Repository-scale code analysis capabilities for Qwen Coder models
|
|
22
77
|
|
|
23
78
|
### 🤬 Breaking Changes
|
|
79
|
+
|
|
24
80
|
- Removed `top_p` parameter from all models as it is not fully supported by AWS Bedrock
|
|
25
81
|
- `temperature` should always be used instead
|
|
26
82
|
|
|
27
83
|
### ⚙️ Technical Details
|
|
84
|
+
|
|
28
85
|
- **Model Configuration**: All new models use messages API format (OpenAI-compatible)
|
|
29
86
|
- **API Compatibility**:
|
|
30
87
|
- Qwen 3 models: Support both Invoke API and Converse API
|
|
@@ -32,7 +89,9 @@ All notable changes to this project will be documented in this file.
|
|
|
32
89
|
- DeepSeek-V3.1: Converse API only (automatically enforced)
|
|
33
90
|
|
|
34
91
|
## [2.6.2] - 2025-10-16 (Claude Haiku 4.5)
|
|
92
|
+
|
|
35
93
|
### ✨ Added
|
|
94
|
+
|
|
36
95
|
- Support for Claude Haiku 4.5 models
|
|
37
96
|
- Claude-4-5-Haiku
|
|
38
97
|
- Claude-4-5-Haiku-Thinking
|
|
@@ -42,16 +101,21 @@ All notable changes to this project will be documented in this file.
|
|
|
42
101
|
- Temperature/Top-P mutual exclusion parameter handling for Haiku 4.5 models
|
|
43
102
|
|
|
44
103
|
## [2.6.1] - 2025-09-30 (Claude Sonnet 4.5)
|
|
104
|
+
|
|
45
105
|
### ✨ Added
|
|
106
|
+
|
|
46
107
|
- Support for Claude Sonnet 4.5 models
|
|
47
108
|
- Claude-4-5-Sonnet
|
|
48
109
|
- Claude-4-5-Sonnet-Thinking
|
|
49
110
|
|
|
50
111
|
## [2.5.0] - 2025-08-12 (Converse API)
|
|
112
|
+
|
|
51
113
|
### ✨ Added
|
|
114
|
+
|
|
52
115
|
- Support for Converse API (streaming and non-streaming)
|
|
53
116
|
|
|
54
117
|
### ⚙️ Technical Details
|
|
118
|
+
|
|
55
119
|
- **Model Configuration**: All models use standard messages API format
|
|
56
120
|
- **API Compatibility**: Supports OpenAI-style requests
|
|
57
121
|
- **Response Processing**: Automatic reasoning tag handling based on model variant
|
|
@@ -59,7 +123,9 @@ All notable changes to this project will be documented in this file.
|
|
|
59
123
|
- **Testing Coverage**: Full integration with existing test suites and interactive example
|
|
60
124
|
|
|
61
125
|
## [2.4.5] - 2025-08-06 (GPT-OSS Models)
|
|
126
|
+
|
|
62
127
|
### ✨ Added
|
|
128
|
+
|
|
63
129
|
- Support for OpenAI GPT-OSS models on AWS Bedrock
|
|
64
130
|
- GPT-OSS-120B (120B parameter open weight model)
|
|
65
131
|
- GPT-OSS-20B (20B parameter open weight model)
|
|
@@ -72,6 +138,7 @@ All notable changes to this project will be documented in this file.
|
|
|
72
138
|
- OpenAI-compatible API format with `max_completion_tokens` parameter
|
|
73
139
|
|
|
74
140
|
### ⚙️ Technical Details
|
|
141
|
+
|
|
75
142
|
- **Model Configuration**: All GPT-OSS models use standard messages API format
|
|
76
143
|
- **API Compatibility**: Supports OpenAI-style requests with Apache 2.0 licensed models
|
|
77
144
|
- **Response Processing**: Automatic reasoning tag handling based on model variant
|
|
@@ -79,13 +146,17 @@ All notable changes to this project will be documented in this file.
|
|
|
79
146
|
- **Testing Coverage**: Full integration with existing test suites and interactive example
|
|
80
147
|
|
|
81
148
|
## [2.4.4] - 2025-08-05 (Claude 4.1 Opus)
|
|
149
|
+
|
|
82
150
|
### ✨ Added
|
|
151
|
+
|
|
83
152
|
- Support for Claude 4.1 Opus models
|
|
84
153
|
- Claude-4-1-Opus
|
|
85
154
|
- Claude-4-1-Opus-Thinking
|
|
86
155
|
|
|
87
156
|
## [2.4.3] - 2025-07-31 (Stop Sequences Fixes)
|
|
157
|
+
|
|
88
158
|
### 🛠️ Fixed
|
|
159
|
+
|
|
89
160
|
- **Critical Discovery**: Removed stop sequences support from Llama models
|
|
90
161
|
- AWS Bedrock does not support stop sequences for Llama models (confirmed via official AWS documentation)
|
|
91
162
|
- Llama models only support: `prompt`, `temperature`, `top_p`, `max_gen_len`, `images`
|
|
@@ -95,24 +166,28 @@ All notable changes to this project will be documented in this file.
|
|
|
95
166
|
- Improved error handling for empty responses when stop sequences trigger early
|
|
96
167
|
|
|
97
168
|
### 📝 Updated
|
|
169
|
+
|
|
98
170
|
- **Documentation corrections**
|
|
99
171
|
- Corrected stop sequences support claims (removed "all models support" language)
|
|
100
172
|
- Added accurate model-specific support matrix with sequence limits
|
|
101
173
|
- Added comprehensive stop sequences support table with AWS documentation references
|
|
102
174
|
- **Model Support Matrix** now clearly documented:
|
|
103
|
-
- ✅ Claude models: Full support (up to 8,191 sequences)
|
|
175
|
+
- ✅ Claude models: Full support (up to 8,191 sequences)
|
|
104
176
|
- ✅ Nova models: Full support (up to 4 sequences)
|
|
105
177
|
- ✅ Mistral models: Full support (up to 10 sequences)
|
|
106
178
|
- ❌ Llama models: Not supported (AWS Bedrock limitation)
|
|
107
179
|
|
|
108
180
|
### ⚙️ Technical Details
|
|
181
|
+
|
|
109
182
|
- Based on comprehensive research of official AWS Bedrock documentation
|
|
110
183
|
- All changes maintain full backward compatibility
|
|
111
184
|
- Test results show significant improvements in stop sequences reliability for supported models
|
|
112
185
|
- Added detailed explanations to help users understand AWS Bedrock's actual capabilities
|
|
113
186
|
|
|
114
187
|
## [2.4.2] - 2025-07-31 (Stop Sequences Support)
|
|
188
|
+
|
|
115
189
|
### ✨ Added
|
|
190
|
+
|
|
116
191
|
- Stop sequences support for compatible models
|
|
117
192
|
- OpenAI-compatible `stop` and `stop_sequences` parameters
|
|
118
193
|
- Automatic string-to-array conversion for compatibility
|
|
@@ -121,6 +196,7 @@ All notable changes to this project will be documented in this file.
|
|
|
121
196
|
- Comprehensive stop sequences testing and validation with `npm run test-stop`
|
|
122
197
|
|
|
123
198
|
### 🛠️ Fixed
|
|
199
|
+
|
|
124
200
|
- **Critical Discovery**: Removed stop sequences support from Llama models
|
|
125
201
|
- AWS Bedrock does not support stop sequences for Llama models (confirmed via official documentation)
|
|
126
202
|
- Llama models only support: `prompt`, `temperature`, `top_p`, `max_gen_len`, `images`
|
|
@@ -129,6 +205,7 @@ All notable changes to this project will be documented in this file.
|
|
|
129
205
|
- Improved error handling for empty responses when stop sequences trigger early
|
|
130
206
|
|
|
131
207
|
### ⚙️ Technical Details
|
|
208
|
+
|
|
132
209
|
- **Model Support Matrix**:
|
|
133
210
|
- ✅ Claude models: Full support (up to 8,191 sequences)
|
|
134
211
|
- ✅ Nova models: Full support (up to 4 sequences)
|
|
@@ -140,7 +217,9 @@ All notable changes to this project will be documented in this file.
|
|
|
140
217
|
- Added comprehensive documentation in README.md and CLAUDE.md explaining support limitations
|
|
141
218
|
|
|
142
219
|
## [2.4.0] - 2025-07-24 (AWS Nova Models)
|
|
220
|
+
|
|
143
221
|
### ✨ Added
|
|
222
|
+
|
|
144
223
|
- Support for AWS Nova models
|
|
145
224
|
- Nova-Pro (300K context, multimodal, 5K output tokens)
|
|
146
225
|
- Nova-Lite (300K context, multimodal, optimized for speed)
|
|
@@ -150,7 +229,9 @@ All notable changes to this project will be documented in this file.
|
|
|
150
229
|
- Automatic content array formatting for Nova message compatibility
|
|
151
230
|
|
|
152
231
|
## [2.3.1] - 2025-05-22 (Claude 4 Opus / Sonnet)
|
|
232
|
+
|
|
153
233
|
### ✨ Added
|
|
234
|
+
|
|
154
235
|
- Support for Claude 4 Opus & Claude 4 Sonnet models
|
|
155
236
|
- Claude-4-Opus
|
|
156
237
|
- Claude-4-Opus-Thinking
|
|
@@ -158,7 +239,9 @@ All notable changes to this project will be documented in this file.
|
|
|
158
239
|
- Claude-4-Sonnet-Thinking
|
|
159
240
|
|
|
160
241
|
## [2.3.0] - 2025-02-15 (Claude 3.7 & Image Support)
|
|
242
|
+
|
|
161
243
|
### ✨ Added
|
|
244
|
+
|
|
162
245
|
- Support for Claude 3.7 models
|
|
163
246
|
- Claude-3-7-Sonnet
|
|
164
247
|
- Claude-3-7-Sonnet-Thinking
|
|
@@ -171,29 +254,37 @@ All notable changes to this project will be documented in this file.
|
|
|
171
254
|
- Documentation for image support usage
|
|
172
255
|
|
|
173
256
|
### 🔄 Changed
|
|
257
|
+
|
|
174
258
|
- Updated model configuration for image-capable models
|
|
175
259
|
- Improved response handling for multimodal inputs
|
|
176
260
|
|
|
177
261
|
## [2.2.0] - 2025-01-01 (Llama 3.3 70b)
|
|
262
|
+
|
|
178
263
|
### ✨ Added
|
|
264
|
+
|
|
179
265
|
- Support for Llama 3.3 70b
|
|
180
266
|
|
|
181
267
|
## [2.1.0] - 2024-11-21 (Claude 3.5 Haiku)
|
|
268
|
+
|
|
182
269
|
### ✨ Added
|
|
270
|
+
|
|
183
271
|
- Support for Claude 3.5 Haiku
|
|
184
272
|
|
|
185
273
|
## [2.0.0] - 2024-10-31 (Claude Sonnet & Haiku)
|
|
274
|
+
|
|
186
275
|
### ✨ Added
|
|
276
|
+
|
|
187
277
|
- Support for Anthropic Sonnet & Haiku models
|
|
188
278
|
- Claude-3-5-Sonnet-v2
|
|
189
279
|
- Claude-3-5-Sonnet
|
|
190
280
|
- Claude-3-Haiku
|
|
191
281
|
- Interactive example script for testing models
|
|
192
282
|
- Testing script with streaming and non-streaming support for all models
|
|
193
|
-
- Stardardize output to be a string via Streamed and non-Streamed responses
|
|
283
|
+
- Stardardize output to be a string via Streamed and non-Streamed responses
|
|
194
284
|
> **NOTE:** This is a breaking change for previous non-streaming responses. Existing streaming responses will remain unchanged.
|
|
195
285
|
|
|
196
286
|
### 🔄 Changed
|
|
287
|
+
|
|
197
288
|
- Complete architecture overhaul for better model support
|
|
198
289
|
- Improved message handling with role-based formatting
|
|
199
290
|
- Enhanced error handling and response processing
|
|
@@ -201,6 +292,7 @@ All notable changes to this project will be documented in this file.
|
|
|
201
292
|
- Updated AWS SDK integration
|
|
202
293
|
|
|
203
294
|
### ⚙️ Technical Details
|
|
295
|
+
|
|
204
296
|
- Implemented messages API support for compatible models
|
|
205
297
|
- Added system message handling as separate field where supported
|
|
206
298
|
- Configurable token limits per model
|
|
@@ -208,7 +300,9 @@ All notable changes to this project will be documented in this file.
|
|
|
208
300
|
- Cross-region profile support for certain models
|
|
209
301
|
|
|
210
302
|
## [1.3.0] - 2024-07-24 (Llama3.2)
|
|
303
|
+
|
|
211
304
|
### ✨ Added
|
|
305
|
+
|
|
212
306
|
- Support for Llama 3.2 series models
|
|
213
307
|
- Llama-3-2-1b
|
|
214
308
|
- Llama-3-2-3b
|
|
@@ -216,18 +310,21 @@ All notable changes to this project will be documented in this file.
|
|
|
216
310
|
- Llama-3-2-90b
|
|
217
311
|
|
|
218
312
|
## [1.1.0] - 2024-07-24 (Llama3.1)
|
|
313
|
+
|
|
219
314
|
### ✨ Added
|
|
315
|
+
|
|
220
316
|
- Support for Llama 3.1 series models
|
|
221
317
|
- Llama-3-1-8b
|
|
222
318
|
- Llama-3-1-70b
|
|
223
319
|
|
|
224
|
-
|
|
225
320
|
## [1.0.14] - 2024-05-06 (Initial Stable Release)
|
|
321
|
+
|
|
226
322
|
### ✨ Added
|
|
323
|
+
|
|
227
324
|
- Initial stablerelease of Bedrock Wrapper
|
|
228
325
|
- Basic AWS Bedrock integration
|
|
229
326
|
- OpenAI-compatible API object support
|
|
230
|
-
- Basic model support
|
|
327
|
+
- Basic model support
|
|
231
328
|
- Llama-3-8b
|
|
232
329
|
- Llama-3-70b
|
|
233
330
|
- Mistral-7b
|
package/README.md
CHANGED
|
@@ -122,43 +122,59 @@ Bedrock Wrapper is an npm package that simplifies the integration of existing Op
|
|
|
122
122
|
|
|
123
123
|
### Supported Models
|
|
124
124
|
|
|
125
|
-
| modelName | AWS Model Id
|
|
126
|
-
|
|
127
|
-
| Claude-3-5-Haiku | anthropic.claude-3-5-haiku-20241022-v1:0 | ❌ |
|
|
128
|
-
| Claude-3-5-Sonnet | anthropic.claude-3-5-sonnet-20240620-v1:0 | ✅ |
|
|
129
|
-
| Claude-3-5-Sonnet-v2 | anthropic.claude-3-5-sonnet-20241022-v2:0 | ✅ |
|
|
130
|
-
| Claude-3-7-Sonnet | us.anthropic.claude-3-7-sonnet-20250219-v1:0
|
|
131
|
-
| Claude-3-7-Sonnet-Thinking | us.anthropic.claude-3-7-sonnet-20250219-v1:0
|
|
132
|
-
| Claude-3-Haiku | anthropic.claude-3-haiku-20240307-v1:0 | ✅ |
|
|
133
|
-
| Claude-4-Opus | us.anthropic.claude-opus-4-20250514-v1:0
|
|
134
|
-
| Claude-4-Opus-Thinking | us.anthropic.claude-opus-4-20250514-v1:0
|
|
135
|
-
| Claude-4-Sonnet | us.anthropic.claude-sonnet-4-20250514-v1:0
|
|
136
|
-
| Claude-4-Sonnet-Thinking | us.anthropic.claude-sonnet-4-20250514-v1:0
|
|
137
|
-
| Claude-4-1-Opus | us.anthropic.claude-opus-4-1-20250805-v1:0
|
|
138
|
-
| Claude-4-1-Opus-Thinking | us.anthropic.claude-opus-4-1-20250805-v1:0
|
|
139
|
-
| Claude-4-5-Haiku |
|
|
140
|
-
| Claude-4-5-Haiku-Thinking |
|
|
141
|
-
| Claude-4-5-
|
|
142
|
-
| Claude-4-5-
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
|
|
|
148
|
-
|
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
|
|
|
153
|
-
|
|
|
125
|
+
| modelName | AWS Model Id | Image |
|
|
126
|
+
|----------------------------|-------------------------------------------------|-------|
|
|
127
|
+
| Claude-3-5-Haiku | us.anthropic.claude-3-5-haiku-20241022-v1:0 | ❌ |
|
|
128
|
+
| Claude-3-5-Sonnet | us.anthropic.claude-3-5-sonnet-20240620-v1:0 | ✅ |
|
|
129
|
+
| Claude-3-5-Sonnet-v2 | us.anthropic.claude-3-5-sonnet-20241022-v2:0 | ✅ |
|
|
130
|
+
| Claude-3-7-Sonnet | us.anthropic.claude-3-7-sonnet-20250219-v1:0 | ✅ |
|
|
131
|
+
| Claude-3-7-Sonnet-Thinking | us.anthropic.claude-3-7-sonnet-20250219-v1:0 | ✅ |
|
|
132
|
+
| Claude-3-Haiku | us.anthropic.claude-3-haiku-20240307-v1:0 | ✅ |
|
|
133
|
+
| Claude-4-Opus | us.anthropic.claude-opus-4-20250514-v1:0 | ✅ |
|
|
134
|
+
| Claude-4-Opus-Thinking | us.anthropic.claude-opus-4-20250514-v1:0 | ✅ |
|
|
135
|
+
| Claude-4-Sonnet | us.anthropic.claude-sonnet-4-20250514-v1:0 | ✅ |
|
|
136
|
+
| Claude-4-Sonnet-Thinking | us.anthropic.claude-sonnet-4-20250514-v1:0 | ✅ |
|
|
137
|
+
| Claude-4-1-Opus | us.anthropic.claude-opus-4-1-20250805-v1:0 | ✅ |
|
|
138
|
+
| Claude-4-1-Opus-Thinking | us.anthropic.claude-opus-4-1-20250805-v1:0 | ✅ |
|
|
139
|
+
| Claude-4-5-Haiku | global.anthropic.claude-haiku-4-5-20251001-v1:0 | ✅ |
|
|
140
|
+
| Claude-4-5-Haiku-Thinking | global.anthropic.claude-haiku-4-5-20251001-v1:0 | ✅ |
|
|
141
|
+
| Claude-4-5-Opus | global.anthropic.claude-opus-4-5-20251101-v1:0 | ✅ |
|
|
142
|
+
| Claude-4-5-Opus-Thinking | global.anthropic.claude-opus-4-5-20251101-v1:0 | ✅ |
|
|
143
|
+
| Claude-4-5-Sonnet | us.anthropic.claude-sonnet-4-5-20250929-v1:0 | ✅ |
|
|
144
|
+
| Claude-4-5-Sonnet-Thinking | us.anthropic.claude-sonnet-4-5-20250929-v1:0 | ✅ |
|
|
145
|
+
| DeepSeek-R1 | us.deepseek.r1-v1:0 | ❌ |
|
|
146
|
+
| DeepSeek-V3.1 | deepseek.v3-v1:0 | ❌ |
|
|
147
|
+
| Gemma-3-4b | google.gemma-3-4b-it | ✅ |
|
|
148
|
+
| Gemma-3-12b | google.gemma-3-12b-it | ✅ |
|
|
149
|
+
| Gemma-3-27b | google.gemma-3-27b-it | ✅ |
|
|
150
|
+
| GPT-OSS-120B | openai.gpt-oss-120b-1:0 | ❌ |
|
|
151
|
+
| GPT-OSS-120B-Thinking | openai.gpt-oss-120b-1:0 | ❌ |
|
|
152
|
+
| GPT-OSS-20B | openai.gpt-oss-20b-1:0 | ❌ |
|
|
153
|
+
| GPT-OSS-20B-Thinking | openai.gpt-oss-20b-1:0 | ❌ |
|
|
154
|
+
| Kimi-K2 | moonshot.kimi-k2-thinking | ❌ |
|
|
155
|
+
| Kimi-K2-Thinking | moonshot.kimi-k2-thinking | ❌ |
|
|
156
|
+
| Llama-3-8b | meta.llama3-8b-instruct-v1:0 | ❌ |
|
|
157
|
+
| Llama-3-70b | meta.llama3-70b-instruct-v1:0 | ❌ |
|
|
158
|
+
| Llama-3-1-8b | us.meta.llama3-1-8b-instruct-v1:0 | ❌ |
|
|
159
|
+
| Llama-3-1-70b | us.meta.llama3-1-70b-instruct-v1:0 | ❌ |
|
|
160
|
+
| Llama-3-1-405b | meta.llama3-1-405b-instruct-v1:0 | ❌ |
|
|
154
161
|
| Llama-3-2-1b | us.meta.llama3-2-1b-instruct-v1:0 | ❌ |
|
|
155
162
|
| Llama-3-2-3b | us.meta.llama3-2-3b-instruct-v1:0 | ❌ |
|
|
156
163
|
| Llama-3-2-11b | us.meta.llama3-2-11b-instruct-v1:0 | ❌ |
|
|
157
164
|
| Llama-3-2-90b | us.meta.llama3-2-90b-instruct-v1:0 | ❌ |
|
|
158
165
|
| Llama-3-3-70b | us.meta.llama3-3-70b-instruct-v1:0 | ❌ |
|
|
166
|
+
| Llama-4-Scout-17b | us.meta.llama4-scout-17b-instruct-v1:0 | ✅ |
|
|
167
|
+
| Llama-4-Maverick-17b | us.meta.llama4-maverick-17b-instruct-v1:0 | ✅ |
|
|
168
|
+
| Magistral-Small-2509 | mistral.magistral-small-2509 | ❌ |
|
|
169
|
+
| MiniMax-M2 | minimax.minimax-m2 | ❌ |
|
|
170
|
+
| Ministral-3-3b | mistral.ministral-3-3b-instruct | ✅ |
|
|
171
|
+
| Ministral-3-8b | mistral.ministral-3-8b-instruct | ✅ |
|
|
172
|
+
| Ministral-3-14b | mistral.ministral-3-14b-instruct | ✅ |
|
|
159
173
|
| Mistral-7b | mistral.mistral-7b-instruct-v0:2 | ❌ |
|
|
160
|
-
| Mixtral-8x7b | mistral.mixtral-8x7b-instruct-v0:1 | ❌ |
|
|
161
174
|
| Mistral-Large | mistral.mistral-large-2402-v1:0 | ❌ |
|
|
175
|
+
| Mistral-Large-3 | mistral.mistral-large-3-675b-instruct | ✅ |
|
|
176
|
+
| Mixtral-8x7b | mistral.mixtral-8x7b-instruct-v0:1 | ❌ |
|
|
177
|
+
| Nova-2-Lite | us.amazon.nova-2-lite-v1:0 | ✅ |
|
|
162
178
|
| Nova-Micro | us.amazon.nova-micro-v1:0 | ❌ |
|
|
163
179
|
| Nova-Lite | us.amazon.nova-lite-v1:0 | ✅ |
|
|
164
180
|
| Nova-Pro | us.amazon.nova-pro-v1:0 | ✅ |
|
|
@@ -166,6 +182,7 @@ Bedrock Wrapper is an npm package that simplifies the integration of existing Op
|
|
|
166
182
|
| Qwen3-235B-A22B-2507 | qwen.qwen3-235b-a22b-2507-v1:0 | ❌ |
|
|
167
183
|
| Qwen3-Coder-30B-A3B | qwen.qwen3-coder-30b-a3b-v1:0 | ❌ |
|
|
168
184
|
| Qwen3-Coder-480B-A35B | qwen.qwen3-coder-480b-a35b-v1:0 | ❌ |
|
|
185
|
+
| Qwen3-Next-80B-A3B | qwen.qwen3-next-80b-a3b | ❌ |
|
|
169
186
|
|
|
170
187
|
To return the list progrmatically you can import and call `listBedrockWrapperSupportedModels`:
|
|
171
188
|
```javascript
|
|
@@ -181,8 +198,9 @@ Please modify the `bedrock_models.js` file and submit a PR 🏆 or create an Iss
|
|
|
181
198
|
### Thinking Models
|
|
182
199
|
|
|
183
200
|
Some models support extended reasoning capabilities through "thinking mode". These models include:
|
|
184
|
-
- **Claude models**: Claude-4-1-Opus-Thinking, Claude-4-Opus-Thinking, Claude-4-5-Sonnet-Thinking, Claude-4-5-Haiku-Thinking, Claude-4-Sonnet-Thinking, Claude-3-7-Sonnet-Thinking
|
|
201
|
+
- **Claude models**: Claude-4-5-Opus-Thinking, Claude-4-1-Opus-Thinking, Claude-4-Opus-Thinking, Claude-4-5-Sonnet-Thinking, Claude-4-5-Haiku-Thinking, Claude-4-Sonnet-Thinking, Claude-3-7-Sonnet-Thinking
|
|
185
202
|
- **GPT-OSS models**: GPT-OSS-120B-Thinking, GPT-OSS-20B-Thinking
|
|
203
|
+
- **Kimi models**: Kimi-K2-Thinking (preserves reasoning tags in output)
|
|
186
204
|
|
|
187
205
|
To use thinking mode and see the model's reasoning process, set `include_thinking_data: true` in your request:
|
|
188
206
|
|
|
@@ -213,7 +231,7 @@ for await (const chunk of bedrockWrapper(awsCreds, openaiChatCompletionsCreateOb
|
|
|
213
231
|
|
|
214
232
|
### Image Support
|
|
215
233
|
|
|
216
|
-
For models with image support (Claude 4+ series including Claude 4.5 Sonnet, Claude 4.5 Haiku, Claude 3.7 Sonnet, Claude 3.5 Sonnet, Claude 3 Haiku, Nova Pro,
|
|
234
|
+
For models with image support (Claude 4+ series including Claude 4.5 Opus, Claude 4.5 Sonnet, Claude 4.5 Haiku, Claude 3.7 Sonnet, Claude 3.5 Sonnet, Claude 3 Haiku, Nova Pro, Nova Lite, Nova 2 Lite, Mistral Large 3, Ministral 3 series, Gemma 3 series, and Llama 4 series), you can include images in your messages using the following format (not all models support system prompts):
|
|
217
235
|
|
|
218
236
|
```javascript
|
|
219
237
|
messages = [
|
|
@@ -280,6 +298,9 @@ const openaiChatCompletionsCreateObject = {
|
|
|
280
298
|
- ✅ **GPT-OSS models**: Fully supported
|
|
281
299
|
- ✅ **Mistral models**: Fully supported (up to 10 sequences)
|
|
282
300
|
- ✅ **Qwen models**: Fully supported
|
|
301
|
+
- ✅ **Gemma models**: Fully supported
|
|
302
|
+
- ✅ **Kimi models**: Fully supported
|
|
303
|
+
- ✅ **MiniMax models**: Fully supported
|
|
283
304
|
- ❌ **Llama models**: Not supported (AWS Bedrock limitation)
|
|
284
305
|
|
|
285
306
|
**Features:**
|
|
@@ -310,6 +331,7 @@ Some AWS Bedrock models have specific parameter restrictions that are automatica
|
|
|
310
331
|
#### Claude 4+ Models (Temperature/Top-P Mutual Exclusion)
|
|
311
332
|
|
|
312
333
|
**Affected Models:**
|
|
334
|
+
- Claude-4-5-Opus & Claude-4-5-Opus-Thinking
|
|
313
335
|
- Claude-4-5-Sonnet & Claude-4-5-Sonnet-Thinking
|
|
314
336
|
- Claude-4-5-Haiku & Claude-4-5-Haiku-Thinking
|
|
315
337
|
- Claude-4-Sonnet & Claude-4-Sonnet-Thinking
|