converse-mcp-server 2.22.3 → 2.22.5
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/LICENSE +18 -18
- package/docs/ALTERNATIVE_PROVIDERS.md +449 -449
- package/docs/ARCHITECTURE.md +551 -551
- package/package.json +5 -5
|
@@ -1,450 +1,450 @@
|
|
|
1
|
-
# Alternative Cloud Provider Integrations for Converse MCP Server
|
|
2
|
-
|
|
3
|
-
This document outlines alternative API providers for each AI provider currently supported in the Converse MCP Server, along with implementation requirements for adding support.
|
|
4
|
-
|
|
5
|
-
## Table of Contents
|
|
6
|
-
- [Anthropic](#anthropic)
|
|
7
|
-
- [AWS Bedrock](#aws-bedrock)
|
|
8
|
-
- [Google Vertex AI](#google-vertex-ai)
|
|
9
|
-
- [OpenAI](#openai)
|
|
10
|
-
- [Azure OpenAI Service](#azure-openai-service)
|
|
11
|
-
- [Google](#google)
|
|
12
|
-
- [Vertex AI Platform](#vertex-ai-platform)
|
|
13
|
-
- [DeepSeek](#deepseek)
|
|
14
|
-
- [AWS Bedrock](#aws-bedrock-1)
|
|
15
|
-
- [Azure AI Foundry](#azure-ai-foundry)
|
|
16
|
-
- [Mistral AI](#mistral-ai)
|
|
17
|
-
- [AWS Bedrock](#aws-bedrock-2)
|
|
18
|
-
- [Azure AI](#azure-ai)
|
|
19
|
-
- [Google Vertex AI](#google-vertex-ai-1)
|
|
20
|
-
- [XAI (Grok)](#xai-grok)
|
|
21
|
-
- [Azure AI Foundry](#azure-ai-foundry-1)
|
|
22
|
-
- [Implementation Strategy](#implementation-strategy)
|
|
23
|
-
|
|
24
|
-
## Anthropic
|
|
25
|
-
|
|
26
|
-
### AWS Bedrock
|
|
27
|
-
|
|
28
|
-
**Status**: Available and fully managed
|
|
29
|
-
|
|
30
|
-
**Key Features**:
|
|
31
|
-
- Anthropic's client SDKs support Bedrock directly
|
|
32
|
-
- Models available: Claude Opus 4, Claude Sonnet 4, and earlier versions
|
|
33
|
-
- 200,000 token context window
|
|
34
|
-
- 60-minute timeout for inference calls
|
|
35
|
-
- Supports both Messages API and Text Completions API
|
|
36
|
-
|
|
37
|
-
**Implementation Requirements**:
|
|
38
|
-
```javascript
|
|
39
|
-
// Using Anthropic Bedrock SDK
|
|
40
|
-
import AnthropicBedrock from '@anthropic-ai/bedrock-sdk';
|
|
41
|
-
|
|
42
|
-
const client = new AnthropicBedrock({
|
|
43
|
-
awsAccessKey: process.env.AWS_ACCESS_KEY,
|
|
44
|
-
awsSecretKey: process.env.AWS_SECRET_KEY,
|
|
45
|
-
awsRegion: 'us-west-2',
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
// Alternative: Using AWS SDK directly
|
|
49
|
-
import { BedrockRuntimeClient, InvokeModelCommand } from '@aws-sdk/client-bedrock-runtime';
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
**Configuration Needed**:
|
|
53
|
-
- AWS credentials (access key, secret key)
|
|
54
|
-
- AWS region selection
|
|
55
|
-
- Model ID mapping (e.g., `anthropic.claude-opus-4-1-20250805-v1:0`)
|
|
56
|
-
- Timeout adjustments (default AWS SDK timeout is 1 minute, needs to be increased to 60 minutes)
|
|
57
|
-
|
|
58
|
-
### Google Vertex AI
|
|
59
|
-
|
|
60
|
-
**Status**: Available with FedRAMP High and IL-2 authorization (as of June 2025)
|
|
61
|
-
|
|
62
|
-
**Key Features**:
|
|
63
|
-
- Fully managed, serverless infrastructure
|
|
64
|
-
- Supports Claude Opus 4, Claude Sonnet 3.7, and other models
|
|
65
|
-
- Integration with Google Cloud services
|
|
66
|
-
- Claude Code integration for agent development
|
|
67
|
-
- Pay-as-you-go or provisioned throughput pricing
|
|
68
|
-
|
|
69
|
-
**Implementation Requirements**:
|
|
70
|
-
```javascript
|
|
71
|
-
// Using Anthropic Vertex SDK
|
|
72
|
-
import { AnthropicVertex } from '@anthropic-ai/vertex-sdk';
|
|
73
|
-
|
|
74
|
-
const client = new AnthropicVertex({
|
|
75
|
-
region: 'us-central1',
|
|
76
|
-
projectId: 'my-project-id',
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
// Alternative: With custom GoogleAuth
|
|
80
|
-
import { GoogleAuth } from 'google-auth-library';
|
|
81
|
-
|
|
82
|
-
const client = new AnthropicVertex({
|
|
83
|
-
googleAuth: new GoogleAuth({
|
|
84
|
-
scopes: 'https://www.googleapis.com/auth/cloud-platform',
|
|
85
|
-
keyFile: '/path/to/service-account.json',
|
|
86
|
-
}),
|
|
87
|
-
region: 'us-central1',
|
|
88
|
-
projectId: 'my-project-id',
|
|
89
|
-
});
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
**Configuration Needed**:
|
|
93
|
-
- Google Cloud project ID
|
|
94
|
-
- Location/region selection
|
|
95
|
-
- Google Cloud authentication (service account or ADC)
|
|
96
|
-
- Model ID mapping for Vertex AI (e.g., `claude-3-5-sonnet-v2@20241022`)
|
|
97
|
-
|
|
98
|
-
## OpenAI
|
|
99
|
-
|
|
100
|
-
### Azure OpenAI Service
|
|
101
|
-
|
|
102
|
-
**Status**: Available with enterprise features
|
|
103
|
-
|
|
104
|
-
**Key Features**:
|
|
105
|
-
- Latest models: o4-mini, o3, gpt-4.1, GPT-4o, and others
|
|
106
|
-
- New Responses API combining chat completions and assistants
|
|
107
|
-
- Realtime API with WebRTC support
|
|
108
|
-
- Private networking and regional availability
|
|
109
|
-
- Microsoft Entra ID or API key authentication
|
|
110
|
-
|
|
111
|
-
**Implementation Requirements**:
|
|
112
|
-
```javascript
|
|
113
|
-
// Option 1: Using OpenAI client with Azure (Recommended for 2025)
|
|
114
|
-
import { AzureOpenAI } from 'openai';
|
|
115
|
-
|
|
116
|
-
const client = new AzureOpenAI({
|
|
117
|
-
apiKey: process.env.AZURE_OPENAI_API_KEY,
|
|
118
|
-
apiVersion: '2025-04-01-preview',
|
|
119
|
-
endpoint: process.env.AZURE_OPENAI_ENDPOINT,
|
|
120
|
-
deployment: 'gpt-4o', // Your deployment name
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
// Option 2: With Azure AD Authentication (Recommended for production)
|
|
124
|
-
import { DefaultAzureCredential, getBearerTokenProvider } from '@azure/identity';
|
|
125
|
-
import { AzureOpenAI } from 'openai';
|
|
126
|
-
import '@azure/openai/types';
|
|
127
|
-
|
|
128
|
-
const credential = new DefaultAzureCredential();
|
|
129
|
-
const scope = 'https://cognitiveservices.azure.com/.default';
|
|
130
|
-
const azureADTokenProvider = getBearerTokenProvider(credential, scope);
|
|
131
|
-
|
|
132
|
-
const client = new AzureOpenAI({
|
|
133
|
-
azureADTokenProvider,
|
|
134
|
-
deployment: 'gpt-4o',
|
|
135
|
-
apiVersion: '2025-04-01-preview'
|
|
136
|
-
});
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
**Configuration Needed**:
|
|
140
|
-
- Azure OpenAI resource name
|
|
141
|
-
- API key or Microsoft Entra ID credentials
|
|
142
|
-
- API version selection
|
|
143
|
-
- Deployment names for models
|
|
144
|
-
|
|
145
|
-
## Google
|
|
146
|
-
|
|
147
|
-
### Vertex AI Platform
|
|
148
|
-
|
|
149
|
-
**Status**: Native platform (not an alternative, but enhanced deployment options)
|
|
150
|
-
|
|
151
|
-
**Key Features**:
|
|
152
|
-
- Regional and global endpoints
|
|
153
|
-
- Managed APIs (no deployment required for Gemini models)
|
|
154
|
-
- Support for tuned models
|
|
155
|
-
- Enterprise-grade security and data residency
|
|
156
|
-
- Live API with native audio (30 HD voices in 24 languages)
|
|
157
|
-
|
|
158
|
-
**Implementation Requirements**:
|
|
159
|
-
```javascript
|
|
160
|
-
// Using Google Cloud Vertex AI SDK
|
|
161
|
-
import { VertexAI } from '@google-cloud/vertexai';
|
|
162
|
-
|
|
163
|
-
const vertexAI = new VertexAI({
|
|
164
|
-
project: 'your-cloud-project',
|
|
165
|
-
location: 'us-central1'
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
const generativeModel = vertexAI.getGenerativeModel({
|
|
169
|
-
model: 'gemini-2-5-pro-001',
|
|
170
|
-
generationConfig: { maxOutputTokens: 256 },
|
|
171
|
-
systemInstruction: {
|
|
172
|
-
role: 'system',
|
|
173
|
-
parts: [{ text: 'You are a helpful assistant' }]
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
// Alternative: Using Google Gen AI SDK (Unified SDK for 2025)
|
|
178
|
-
import { GoogleGenAI } from '@google/genai';
|
|
179
|
-
|
|
180
|
-
const ai = new GoogleGenAI({
|
|
181
|
-
project: 'your-cloud-project',
|
|
182
|
-
location: 'us-central1',
|
|
183
|
-
// Uses Application Default Credentials
|
|
184
|
-
});
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
**Configuration Needed**:
|
|
188
|
-
- Endpoint type selection (regional vs global)
|
|
189
|
-
- Support for custom/tuned models
|
|
190
|
-
- Live API configuration
|
|
191
|
-
- Google Cloud authentication setup
|
|
192
|
-
|
|
193
|
-
## DeepSeek
|
|
194
|
-
|
|
195
|
-
### AWS Bedrock
|
|
196
|
-
|
|
197
|
-
**Status**: Available as of March 2025 (first cloud provider to offer fully managed)
|
|
198
|
-
|
|
199
|
-
**Key Features**:
|
|
200
|
-
- DeepSeek-R1 available as serverless model
|
|
201
|
-
- Available in US East (N. Virginia), US East (Ohio), and US West (Oregon)
|
|
202
|
-
- Cross-region inference support
|
|
203
|
-
- Enterprise-grade security and monitoring
|
|
204
|
-
- Integration with Amazon Bedrock guardrails recommended
|
|
205
|
-
|
|
206
|
-
**Implementation Requirements**:
|
|
207
|
-
```javascript
|
|
208
|
-
// Using AWS SDK for Bedrock
|
|
209
|
-
import { BedrockRuntimeClient, InvokeModelCommand } from '@aws-sdk/client-bedrock-runtime';
|
|
210
|
-
|
|
211
|
-
const client = new BedrockRuntimeClient({ region: 'us-east-1' });
|
|
212
|
-
|
|
213
|
-
const command = new InvokeModelCommand({
|
|
214
|
-
modelId: 'deepseek-r1', // Exact model ID from AWS Bedrock
|
|
215
|
-
body: JSON.stringify({
|
|
216
|
-
messages: [{ role: 'user', content: 'Hello' }],
|
|
217
|
-
max_tokens: 1024,
|
|
218
|
-
}),
|
|
219
|
-
contentType: 'application/json',
|
|
220
|
-
accept: 'application/json',
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
const response = await client.send(command);
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### Azure AI Foundry
|
|
227
|
-
|
|
228
|
-
**Status**: Available as of 2025
|
|
229
|
-
|
|
230
|
-
**Key Features**:
|
|
231
|
-
- Part of Azure AI Foundry platform
|
|
232
|
-
- Built-in model evaluation tools
|
|
233
|
-
- Red teaming and safety evaluations completed
|
|
234
|
-
- SLA, security, and responsible AI commitments
|
|
235
|
-
|
|
236
|
-
**Implementation Requirements**:
|
|
237
|
-
```javascript
|
|
238
|
-
// Azure AI Foundry API integration
|
|
239
|
-
// Similar pattern to Azure OpenAI
|
|
240
|
-
import { AzureAI } from '@azure/ai-inference';
|
|
241
|
-
|
|
242
|
-
const client = new AzureAI({
|
|
243
|
-
endpoint: process.env.AZURE_AI_ENDPOINT,
|
|
244
|
-
apiKey: process.env.AZURE_AI_API_KEY,
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
// Model deployment through Azure AI Foundry
|
|
248
|
-
const response = await client.completions.create({
|
|
249
|
-
model: 'deepseek-r1',
|
|
250
|
-
messages: [{ role: 'user', content: 'Hello' }],
|
|
251
|
-
});
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
## Mistral AI
|
|
255
|
-
|
|
256
|
-
### AWS Bedrock
|
|
257
|
-
|
|
258
|
-
**Status**: Available with multiple models
|
|
259
|
-
|
|
260
|
-
**Key Features**:
|
|
261
|
-
- Models: Mistral 7B, Mixtral 8x7B, Pixtral Large (multimodal)
|
|
262
|
-
- First major cloud to offer Pixtral Large
|
|
263
|
-
- Serverless, fully managed
|
|
264
|
-
- White-box solutions (weights and code available)
|
|
265
|
-
- 50% lower batch inference pricing (as of April 2025)
|
|
266
|
-
|
|
267
|
-
### Azure AI
|
|
268
|
-
|
|
269
|
-
**Status**: Available
|
|
270
|
-
|
|
271
|
-
**Key Features**:
|
|
272
|
-
- Part of Azure AI ecosystem
|
|
273
|
-
- Integration with Azure services
|
|
274
|
-
|
|
275
|
-
### Google Vertex AI
|
|
276
|
-
|
|
277
|
-
**Status**: Available in Model Garden
|
|
278
|
-
|
|
279
|
-
**Key Features**:
|
|
280
|
-
- Available through Vertex AI Model Garden
|
|
281
|
-
- Standard Vertex AI features apply
|
|
282
|
-
|
|
283
|
-
**Implementation Requirements**:
|
|
284
|
-
```javascript
|
|
285
|
-
// AWS Bedrock integration for Mistral
|
|
286
|
-
import { BedrockRuntimeClient, InvokeModelCommand } from '@aws-sdk/client-bedrock-runtime';
|
|
287
|
-
|
|
288
|
-
const client = new BedrockRuntimeClient({ region: 'us-east-1' });
|
|
289
|
-
|
|
290
|
-
const command = new InvokeModelCommand({
|
|
291
|
-
modelId: 'mistral.mixtral-8x7b-instruct-v0:1', // or 'mistral.mistral-7b-instruct-v0:2'
|
|
292
|
-
body: JSON.stringify({
|
|
293
|
-
prompt: '<s>[INST] Hello [/INST]',
|
|
294
|
-
max_tokens: 512,
|
|
295
|
-
temperature: 0.7,
|
|
296
|
-
}),
|
|
297
|
-
contentType: 'application/json',
|
|
298
|
-
accept: 'application/json',
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
// For Azure/Vertex, Mistral provides their own SDK which works across platforms
|
|
302
|
-
import { Mistral } from '@mistralai/mistralai';
|
|
303
|
-
|
|
304
|
-
const mistral = new Mistral({
|
|
305
|
-
apiKey: process.env.MISTRAL_API_KEY,
|
|
306
|
-
// For cloud platforms, configure the appropriate endpoint
|
|
307
|
-
});
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
## XAI (Grok)
|
|
311
|
-
|
|
312
|
-
### Azure AI Foundry
|
|
313
|
-
|
|
314
|
-
**Status**: Available as of May 2025
|
|
315
|
-
|
|
316
|
-
**Key Features**:
|
|
317
|
-
- Models: Grok 3 and Grok 3 Mini
|
|
318
|
-
- Full Azure SLA support
|
|
319
|
-
- Structured outputs with JSON schema support
|
|
320
|
-
- Functions and tools for agentic workflows
|
|
321
|
-
- Direct Microsoft billing
|
|
322
|
-
- OpenAI API format compatibility
|
|
323
|
-
|
|
324
|
-
**Implementation Requirements**:
|
|
325
|
-
```javascript
|
|
326
|
-
// Azure AI Foundry integration for Grok
|
|
327
|
-
// Uses OpenAI-compatible API format
|
|
328
|
-
import { OpenAI } from 'openai';
|
|
329
|
-
|
|
330
|
-
const client = new OpenAI({
|
|
331
|
-
apiKey: process.env.AZURE_API_KEY,
|
|
332
|
-
baseURL: 'https://YOUR-RESOURCE.openai.azure.com/openai',
|
|
333
|
-
defaultQuery: {
|
|
334
|
-
'api-version': '2025-05-01-preview'
|
|
335
|
-
},
|
|
336
|
-
defaultHeaders: {
|
|
337
|
-
'api-key': process.env.AZURE_API_KEY
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
// Use with deployment name
|
|
342
|
-
const response = await client.chat.completions.create({
|
|
343
|
-
model: 'grok-3', // or 'grok-3-mini'
|
|
344
|
-
messages: [{ role: 'user', content: 'Hello' }],
|
|
345
|
-
});
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
**Note**: No AWS integration announced as of 2025, but xAI's infrastructure supports potential multi-cloud deployment.
|
|
349
|
-
|
|
350
|
-
## Implementation Strategy
|
|
351
|
-
|
|
352
|
-
### 1. Create Platform Abstraction Layer
|
|
353
|
-
|
|
354
|
-
```javascript
|
|
355
|
-
// src/providers/platforms/index.js
|
|
356
|
-
class PlatformProvider {
|
|
357
|
-
constructor(provider, platform, config) {
|
|
358
|
-
this.provider = provider; // 'anthropic', 'openai', etc.
|
|
359
|
-
this.platform = platform; // 'native', 'bedrock', 'azure', 'vertex'
|
|
360
|
-
this.config = config;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
async createClient() {
|
|
364
|
-
// Platform-specific client initialization
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
async sendRequest(messages, options) {
|
|
368
|
-
// Platform-specific request handling
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
### 2. Extend Provider Configuration
|
|
374
|
-
|
|
375
|
-
```javascript
|
|
376
|
-
// Example configuration
|
|
377
|
-
{
|
|
378
|
-
"providers": {
|
|
379
|
-
"anthropic": {
|
|
380
|
-
"platform": "bedrock", // or "native", "vertex"
|
|
381
|
-
"bedrock": {
|
|
382
|
-
"awsRegion": "us-west-2",
|
|
383
|
-
"awsAccessKey": "...",
|
|
384
|
-
"awsSecretKey": "..."
|
|
385
|
-
},
|
|
386
|
-
"vertex": {
|
|
387
|
-
"projectId": "...",
|
|
388
|
-
"location": "us-central1"
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
### 3. Update Environment Variables
|
|
396
|
-
|
|
397
|
-
```bash
|
|
398
|
-
# Platform selection
|
|
399
|
-
ANTHROPIC_PLATFORM=bedrock
|
|
400
|
-
OPENAI_PLATFORM=azure
|
|
401
|
-
DEEPSEEK_PLATFORM=bedrock
|
|
402
|
-
MISTRAL_PLATFORM=bedrock
|
|
403
|
-
XAI_PLATFORM=azure
|
|
404
|
-
|
|
405
|
-
# Platform-specific credentials
|
|
406
|
-
AWS_ACCESS_KEY_ID=...
|
|
407
|
-
AWS_SECRET_ACCESS_KEY=...
|
|
408
|
-
AWS_REGION=us-west-2
|
|
409
|
-
|
|
410
|
-
AZURE_OPENAI_ENDPOINT=...
|
|
411
|
-
AZURE_OPENAI_API_KEY=...
|
|
412
|
-
|
|
413
|
-
GOOGLE_CLOUD_PROJECT=...
|
|
414
|
-
GOOGLE_CLOUD_LOCATION=...
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
### 4. Model Mapping
|
|
418
|
-
|
|
419
|
-
Create a mapping system for model names across platforms:
|
|
420
|
-
|
|
421
|
-
```javascript
|
|
422
|
-
const MODEL_MAPPINGS = {
|
|
423
|
-
anthropic: {
|
|
424
|
-
bedrock: {
|
|
425
|
-
'claude-opus-4': 'anthropic.claude-opus-4-1-20250805-v1:0',
|
|
426
|
-
'claude-sonnet-4': 'anthropic.claude-sonnet-4-20250514-v1:0'
|
|
427
|
-
},
|
|
428
|
-
vertex: {
|
|
429
|
-
'claude-opus-4': 'claude-opus-4@001',
|
|
430
|
-
'claude-sonnet-4': 'claude-sonnet-4@001'
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
};
|
|
434
|
-
```
|
|
435
|
-
|
|
436
|
-
### 5. Testing Strategy
|
|
437
|
-
|
|
438
|
-
- Create integration tests for each platform
|
|
439
|
-
- Mock platform-specific responses
|
|
440
|
-
- Test failover between platforms
|
|
441
|
-
- Verify feature parity across platforms
|
|
442
|
-
|
|
443
|
-
### 6. Documentation Updates
|
|
444
|
-
|
|
445
|
-
- Update README with platform configuration
|
|
446
|
-
- Add platform-specific examples
|
|
447
|
-
- Document limitations and differences
|
|
448
|
-
- Provide migration guides
|
|
449
|
-
|
|
1
|
+
# Alternative Cloud Provider Integrations for Converse MCP Server
|
|
2
|
+
|
|
3
|
+
This document outlines alternative API providers for each AI provider currently supported in the Converse MCP Server, along with implementation requirements for adding support.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
- [Anthropic](#anthropic)
|
|
7
|
+
- [AWS Bedrock](#aws-bedrock)
|
|
8
|
+
- [Google Vertex AI](#google-vertex-ai)
|
|
9
|
+
- [OpenAI](#openai)
|
|
10
|
+
- [Azure OpenAI Service](#azure-openai-service)
|
|
11
|
+
- [Google](#google)
|
|
12
|
+
- [Vertex AI Platform](#vertex-ai-platform)
|
|
13
|
+
- [DeepSeek](#deepseek)
|
|
14
|
+
- [AWS Bedrock](#aws-bedrock-1)
|
|
15
|
+
- [Azure AI Foundry](#azure-ai-foundry)
|
|
16
|
+
- [Mistral AI](#mistral-ai)
|
|
17
|
+
- [AWS Bedrock](#aws-bedrock-2)
|
|
18
|
+
- [Azure AI](#azure-ai)
|
|
19
|
+
- [Google Vertex AI](#google-vertex-ai-1)
|
|
20
|
+
- [XAI (Grok)](#xai-grok)
|
|
21
|
+
- [Azure AI Foundry](#azure-ai-foundry-1)
|
|
22
|
+
- [Implementation Strategy](#implementation-strategy)
|
|
23
|
+
|
|
24
|
+
## Anthropic
|
|
25
|
+
|
|
26
|
+
### AWS Bedrock
|
|
27
|
+
|
|
28
|
+
**Status**: Available and fully managed
|
|
29
|
+
|
|
30
|
+
**Key Features**:
|
|
31
|
+
- Anthropic's client SDKs support Bedrock directly
|
|
32
|
+
- Models available: Claude Opus 4, Claude Sonnet 4, and earlier versions
|
|
33
|
+
- 200,000 token context window
|
|
34
|
+
- 60-minute timeout for inference calls
|
|
35
|
+
- Supports both Messages API and Text Completions API
|
|
36
|
+
|
|
37
|
+
**Implementation Requirements**:
|
|
38
|
+
```javascript
|
|
39
|
+
// Using Anthropic Bedrock SDK
|
|
40
|
+
import AnthropicBedrock from '@anthropic-ai/bedrock-sdk';
|
|
41
|
+
|
|
42
|
+
const client = new AnthropicBedrock({
|
|
43
|
+
awsAccessKey: process.env.AWS_ACCESS_KEY,
|
|
44
|
+
awsSecretKey: process.env.AWS_SECRET_KEY,
|
|
45
|
+
awsRegion: 'us-west-2',
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Alternative: Using AWS SDK directly
|
|
49
|
+
import { BedrockRuntimeClient, InvokeModelCommand } from '@aws-sdk/client-bedrock-runtime';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Configuration Needed**:
|
|
53
|
+
- AWS credentials (access key, secret key)
|
|
54
|
+
- AWS region selection
|
|
55
|
+
- Model ID mapping (e.g., `anthropic.claude-opus-4-1-20250805-v1:0`)
|
|
56
|
+
- Timeout adjustments (default AWS SDK timeout is 1 minute, needs to be increased to 60 minutes)
|
|
57
|
+
|
|
58
|
+
### Google Vertex AI
|
|
59
|
+
|
|
60
|
+
**Status**: Available with FedRAMP High and IL-2 authorization (as of June 2025)
|
|
61
|
+
|
|
62
|
+
**Key Features**:
|
|
63
|
+
- Fully managed, serverless infrastructure
|
|
64
|
+
- Supports Claude Opus 4, Claude Sonnet 3.7, and other models
|
|
65
|
+
- Integration with Google Cloud services
|
|
66
|
+
- Claude Code integration for agent development
|
|
67
|
+
- Pay-as-you-go or provisioned throughput pricing
|
|
68
|
+
|
|
69
|
+
**Implementation Requirements**:
|
|
70
|
+
```javascript
|
|
71
|
+
// Using Anthropic Vertex SDK
|
|
72
|
+
import { AnthropicVertex } from '@anthropic-ai/vertex-sdk';
|
|
73
|
+
|
|
74
|
+
const client = new AnthropicVertex({
|
|
75
|
+
region: 'us-central1',
|
|
76
|
+
projectId: 'my-project-id',
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// Alternative: With custom GoogleAuth
|
|
80
|
+
import { GoogleAuth } from 'google-auth-library';
|
|
81
|
+
|
|
82
|
+
const client = new AnthropicVertex({
|
|
83
|
+
googleAuth: new GoogleAuth({
|
|
84
|
+
scopes: 'https://www.googleapis.com/auth/cloud-platform',
|
|
85
|
+
keyFile: '/path/to/service-account.json',
|
|
86
|
+
}),
|
|
87
|
+
region: 'us-central1',
|
|
88
|
+
projectId: 'my-project-id',
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Configuration Needed**:
|
|
93
|
+
- Google Cloud project ID
|
|
94
|
+
- Location/region selection
|
|
95
|
+
- Google Cloud authentication (service account or ADC)
|
|
96
|
+
- Model ID mapping for Vertex AI (e.g., `claude-3-5-sonnet-v2@20241022`)
|
|
97
|
+
|
|
98
|
+
## OpenAI
|
|
99
|
+
|
|
100
|
+
### Azure OpenAI Service
|
|
101
|
+
|
|
102
|
+
**Status**: Available with enterprise features
|
|
103
|
+
|
|
104
|
+
**Key Features**:
|
|
105
|
+
- Latest models: o4-mini, o3, gpt-4.1, GPT-4o, and others
|
|
106
|
+
- New Responses API combining chat completions and assistants
|
|
107
|
+
- Realtime API with WebRTC support
|
|
108
|
+
- Private networking and regional availability
|
|
109
|
+
- Microsoft Entra ID or API key authentication
|
|
110
|
+
|
|
111
|
+
**Implementation Requirements**:
|
|
112
|
+
```javascript
|
|
113
|
+
// Option 1: Using OpenAI client with Azure (Recommended for 2025)
|
|
114
|
+
import { AzureOpenAI } from 'openai';
|
|
115
|
+
|
|
116
|
+
const client = new AzureOpenAI({
|
|
117
|
+
apiKey: process.env.AZURE_OPENAI_API_KEY,
|
|
118
|
+
apiVersion: '2025-04-01-preview',
|
|
119
|
+
endpoint: process.env.AZURE_OPENAI_ENDPOINT,
|
|
120
|
+
deployment: 'gpt-4o', // Your deployment name
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
// Option 2: With Azure AD Authentication (Recommended for production)
|
|
124
|
+
import { DefaultAzureCredential, getBearerTokenProvider } from '@azure/identity';
|
|
125
|
+
import { AzureOpenAI } from 'openai';
|
|
126
|
+
import '@azure/openai/types';
|
|
127
|
+
|
|
128
|
+
const credential = new DefaultAzureCredential();
|
|
129
|
+
const scope = 'https://cognitiveservices.azure.com/.default';
|
|
130
|
+
const azureADTokenProvider = getBearerTokenProvider(credential, scope);
|
|
131
|
+
|
|
132
|
+
const client = new AzureOpenAI({
|
|
133
|
+
azureADTokenProvider,
|
|
134
|
+
deployment: 'gpt-4o',
|
|
135
|
+
apiVersion: '2025-04-01-preview'
|
|
136
|
+
});
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Configuration Needed**:
|
|
140
|
+
- Azure OpenAI resource name
|
|
141
|
+
- API key or Microsoft Entra ID credentials
|
|
142
|
+
- API version selection
|
|
143
|
+
- Deployment names for models
|
|
144
|
+
|
|
145
|
+
## Google
|
|
146
|
+
|
|
147
|
+
### Vertex AI Platform
|
|
148
|
+
|
|
149
|
+
**Status**: Native platform (not an alternative, but enhanced deployment options)
|
|
150
|
+
|
|
151
|
+
**Key Features**:
|
|
152
|
+
- Regional and global endpoints
|
|
153
|
+
- Managed APIs (no deployment required for Gemini models)
|
|
154
|
+
- Support for tuned models
|
|
155
|
+
- Enterprise-grade security and data residency
|
|
156
|
+
- Live API with native audio (30 HD voices in 24 languages)
|
|
157
|
+
|
|
158
|
+
**Implementation Requirements**:
|
|
159
|
+
```javascript
|
|
160
|
+
// Using Google Cloud Vertex AI SDK
|
|
161
|
+
import { VertexAI } from '@google-cloud/vertexai';
|
|
162
|
+
|
|
163
|
+
const vertexAI = new VertexAI({
|
|
164
|
+
project: 'your-cloud-project',
|
|
165
|
+
location: 'us-central1'
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
const generativeModel = vertexAI.getGenerativeModel({
|
|
169
|
+
model: 'gemini-2-5-pro-001',
|
|
170
|
+
generationConfig: { maxOutputTokens: 256 },
|
|
171
|
+
systemInstruction: {
|
|
172
|
+
role: 'system',
|
|
173
|
+
parts: [{ text: 'You are a helpful assistant' }]
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
// Alternative: Using Google Gen AI SDK (Unified SDK for 2025)
|
|
178
|
+
import { GoogleGenAI } from '@google/genai';
|
|
179
|
+
|
|
180
|
+
const ai = new GoogleGenAI({
|
|
181
|
+
project: 'your-cloud-project',
|
|
182
|
+
location: 'us-central1',
|
|
183
|
+
// Uses Application Default Credentials
|
|
184
|
+
});
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Configuration Needed**:
|
|
188
|
+
- Endpoint type selection (regional vs global)
|
|
189
|
+
- Support for custom/tuned models
|
|
190
|
+
- Live API configuration
|
|
191
|
+
- Google Cloud authentication setup
|
|
192
|
+
|
|
193
|
+
## DeepSeek
|
|
194
|
+
|
|
195
|
+
### AWS Bedrock
|
|
196
|
+
|
|
197
|
+
**Status**: Available as of March 2025 (first cloud provider to offer fully managed)
|
|
198
|
+
|
|
199
|
+
**Key Features**:
|
|
200
|
+
- DeepSeek-R1 available as serverless model
|
|
201
|
+
- Available in US East (N. Virginia), US East (Ohio), and US West (Oregon)
|
|
202
|
+
- Cross-region inference support
|
|
203
|
+
- Enterprise-grade security and monitoring
|
|
204
|
+
- Integration with Amazon Bedrock guardrails recommended
|
|
205
|
+
|
|
206
|
+
**Implementation Requirements**:
|
|
207
|
+
```javascript
|
|
208
|
+
// Using AWS SDK for Bedrock
|
|
209
|
+
import { BedrockRuntimeClient, InvokeModelCommand } from '@aws-sdk/client-bedrock-runtime';
|
|
210
|
+
|
|
211
|
+
const client = new BedrockRuntimeClient({ region: 'us-east-1' });
|
|
212
|
+
|
|
213
|
+
const command = new InvokeModelCommand({
|
|
214
|
+
modelId: 'deepseek-r1', // Exact model ID from AWS Bedrock
|
|
215
|
+
body: JSON.stringify({
|
|
216
|
+
messages: [{ role: 'user', content: 'Hello' }],
|
|
217
|
+
max_tokens: 1024,
|
|
218
|
+
}),
|
|
219
|
+
contentType: 'application/json',
|
|
220
|
+
accept: 'application/json',
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
const response = await client.send(command);
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Azure AI Foundry
|
|
227
|
+
|
|
228
|
+
**Status**: Available as of 2025
|
|
229
|
+
|
|
230
|
+
**Key Features**:
|
|
231
|
+
- Part of Azure AI Foundry platform
|
|
232
|
+
- Built-in model evaluation tools
|
|
233
|
+
- Red teaming and safety evaluations completed
|
|
234
|
+
- SLA, security, and responsible AI commitments
|
|
235
|
+
|
|
236
|
+
**Implementation Requirements**:
|
|
237
|
+
```javascript
|
|
238
|
+
// Azure AI Foundry API integration
|
|
239
|
+
// Similar pattern to Azure OpenAI
|
|
240
|
+
import { AzureAI } from '@azure/ai-inference';
|
|
241
|
+
|
|
242
|
+
const client = new AzureAI({
|
|
243
|
+
endpoint: process.env.AZURE_AI_ENDPOINT,
|
|
244
|
+
apiKey: process.env.AZURE_AI_API_KEY,
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
// Model deployment through Azure AI Foundry
|
|
248
|
+
const response = await client.completions.create({
|
|
249
|
+
model: 'deepseek-r1',
|
|
250
|
+
messages: [{ role: 'user', content: 'Hello' }],
|
|
251
|
+
});
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## Mistral AI
|
|
255
|
+
|
|
256
|
+
### AWS Bedrock
|
|
257
|
+
|
|
258
|
+
**Status**: Available with multiple models
|
|
259
|
+
|
|
260
|
+
**Key Features**:
|
|
261
|
+
- Models: Mistral 7B, Mixtral 8x7B, Pixtral Large (multimodal)
|
|
262
|
+
- First major cloud to offer Pixtral Large
|
|
263
|
+
- Serverless, fully managed
|
|
264
|
+
- White-box solutions (weights and code available)
|
|
265
|
+
- 50% lower batch inference pricing (as of April 2025)
|
|
266
|
+
|
|
267
|
+
### Azure AI
|
|
268
|
+
|
|
269
|
+
**Status**: Available
|
|
270
|
+
|
|
271
|
+
**Key Features**:
|
|
272
|
+
- Part of Azure AI ecosystem
|
|
273
|
+
- Integration with Azure services
|
|
274
|
+
|
|
275
|
+
### Google Vertex AI
|
|
276
|
+
|
|
277
|
+
**Status**: Available in Model Garden
|
|
278
|
+
|
|
279
|
+
**Key Features**:
|
|
280
|
+
- Available through Vertex AI Model Garden
|
|
281
|
+
- Standard Vertex AI features apply
|
|
282
|
+
|
|
283
|
+
**Implementation Requirements**:
|
|
284
|
+
```javascript
|
|
285
|
+
// AWS Bedrock integration for Mistral
|
|
286
|
+
import { BedrockRuntimeClient, InvokeModelCommand } from '@aws-sdk/client-bedrock-runtime';
|
|
287
|
+
|
|
288
|
+
const client = new BedrockRuntimeClient({ region: 'us-east-1' });
|
|
289
|
+
|
|
290
|
+
const command = new InvokeModelCommand({
|
|
291
|
+
modelId: 'mistral.mixtral-8x7b-instruct-v0:1', // or 'mistral.mistral-7b-instruct-v0:2'
|
|
292
|
+
body: JSON.stringify({
|
|
293
|
+
prompt: '<s>[INST] Hello [/INST]',
|
|
294
|
+
max_tokens: 512,
|
|
295
|
+
temperature: 0.7,
|
|
296
|
+
}),
|
|
297
|
+
contentType: 'application/json',
|
|
298
|
+
accept: 'application/json',
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
// For Azure/Vertex, Mistral provides their own SDK which works across platforms
|
|
302
|
+
import { Mistral } from '@mistralai/mistralai';
|
|
303
|
+
|
|
304
|
+
const mistral = new Mistral({
|
|
305
|
+
apiKey: process.env.MISTRAL_API_KEY,
|
|
306
|
+
// For cloud platforms, configure the appropriate endpoint
|
|
307
|
+
});
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
## XAI (Grok)
|
|
311
|
+
|
|
312
|
+
### Azure AI Foundry
|
|
313
|
+
|
|
314
|
+
**Status**: Available as of May 2025
|
|
315
|
+
|
|
316
|
+
**Key Features**:
|
|
317
|
+
- Models: Grok 3 and Grok 3 Mini
|
|
318
|
+
- Full Azure SLA support
|
|
319
|
+
- Structured outputs with JSON schema support
|
|
320
|
+
- Functions and tools for agentic workflows
|
|
321
|
+
- Direct Microsoft billing
|
|
322
|
+
- OpenAI API format compatibility
|
|
323
|
+
|
|
324
|
+
**Implementation Requirements**:
|
|
325
|
+
```javascript
|
|
326
|
+
// Azure AI Foundry integration for Grok
|
|
327
|
+
// Uses OpenAI-compatible API format
|
|
328
|
+
import { OpenAI } from 'openai';
|
|
329
|
+
|
|
330
|
+
const client = new OpenAI({
|
|
331
|
+
apiKey: process.env.AZURE_API_KEY,
|
|
332
|
+
baseURL: 'https://YOUR-RESOURCE.openai.azure.com/openai',
|
|
333
|
+
defaultQuery: {
|
|
334
|
+
'api-version': '2025-05-01-preview'
|
|
335
|
+
},
|
|
336
|
+
defaultHeaders: {
|
|
337
|
+
'api-key': process.env.AZURE_API_KEY
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
// Use with deployment name
|
|
342
|
+
const response = await client.chat.completions.create({
|
|
343
|
+
model: 'grok-3', // or 'grok-3-mini'
|
|
344
|
+
messages: [{ role: 'user', content: 'Hello' }],
|
|
345
|
+
});
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**Note**: No AWS integration announced as of 2025, but xAI's infrastructure supports potential multi-cloud deployment.
|
|
349
|
+
|
|
350
|
+
## Implementation Strategy
|
|
351
|
+
|
|
352
|
+
### 1. Create Platform Abstraction Layer
|
|
353
|
+
|
|
354
|
+
```javascript
|
|
355
|
+
// src/providers/platforms/index.js
|
|
356
|
+
class PlatformProvider {
|
|
357
|
+
constructor(provider, platform, config) {
|
|
358
|
+
this.provider = provider; // 'anthropic', 'openai', etc.
|
|
359
|
+
this.platform = platform; // 'native', 'bedrock', 'azure', 'vertex'
|
|
360
|
+
this.config = config;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
async createClient() {
|
|
364
|
+
// Platform-specific client initialization
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
async sendRequest(messages, options) {
|
|
368
|
+
// Platform-specific request handling
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### 2. Extend Provider Configuration
|
|
374
|
+
|
|
375
|
+
```javascript
|
|
376
|
+
// Example configuration
|
|
377
|
+
{
|
|
378
|
+
"providers": {
|
|
379
|
+
"anthropic": {
|
|
380
|
+
"platform": "bedrock", // or "native", "vertex"
|
|
381
|
+
"bedrock": {
|
|
382
|
+
"awsRegion": "us-west-2",
|
|
383
|
+
"awsAccessKey": "...",
|
|
384
|
+
"awsSecretKey": "..."
|
|
385
|
+
},
|
|
386
|
+
"vertex": {
|
|
387
|
+
"projectId": "...",
|
|
388
|
+
"location": "us-central1"
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### 3. Update Environment Variables
|
|
396
|
+
|
|
397
|
+
```bash
|
|
398
|
+
# Platform selection
|
|
399
|
+
ANTHROPIC_PLATFORM=bedrock
|
|
400
|
+
OPENAI_PLATFORM=azure
|
|
401
|
+
DEEPSEEK_PLATFORM=bedrock
|
|
402
|
+
MISTRAL_PLATFORM=bedrock
|
|
403
|
+
XAI_PLATFORM=azure
|
|
404
|
+
|
|
405
|
+
# Platform-specific credentials
|
|
406
|
+
AWS_ACCESS_KEY_ID=...
|
|
407
|
+
AWS_SECRET_ACCESS_KEY=...
|
|
408
|
+
AWS_REGION=us-west-2
|
|
409
|
+
|
|
410
|
+
AZURE_OPENAI_ENDPOINT=...
|
|
411
|
+
AZURE_OPENAI_API_KEY=...
|
|
412
|
+
|
|
413
|
+
GOOGLE_CLOUD_PROJECT=...
|
|
414
|
+
GOOGLE_CLOUD_LOCATION=...
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### 4. Model Mapping
|
|
418
|
+
|
|
419
|
+
Create a mapping system for model names across platforms:
|
|
420
|
+
|
|
421
|
+
```javascript
|
|
422
|
+
const MODEL_MAPPINGS = {
|
|
423
|
+
anthropic: {
|
|
424
|
+
bedrock: {
|
|
425
|
+
'claude-opus-4': 'anthropic.claude-opus-4-1-20250805-v1:0',
|
|
426
|
+
'claude-sonnet-4': 'anthropic.claude-sonnet-4-20250514-v1:0'
|
|
427
|
+
},
|
|
428
|
+
vertex: {
|
|
429
|
+
'claude-opus-4': 'claude-opus-4@001',
|
|
430
|
+
'claude-sonnet-4': 'claude-sonnet-4@001'
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
### 5. Testing Strategy
|
|
437
|
+
|
|
438
|
+
- Create integration tests for each platform
|
|
439
|
+
- Mock platform-specific responses
|
|
440
|
+
- Test failover between platforms
|
|
441
|
+
- Verify feature parity across platforms
|
|
442
|
+
|
|
443
|
+
### 6. Documentation Updates
|
|
444
|
+
|
|
445
|
+
- Update README with platform configuration
|
|
446
|
+
- Add platform-specific examples
|
|
447
|
+
- Document limitations and differences
|
|
448
|
+
- Provide migration guides
|
|
449
|
+
|
|
450
450
|
This implementation would allow users to choose their preferred cloud platform for each AI provider, enabling better cost optimization, compliance requirements, and geographic distribution.
|