openlayer 0.15.2 → 0.16.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 +8 -0
- package/lib/core/cli.d.ts +1 -1
- package/lib/core/cli.d.ts.map +1 -1
- package/lib/core/cli.js +1 -1
- package/lib/core/cli.js.map +1 -1
- package/lib/core/cli.mjs +1 -1
- package/lib/core/cli.mjs.map +1 -1
- package/lib/integrations/bedrockAgentTracer.d.ts +2 -1
- package/lib/integrations/bedrockAgentTracer.d.ts.map +1 -1
- package/lib/integrations/bedrockAgentTracer.js +694 -2
- package/lib/integrations/bedrockAgentTracer.js.map +1 -1
- package/lib/integrations/bedrockAgentTracer.mjs +694 -2
- package/lib/integrations/bedrockAgentTracer.mjs.map +1 -1
- package/lib/tracing/tracer.d.ts +2 -1
- package/lib/tracing/tracer.d.ts.map +1 -1
- package/lib/tracing/tracer.js +2 -1
- package/lib/tracing/tracer.js.map +1 -1
- package/lib/tracing/tracer.mjs +2 -1
- package/lib/tracing/tracer.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/core/cli.ts +2 -2
- package/src/lib/integrations/bedrockAgentTracer.ts +839 -6
- package/src/lib/tracing/tracer.ts +3 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import performanceNow from 'performance-now';
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
BedrockAgentRuntimeClient,
|
|
5
|
+
InvokeAgentCommand,
|
|
6
|
+
InvokeAgentCommandInput,
|
|
7
|
+
InvokeAgentCommandOutput,
|
|
8
|
+
ResponseStream,
|
|
9
|
+
} from '@aws-sdk/client-bedrock-agent-runtime';
|
|
3
10
|
import { addChatCompletionStepToTrace } from '../tracing/tracer';
|
|
4
11
|
|
|
5
|
-
export function traceBedrockAgent(
|
|
12
|
+
export function traceBedrockAgent(
|
|
13
|
+
client: BedrockAgentRuntimeClient,
|
|
14
|
+
openlayerInferencePipelineId?: string,
|
|
15
|
+
): BedrockAgentRuntimeClient {
|
|
6
16
|
const originalSend = client.send.bind(client);
|
|
7
17
|
|
|
8
|
-
client.send = async function (
|
|
18
|
+
client.send = async function (
|
|
19
|
+
this: any,
|
|
20
|
+
command: InvokeAgentCommand,
|
|
21
|
+
options?: any,
|
|
22
|
+
): Promise<InvokeAgentCommandOutput & { completion: AsyncIterable<ResponseStream> | undefined }> {
|
|
9
23
|
// Debug logging to see what we're receiving
|
|
10
24
|
const hasInput = command?.input;
|
|
11
25
|
const hasAgentId = typeof command?.input?.agentId === 'string';
|
|
@@ -24,7 +38,7 @@ export function traceBedrockAgent(client: any, openlayerInferencePipelineId?: st
|
|
|
24
38
|
|
|
25
39
|
try {
|
|
26
40
|
// Call the original send method
|
|
27
|
-
const response = await originalSend(command, options);
|
|
41
|
+
const response: InvokeAgentCommandOutput = await originalSend(command, options);
|
|
28
42
|
|
|
29
43
|
if (!response.completion) {
|
|
30
44
|
throw new Error('Completion is undefined');
|
|
@@ -36,6 +50,7 @@ export function traceBedrockAgent(client: any, openlayerInferencePipelineId?: st
|
|
|
36
50
|
input,
|
|
37
51
|
startTime,
|
|
38
52
|
openlayerInferencePipelineId,
|
|
53
|
+
client.config.region,
|
|
39
54
|
);
|
|
40
55
|
|
|
41
56
|
// Return the response with the traced completion
|
|
@@ -54,11 +69,12 @@ export function traceBedrockAgent(client: any, openlayerInferencePipelineId?: st
|
|
|
54
69
|
|
|
55
70
|
// Create a traced completion that collects data while yielding original events
|
|
56
71
|
function createTracedCompletion(
|
|
57
|
-
originalCompletion: AsyncIterable<
|
|
58
|
-
input:
|
|
72
|
+
originalCompletion: AsyncIterable<ResponseStream>,
|
|
73
|
+
input: InvokeAgentCommandInput,
|
|
59
74
|
startTime: number,
|
|
60
75
|
openlayerInferencePipelineId?: string,
|
|
61
|
-
)
|
|
76
|
+
region?: () => Promise<string>,
|
|
77
|
+
): AsyncIterable<ResponseStream> {
|
|
62
78
|
return {
|
|
63
79
|
async *[Symbol.asyncIterator]() {
|
|
64
80
|
let firstTokenTime: number | undefined;
|
|
@@ -162,6 +178,14 @@ function createTracedCompletion(
|
|
|
162
178
|
};
|
|
163
179
|
}
|
|
164
180
|
|
|
181
|
+
// Calculate cost based on tokens, model, and region
|
|
182
|
+
const cost = calculateCost(
|
|
183
|
+
promptTokens,
|
|
184
|
+
completionTokens,
|
|
185
|
+
agentModel,
|
|
186
|
+
typeof region === 'function' ? await region() : region || 'us-east-1',
|
|
187
|
+
);
|
|
188
|
+
|
|
165
189
|
const traceStepData = {
|
|
166
190
|
name: 'AWS Bedrock Agent Invocation',
|
|
167
191
|
inputs: inputs,
|
|
@@ -170,6 +194,7 @@ function createTracedCompletion(
|
|
|
170
194
|
tokens: totalTokens > 0 ? totalTokens : null,
|
|
171
195
|
promptTokens: promptTokens > 0 ? promptTokens : null,
|
|
172
196
|
completionTokens: completionTokens > 0 ? completionTokens : null,
|
|
197
|
+
cost: cost,
|
|
173
198
|
model: agentModel || `${input.agentId}:${input.agentAliasId}`,
|
|
174
199
|
modelParameters: extractModelParameters(input),
|
|
175
200
|
rawOutput: JSON.stringify(rawOutputChunks, null, 2),
|
|
@@ -303,3 +328,811 @@ function extractModelParameters(input: any): Record<string, any> {
|
|
|
303
328
|
|
|
304
329
|
return params;
|
|
305
330
|
}
|
|
331
|
+
|
|
332
|
+
// Bedrock pricing per 1K tokens by region and model ID (as of 2024)
|
|
333
|
+
// Source: https://aws.amazon.com/bedrock/pricing/
|
|
334
|
+
const BedrockPricing: { [region: string]: { [modelId: string]: { input: number; output: number } } } = {
|
|
335
|
+
'us-east-1': {
|
|
336
|
+
// Anthropic models
|
|
337
|
+
'anthropic.claude-3-5-sonnet-20241022-v1:0': { input: 0.003, output: 0.015 },
|
|
338
|
+
'anthropic.claude-3-5-haiku-20241022-v1:0': { input: 0.00025, output: 0.00125 },
|
|
339
|
+
'anthropic.claude-3-opus-20240229-v1:0': { input: 0.015, output: 0.075 },
|
|
340
|
+
'anthropic.claude-3-sonnet-20240229-v1:0': { input: 0.003, output: 0.015 },
|
|
341
|
+
'anthropic.claude-3-haiku-20240307-v1:0': { input: 0.00025, output: 0.00125 },
|
|
342
|
+
'anthropic.claude-v2:1': { input: 0.008, output: 0.024 },
|
|
343
|
+
'anthropic.claude-v2': { input: 0.008, output: 0.024 },
|
|
344
|
+
'anthropic.claude-instant-v1': { input: 0.00163, output: 0.00551 },
|
|
345
|
+
'anthropic.claude-sonnet-4': { input: 0.003, output: 0.015 },
|
|
346
|
+
'anthropic.claude-opus-4': { input: 0.015, output: 0.075 },
|
|
347
|
+
'anthropic.claude-haiku-4': { input: 0.00025, output: 0.00125 },
|
|
348
|
+
|
|
349
|
+
// Amazon models
|
|
350
|
+
'amazon.titan-text-express-v1': { input: 0.0008, output: 0.0016 },
|
|
351
|
+
'amazon.titan-text-lite-v1': { input: 0.0003, output: 0.0004 },
|
|
352
|
+
'amazon.titan-embed-text-v1': { input: 0.0001, output: 0 },
|
|
353
|
+
'amazon.titan-embed-image-v1': { input: 0.0001, output: 0 },
|
|
354
|
+
'amazon.titan-image-generator-v1': { input: 0.008, output: 0 },
|
|
355
|
+
'amazon.nova-pro': { input: 0.003, output: 0.015 },
|
|
356
|
+
'amazon.nova-express': { input: 0.00025, output: 0.00125 },
|
|
357
|
+
|
|
358
|
+
// AI21 models
|
|
359
|
+
'ai21.j2-ultra-v1': { input: 0.0128, output: 0.0128 },
|
|
360
|
+
'ai21.j2-mid-v1': { input: 0.008, output: 0.008 },
|
|
361
|
+
'ai21.j2-light-v1': { input: 0.0006, output: 0.0006 },
|
|
362
|
+
'ai21.j2-ultra-v1:0': { input: 0.0128, output: 0.0128 },
|
|
363
|
+
'ai21.j2-mid-v1:0': { input: 0.008, output: 0.008 },
|
|
364
|
+
'ai21.j2-light-v1:0': { input: 0.0006, output: 0.0006 },
|
|
365
|
+
|
|
366
|
+
// Meta models
|
|
367
|
+
'meta.llama2-13b-chat-v1': { input: 0.00075, output: 0.001 },
|
|
368
|
+
'meta.llama2-70b-chat-v1': { input: 0.00195, output: 0.00256 },
|
|
369
|
+
'meta.llama2-7b-chat-v1': { input: 0.0006, output: 0.0006 },
|
|
370
|
+
'meta.llama2-13b-chat-v1:0': { input: 0.00075, output: 0.001 },
|
|
371
|
+
'meta.llama2-70b-chat-v1:0': { input: 0.00195, output: 0.00256 },
|
|
372
|
+
'meta.llama2-7b-chat-v1:0': { input: 0.0006, output: 0.0006 },
|
|
373
|
+
'meta.llama3-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
374
|
+
'meta.llama3-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
375
|
+
'meta.llama3-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
376
|
+
'meta.llama3.1-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
377
|
+
'meta.llama3.1-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
378
|
+
'meta.llama3.1-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
379
|
+
|
|
380
|
+
// Cohere models
|
|
381
|
+
'cohere.command-text-v14': { input: 0.0015, output: 0.002 },
|
|
382
|
+
'cohere.command-light-text-v14': { input: 0.0003, output: 0.0006 },
|
|
383
|
+
'cohere.embed-english-v3': { input: 0.0001, output: 0 },
|
|
384
|
+
'cohere.embed-multilingual-v3': { input: 0.0001, output: 0 },
|
|
385
|
+
'cohere.command-r-v1:0': { input: 0.0015, output: 0.002 },
|
|
386
|
+
'cohere.command-r-plus-v1:0': { input: 0.003, output: 0.015 },
|
|
387
|
+
|
|
388
|
+
// Mistral models
|
|
389
|
+
'mistral.mistral-7b-instruct-v0:2': { input: 0.00015, output: 0.0002 },
|
|
390
|
+
'mistral.mixtral-8x7b-instruct-v0:1': { input: 0.00045, output: 0.0007 },
|
|
391
|
+
'mistral.mistral-large-2402-v1:0': { input: 0.008, output: 0.024 },
|
|
392
|
+
'mistral.mistral-small-2402-v1:0': { input: 0.001, output: 0.003 },
|
|
393
|
+
'mistral.mistral-7b-instruct-v0:3': { input: 0.00015, output: 0.0002 },
|
|
394
|
+
'mistral.mixtral-8x7b-instruct-v0:3': { input: 0.00045, output: 0.0007 },
|
|
395
|
+
|
|
396
|
+
// Stability AI models
|
|
397
|
+
'stability.stable-diffusion-xl-v1': { input: 0.036, output: 0 }, // per image
|
|
398
|
+
'stability.stable-diffusion-xl-v1:0': { input: 0.036, output: 0 }, // per image
|
|
399
|
+
|
|
400
|
+
// TwelveLabs models
|
|
401
|
+
'twelvelabs.pegasus-1.2': { input: 0.00049, output: 0.0075 }, // per second + per token
|
|
402
|
+
'twelvelabs.marengo-embed-2.7': { input: 0.0007, output: 0.00007 }, // per minute + per request
|
|
403
|
+
|
|
404
|
+
// Writer models
|
|
405
|
+
'writer.palmyra-x-5': { input: 0.003, output: 0.015 },
|
|
406
|
+
'writer.palmyra-x-5:0': { input: 0.003, output: 0.015 },
|
|
407
|
+
},
|
|
408
|
+
|
|
409
|
+
'us-east-2': {
|
|
410
|
+
// Anthropic models
|
|
411
|
+
'anthropic.claude-3-5-sonnet-20241022-v1:0': { input: 0.003, output: 0.015 },
|
|
412
|
+
'anthropic.claude-3-5-haiku-20241022-v1:0': { input: 0.00025, output: 0.00125 },
|
|
413
|
+
'anthropic.claude-3-opus-20240229-v1:0': { input: 0.015, output: 0.075 },
|
|
414
|
+
'anthropic.claude-3-sonnet-20240229-v1:0': { input: 0.003, output: 0.015 },
|
|
415
|
+
'anthropic.claude-3-haiku-20240307-v1:0': { input: 0.00025, output: 0.00125 },
|
|
416
|
+
'anthropic.claude-v2:1': { input: 0.008, output: 0.024 },
|
|
417
|
+
'anthropic.claude-v2': { input: 0.008, output: 0.024 },
|
|
418
|
+
'anthropic.claude-instant-v1': { input: 0.00163, output: 0.00551 },
|
|
419
|
+
'anthropic.claude-sonnet-4': { input: 0.003, output: 0.015 },
|
|
420
|
+
'anthropic.claude-opus-4': { input: 0.015, output: 0.075 },
|
|
421
|
+
'anthropic.claude-haiku-4': { input: 0.00025, output: 0.00125 },
|
|
422
|
+
|
|
423
|
+
// Amazon models
|
|
424
|
+
'amazon.titan-text-express-v1': { input: 0.0008, output: 0.0016 },
|
|
425
|
+
'amazon.titan-text-lite-v1': { input: 0.0003, output: 0.0004 },
|
|
426
|
+
'amazon.titan-embed-text-v1': { input: 0.0001, output: 0 },
|
|
427
|
+
'amazon.titan-embed-image-v1': { input: 0.0001, output: 0 },
|
|
428
|
+
'amazon.titan-image-generator-v1': { input: 0.008, output: 0 },
|
|
429
|
+
'amazon.nova-pro': { input: 0.003, output: 0.015 },
|
|
430
|
+
'amazon.nova-express': { input: 0.00025, output: 0.00125 },
|
|
431
|
+
|
|
432
|
+
// AI21 models
|
|
433
|
+
'ai21.j2-ultra-v1': { input: 0.0128, output: 0.0128 },
|
|
434
|
+
'ai21.j2-mid-v1': { input: 0.008, output: 0.008 },
|
|
435
|
+
'ai21.j2-light-v1': { input: 0.0006, output: 0.0006 },
|
|
436
|
+
'ai21.j2-ultra-v1:0': { input: 0.0128, output: 0.0128 },
|
|
437
|
+
'ai21.j2-mid-v1:0': { input: 0.008, output: 0.008 },
|
|
438
|
+
'ai21.j2-light-v1:0': { input: 0.0006, output: 0.0006 },
|
|
439
|
+
|
|
440
|
+
// Meta models
|
|
441
|
+
'meta.llama2-13b-chat-v1': { input: 0.00075, output: 0.001 },
|
|
442
|
+
'meta.llama2-70b-chat-v1': { input: 0.00195, output: 0.00256 },
|
|
443
|
+
'meta.llama2-7b-chat-v1': { input: 0.0006, output: 0.0006 },
|
|
444
|
+
'meta.llama2-13b-chat-v1:0': { input: 0.00075, output: 0.001 },
|
|
445
|
+
'meta.llama2-70b-chat-v1:0': { input: 0.00195, output: 0.00256 },
|
|
446
|
+
'meta.llama2-7b-chat-v1:0': { input: 0.0006, output: 0.0006 },
|
|
447
|
+
'meta.llama3-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
448
|
+
'meta.llama3-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
449
|
+
'meta.llama3-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
450
|
+
'meta.llama3.1-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
451
|
+
'meta.llama3.1-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
452
|
+
'meta.llama3.1-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
453
|
+
|
|
454
|
+
// Cohere models
|
|
455
|
+
'cohere.command-text-v14': { input: 0.0015, output: 0.002 },
|
|
456
|
+
'cohere.command-light-text-v14': { input: 0.0003, output: 0.0006 },
|
|
457
|
+
'cohere.embed-english-v3': { input: 0.0001, output: 0 },
|
|
458
|
+
'cohere.embed-multilingual-v3': { input: 0.0001, output: 0 },
|
|
459
|
+
'cohere.command-r-v1:0': { input: 0.0015, output: 0.002 },
|
|
460
|
+
'cohere.command-r-plus-v1:0': { input: 0.003, output: 0.015 },
|
|
461
|
+
|
|
462
|
+
// Mistral models
|
|
463
|
+
'mistral.mistral-7b-instruct-v0:2': { input: 0.00015, output: 0.0002 },
|
|
464
|
+
'mistral.mixtral-8x7b-instruct-v0:1': { input: 0.00045, output: 0.0007 },
|
|
465
|
+
'mistral.mistral-large-2402-v1:0': { input: 0.008, output: 0.024 },
|
|
466
|
+
'mistral.mistral-small-2402-v1:0': { input: 0.001, output: 0.003 },
|
|
467
|
+
'mistral.mistral-7b-instruct-v0:3': { input: 0.00015, output: 0.0002 },
|
|
468
|
+
'mistral.mixtral-8x7b-instruct-v0:3': { input: 0.00045, output: 0.0007 },
|
|
469
|
+
|
|
470
|
+
// Stability AI models
|
|
471
|
+
'stability.stable-diffusion-xl-v1': { input: 0.036, output: 0 }, // per image
|
|
472
|
+
'stability.stable-diffusion-xl-v1:0': { input: 0.036, output: 0 }, // per image
|
|
473
|
+
|
|
474
|
+
// TwelveLabs models
|
|
475
|
+
'twelvelabs.pegasus-1.2': { input: 0.00049, output: 0.0075 }, // per second + per token
|
|
476
|
+
'twelvelabs.marengo-embed-2.7': { input: 0.0007, output: 0.00007 }, // per minute + per request
|
|
477
|
+
|
|
478
|
+
// Writer models
|
|
479
|
+
'writer.palmyra-x-5': { input: 0.003, output: 0.015 },
|
|
480
|
+
'writer.palmyra-x-5:0': { input: 0.003, output: 0.015 },
|
|
481
|
+
},
|
|
482
|
+
|
|
483
|
+
'us-west-2': {
|
|
484
|
+
// Anthropic models
|
|
485
|
+
'anthropic.claude-3-5-sonnet-20241022-v1:0': { input: 0.003, output: 0.015 },
|
|
486
|
+
'anthropic.claude-3-5-haiku-20241022-v1:0': { input: 0.00025, output: 0.00125 },
|
|
487
|
+
'anthropic.claude-3-opus-20240229-v1:0': { input: 0.015, output: 0.075 },
|
|
488
|
+
'anthropic.claude-3-sonnet-20240229-v1:0': { input: 0.003, output: 0.015 },
|
|
489
|
+
'anthropic.claude-3-haiku-20240307-v1:0': { input: 0.00025, output: 0.00125 },
|
|
490
|
+
'anthropic.claude-v2:1': { input: 0.008, output: 0.024 },
|
|
491
|
+
'anthropic.claude-v2': { input: 0.008, output: 0.024 },
|
|
492
|
+
'anthropic.claude-instant-v1': { input: 0.00163, output: 0.00551 },
|
|
493
|
+
'anthropic.claude-sonnet-4': { input: 0.003, output: 0.015 },
|
|
494
|
+
'anthropic.claude-opus-4': { input: 0.015, output: 0.075 },
|
|
495
|
+
'anthropic.claude-haiku-4': { input: 0.00025, output: 0.00125 },
|
|
496
|
+
|
|
497
|
+
// Amazon models
|
|
498
|
+
'amazon.titan-text-express-v1': { input: 0.0008, output: 0.0016 },
|
|
499
|
+
'amazon.titan-text-lite-v1': { input: 0.0003, output: 0.0004 },
|
|
500
|
+
'amazon.titan-embed-text-v1': { input: 0.0001, output: 0 },
|
|
501
|
+
'amazon.titan-embed-image-v1': { input: 0.0001, output: 0 },
|
|
502
|
+
'amazon.titan-image-generator-v1': { input: 0.008, output: 0 },
|
|
503
|
+
|
|
504
|
+
// AI21 models
|
|
505
|
+
'ai21.j2-ultra-v1': { input: 0.0128, output: 0.0128 },
|
|
506
|
+
'ai21.j2-mid-v1': { input: 0.008, output: 0.008 },
|
|
507
|
+
'ai21.j2-light-v1': { input: 0.0006, output: 0.0006 },
|
|
508
|
+
'ai21.j2-ultra-v1:0': { input: 0.0128, output: 0.0128 },
|
|
509
|
+
'ai21.j2-mid-v1:0': { input: 0.008, output: 0.008 },
|
|
510
|
+
'ai21.j2-light-v1:0': { input: 0.0006, output: 0.0006 },
|
|
511
|
+
|
|
512
|
+
// Meta models
|
|
513
|
+
'meta.llama2-13b-chat-v1': { input: 0.00075, output: 0.001 },
|
|
514
|
+
'meta.llama2-70b-chat-v1': { input: 0.00195, output: 0.00256 },
|
|
515
|
+
'meta.llama2-7b-chat-v1': { input: 0.0006, output: 0.0006 },
|
|
516
|
+
'meta.llama2-13b-chat-v1:0': { input: 0.00075, output: 0.001 },
|
|
517
|
+
'meta.llama2-70b-chat-v1:0': { input: 0.00195, output: 0.00256 },
|
|
518
|
+
'meta.llama2-7b-chat-v1:0': { input: 0.0006, output: 0.0006 },
|
|
519
|
+
'meta.llama3-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
520
|
+
'meta.llama3-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
521
|
+
'meta.llama3-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
522
|
+
|
|
523
|
+
// Cohere models
|
|
524
|
+
'cohere.command-text-v14': { input: 0.0015, output: 0.002 },
|
|
525
|
+
'cohere.command-light-text-v14': { input: 0.0003, output: 0.0006 },
|
|
526
|
+
'cohere.embed-english-v3': { input: 0.0001, output: 0 },
|
|
527
|
+
'cohere.embed-multilingual-v3': { input: 0.0001, output: 0 },
|
|
528
|
+
|
|
529
|
+
// Mistral models
|
|
530
|
+
'mistral.mistral-7b-instruct-v0:2': { input: 0.00015, output: 0.0002 },
|
|
531
|
+
'mistral.mixtral-8x7b-instruct-v0:1': { input: 0.00045, output: 0.0007 },
|
|
532
|
+
'mistral.mistral-large-2402-v1:0': { input: 0.008, output: 0.024 },
|
|
533
|
+
'mistral.mistral-small-2402-v1:0': { input: 0.001, output: 0.003 },
|
|
534
|
+
|
|
535
|
+
// Stability AI models
|
|
536
|
+
'stability.stable-diffusion-xl-v1': { input: 0.036, output: 0 }, // per image
|
|
537
|
+
'stability.stable-diffusion-xl-v1:0': { input: 0.036, output: 0 }, // per image
|
|
538
|
+
|
|
539
|
+
// TwelveLabs models
|
|
540
|
+
'twelvelabs.pegasus-1.2': { input: 0.00049, output: 0.0075 }, // per second + per token
|
|
541
|
+
'twelvelabs.marengo-embed-2.7': { input: 0.0007, output: 0.00007 }, // per minute + per request
|
|
542
|
+
|
|
543
|
+
// Writer models
|
|
544
|
+
'writer.palmyra-x-5': { input: 0.003, output: 0.015 },
|
|
545
|
+
'writer.palmyra-x-5:0': { input: 0.003, output: 0.015 },
|
|
546
|
+
},
|
|
547
|
+
|
|
548
|
+
'eu-west-1': {
|
|
549
|
+
// Anthropic models
|
|
550
|
+
'anthropic.claude-3-5-sonnet-20241022-v1:0': { input: 0.003, output: 0.015 },
|
|
551
|
+
'anthropic.claude-3-5-haiku-20241022-v1:0': { input: 0.00025, output: 0.00125 },
|
|
552
|
+
'anthropic.claude-3-opus-20240229-v1:0': { input: 0.015, output: 0.075 },
|
|
553
|
+
'anthropic.claude-3-sonnet-20240229-v1:0': { input: 0.003, output: 0.015 },
|
|
554
|
+
'anthropic.claude-3-haiku-20240307-v1:0': { input: 0.00025, output: 0.00125 },
|
|
555
|
+
'anthropic.claude-v2:1': { input: 0.008, output: 0.024 },
|
|
556
|
+
'anthropic.claude-v2': { input: 0.008, output: 0.024 },
|
|
557
|
+
'anthropic.claude-instant-v1': { input: 0.00163, output: 0.00551 },
|
|
558
|
+
|
|
559
|
+
// Amazon models
|
|
560
|
+
'amazon.titan-text-express-v1': { input: 0.0008, output: 0.0016 },
|
|
561
|
+
'amazon.titan-text-lite-v1': { input: 0.0003, output: 0.0004 },
|
|
562
|
+
'amazon.titan-embed-text-v1': { input: 0.0001, output: 0 },
|
|
563
|
+
'amazon.titan-embed-image-v1': { input: 0.0001, output: 0 },
|
|
564
|
+
'amazon.titan-image-generator-v1': { input: 0.008, output: 0 },
|
|
565
|
+
|
|
566
|
+
// AI21 models
|
|
567
|
+
'ai21.j2-ultra-v1': { input: 0.0128, output: 0.0128 },
|
|
568
|
+
'ai21.j2-mid-v1': { input: 0.008, output: 0.008 },
|
|
569
|
+
'ai21.j2-light-v1': { input: 0.0006, output: 0.0006 },
|
|
570
|
+
'ai21.j2-ultra-v1:0': { input: 0.0128, output: 0.0128 },
|
|
571
|
+
'ai21.j2-mid-v1:0': { input: 0.008, output: 0.008 },
|
|
572
|
+
'ai21.j2-light-v1:0': { input: 0.0006, output: 0.0006 },
|
|
573
|
+
|
|
574
|
+
// Meta models
|
|
575
|
+
'meta.llama2-13b-chat-v1': { input: 0.00075, output: 0.001 },
|
|
576
|
+
'meta.llama2-70b-chat-v1': { input: 0.00195, output: 0.00256 },
|
|
577
|
+
'meta.llama2-7b-chat-v1': { input: 0.0006, output: 0.0006 },
|
|
578
|
+
'meta.llama2-13b-chat-v1:0': { input: 0.00075, output: 0.001 },
|
|
579
|
+
'meta.llama2-70b-chat-v1:0': { input: 0.00195, output: 0.00256 },
|
|
580
|
+
'meta.llama2-7b-chat-v1:0': { input: 0.0006, output: 0.0006 },
|
|
581
|
+
'meta.llama3-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
582
|
+
'meta.llama3-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
583
|
+
'meta.llama3-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
584
|
+
|
|
585
|
+
// Cohere models
|
|
586
|
+
'cohere.command-text-v14': { input: 0.0015, output: 0.002 },
|
|
587
|
+
'cohere.command-light-text-v14': { input: 0.0003, output: 0.0006 },
|
|
588
|
+
'cohere.embed-english-v3': { input: 0.0001, output: 0 },
|
|
589
|
+
'cohere.embed-multilingual-v3': { input: 0.0001, output: 0 },
|
|
590
|
+
|
|
591
|
+
// Mistral models
|
|
592
|
+
'mistral.mistral-7b-instruct-v0:2': { input: 0.00015, output: 0.0002 },
|
|
593
|
+
'mistral.mixtral-8x7b-instruct-v0:1': { input: 0.00045, output: 0.0007 },
|
|
594
|
+
'mistral.mistral-large-2402-v1:0': { input: 0.008, output: 0.024 },
|
|
595
|
+
'mistral.mistral-small-2402-v1:0': { input: 0.001, output: 0.003 },
|
|
596
|
+
|
|
597
|
+
// Stability AI models
|
|
598
|
+
'stability.stable-diffusion-xl-v1': { input: 0.036, output: 0 }, // per image
|
|
599
|
+
'stability.stable-diffusion-xl-v1:0': { input: 0.036, output: 0 }, // per image
|
|
600
|
+
|
|
601
|
+
// TwelveLabs models
|
|
602
|
+
'twelvelabs.pegasus-1.2': { input: 0.00049, output: 0.0075 }, // per second + per token
|
|
603
|
+
'twelvelabs.marengo-embed-2.7': { input: 0.0007, output: 0.00007 }, // per minute + per request
|
|
604
|
+
|
|
605
|
+
// Writer models
|
|
606
|
+
'writer.palmyra-x-5': { input: 0.003, output: 0.015 },
|
|
607
|
+
'writer.palmyra-x-5:0': { input: 0.003, output: 0.015 },
|
|
608
|
+
},
|
|
609
|
+
|
|
610
|
+
'ap-southeast-1': {
|
|
611
|
+
// Anthropic models
|
|
612
|
+
'anthropic.claude-3-5-sonnet-20241022-v1:0': { input: 0.003, output: 0.015 },
|
|
613
|
+
'anthropic.claude-3-5-haiku-20241022-v1:0': { input: 0.00025, output: 0.00125 },
|
|
614
|
+
'anthropic.claude-3-opus-20240229-v1:0': { input: 0.015, output: 0.075 },
|
|
615
|
+
'anthropic.claude-3-sonnet-20240229-v1:0': { input: 0.003, output: 0.015 },
|
|
616
|
+
'anthropic.claude-3-haiku-20240307-v1:0': { input: 0.00025, output: 0.00125 },
|
|
617
|
+
'anthropic.claude-v2:1': { input: 0.008, output: 0.024 },
|
|
618
|
+
'anthropic.claude-v2': { input: 0.008, output: 0.024 },
|
|
619
|
+
'anthropic.claude-instant-v1': { input: 0.00163, output: 0.00551 },
|
|
620
|
+
|
|
621
|
+
// Amazon models
|
|
622
|
+
'amazon.titan-text-express-v1': { input: 0.0008, output: 0.0016 },
|
|
623
|
+
'amazon.titan-text-lite-v1': { input: 0.0003, output: 0.0004 },
|
|
624
|
+
'amazon.titan-embed-text-v1': { input: 0.0001, output: 0 },
|
|
625
|
+
'amazon.titan-embed-image-v1': { input: 0.0001, output: 0 },
|
|
626
|
+
'amazon.titan-image-generator-v1': { input: 0.008, output: 0 },
|
|
627
|
+
|
|
628
|
+
// AI21 models
|
|
629
|
+
'ai21.j2-ultra-v1': { input: 0.0128, output: 0.0128 },
|
|
630
|
+
'ai21.j2-mid-v1': { input: 0.008, output: 0.008 },
|
|
631
|
+
'ai21.j2-light-v1': { input: 0.0006, output: 0.0006 },
|
|
632
|
+
'ai21.j2-ultra-v1:0': { input: 0.0128, output: 0.0128 },
|
|
633
|
+
'ai21.j2-mid-v1:0': { input: 0.008, output: 0.008 },
|
|
634
|
+
'ai21.j2-light-v1:0': { input: 0.0006, output: 0.0006 },
|
|
635
|
+
|
|
636
|
+
// Meta models
|
|
637
|
+
'meta.llama2-13b-chat-v1': { input: 0.00075, output: 0.001 },
|
|
638
|
+
'meta.llama2-70b-chat-v1': { input: 0.00195, output: 0.00256 },
|
|
639
|
+
'meta.llama2-7b-chat-v1': { input: 0.0006, output: 0.0006 },
|
|
640
|
+
'meta.llama2-13b-chat-v1:0': { input: 0.00075, output: 0.001 },
|
|
641
|
+
'meta.llama2-70b-chat-v1:0': { input: 0.00195, output: 0.00256 },
|
|
642
|
+
'meta.llama2-7b-chat-v1:0': { input: 0.0006, output: 0.0006 },
|
|
643
|
+
'meta.llama3-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
644
|
+
'meta.llama3-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
645
|
+
'meta.llama3-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
646
|
+
|
|
647
|
+
// Cohere models
|
|
648
|
+
'cohere.command-text-v14': { input: 0.0015, output: 0.002 },
|
|
649
|
+
'cohere.command-light-text-v14': { input: 0.0003, output: 0.0006 },
|
|
650
|
+
'cohere.embed-english-v3': { input: 0.0001, output: 0 },
|
|
651
|
+
'cohere.embed-multilingual-v3': { input: 0.0001, output: 0 },
|
|
652
|
+
|
|
653
|
+
// Mistral models
|
|
654
|
+
'mistral.mistral-7b-instruct-v0:2': { input: 0.00015, output: 0.0002 },
|
|
655
|
+
'mistral.mixtral-8x7b-instruct-v0:1': { input: 0.00045, output: 0.0007 },
|
|
656
|
+
'mistral.mistral-large-2402-v1:0': { input: 0.008, output: 0.024 },
|
|
657
|
+
'mistral.mistral-small-2402-v1:0': { input: 0.001, output: 0.003 },
|
|
658
|
+
|
|
659
|
+
// Stability AI models
|
|
660
|
+
'stability.stable-diffusion-xl-v1': { input: 0.036, output: 0 }, // per image
|
|
661
|
+
'stability.stable-diffusion-xl-v1:0': { input: 0.036, output: 0 }, // per image
|
|
662
|
+
|
|
663
|
+
// TwelveLabs models
|
|
664
|
+
'twelvelabs.pegasus-1.2': { input: 0.00049, output: 0.0075 }, // per second + per token
|
|
665
|
+
'twelvelabs.marengo-embed-2.7': { input: 0.0007, output: 0.00007 }, // per minute + per request
|
|
666
|
+
|
|
667
|
+
// Writer models
|
|
668
|
+
'writer.palmyra-x-5': { input: 0.003, output: 0.015 },
|
|
669
|
+
'writer.palmyra-x-5:0': { input: 0.003, output: 0.015 },
|
|
670
|
+
},
|
|
671
|
+
|
|
672
|
+
// Additional regions from AWS Bedrock pricing
|
|
673
|
+
'us-west-1': {
|
|
674
|
+
// Anthropic models
|
|
675
|
+
'anthropic.claude-3-5-sonnet-20241022-v1:0': { input: 0.003, output: 0.015 },
|
|
676
|
+
'anthropic.claude-3-5-haiku-20241022-v1:0': { input: 0.00025, output: 0.00125 },
|
|
677
|
+
'anthropic.claude-3-opus-20240229-v1:0': { input: 0.015, output: 0.075 },
|
|
678
|
+
'anthropic.claude-3-sonnet-20240229-v1:0': { input: 0.003, output: 0.015 },
|
|
679
|
+
'anthropic.claude-3-haiku-20240307-v1:0': { input: 0.00025, output: 0.00125 },
|
|
680
|
+
'anthropic.claude-v2:1': { input: 0.008, output: 0.024 },
|
|
681
|
+
'anthropic.claude-v2': { input: 0.008, output: 0.024 },
|
|
682
|
+
'anthropic.claude-instant-v1': { input: 0.00163, output: 0.00551 },
|
|
683
|
+
|
|
684
|
+
// Amazon models
|
|
685
|
+
'amazon.titan-text-express-v1': { input: 0.0008, output: 0.0016 },
|
|
686
|
+
'amazon.titan-text-lite-v1': { input: 0.0003, output: 0.0004 },
|
|
687
|
+
'amazon.titan-embed-text-v1': { input: 0.0001, output: 0 },
|
|
688
|
+
'amazon.titan-embed-image-v1': { input: 0.0001, output: 0 },
|
|
689
|
+
'amazon.titan-image-generator-v1': { input: 0.008, output: 0 },
|
|
690
|
+
|
|
691
|
+
// AI21 models
|
|
692
|
+
'ai21.j2-ultra-v1': { input: 0.0128, output: 0.0128 },
|
|
693
|
+
'ai21.j2-mid-v1': { input: 0.008, output: 0.008 },
|
|
694
|
+
'ai21.j2-light-v1': { input: 0.0006, output: 0.0006 },
|
|
695
|
+
'ai21.j2-ultra-v1:0': { input: 0.0128, output: 0.0128 },
|
|
696
|
+
'ai21.j2-mid-v1:0': { input: 0.008, output: 0.008 },
|
|
697
|
+
'ai21.j2-light-v1:0': { input: 0.0006, output: 0.0006 },
|
|
698
|
+
|
|
699
|
+
// Meta models
|
|
700
|
+
'meta.llama2-13b-chat-v1': { input: 0.00075, output: 0.001 },
|
|
701
|
+
'meta.llama2-70b-chat-v1': { input: 0.00195, output: 0.00256 },
|
|
702
|
+
'meta.llama2-7b-chat-v1': { input: 0.0006, output: 0.0006 },
|
|
703
|
+
'meta.llama2-13b-chat-v1:0': { input: 0.00075, output: 0.001 },
|
|
704
|
+
'meta.llama2-70b-chat-v1:0': { input: 0.00195, output: 0.00256 },
|
|
705
|
+
'meta.llama2-7b-chat-v1:0': { input: 0.0006, output: 0.0006 },
|
|
706
|
+
'meta.llama3-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
707
|
+
'meta.llama3-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
708
|
+
'meta.llama3-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
709
|
+
|
|
710
|
+
// Cohere models
|
|
711
|
+
'cohere.command-text-v14': { input: 0.0015, output: 0.002 },
|
|
712
|
+
'cohere.command-light-text-v14': { input: 0.0003, output: 0.0006 },
|
|
713
|
+
'cohere.embed-english-v3': { input: 0.0001, output: 0 },
|
|
714
|
+
'cohere.embed-multilingual-v3': { input: 0.0001, output: 0 },
|
|
715
|
+
|
|
716
|
+
// Mistral models
|
|
717
|
+
'mistral.mistral-7b-instruct-v0:2': { input: 0.00015, output: 0.0002 },
|
|
718
|
+
'mistral.mixtral-8x7b-instruct-v0:1': { input: 0.00045, output: 0.0007 },
|
|
719
|
+
'mistral.mistral-large-2402-v1:0': { input: 0.008, output: 0.024 },
|
|
720
|
+
'mistral.mistral-small-2402-v1:0': { input: 0.001, output: 0.003 },
|
|
721
|
+
|
|
722
|
+
// Stability AI models
|
|
723
|
+
'stability.stable-diffusion-xl-v1': { input: 0.036, output: 0 }, // per image
|
|
724
|
+
'stability.stable-diffusion-xl-v1:0': { input: 0.036, output: 0 }, // per image
|
|
725
|
+
|
|
726
|
+
// TwelveLabs models
|
|
727
|
+
'twelvelabs.pegasus-1.2': { input: 0.00049, output: 0.0075 }, // per second + per token
|
|
728
|
+
'twelvelabs.marengo-embed-2.7': { input: 0.0007, output: 0.00007 }, // per minute + per request
|
|
729
|
+
|
|
730
|
+
// Writer models
|
|
731
|
+
'writer.palmyra-x-5': { input: 0.003, output: 0.015 },
|
|
732
|
+
'writer.palmyra-x-5:0': { input: 0.003, output: 0.015 },
|
|
733
|
+
},
|
|
734
|
+
|
|
735
|
+
'eu-central-1': {
|
|
736
|
+
// Anthropic models
|
|
737
|
+
'anthropic.claude-3-5-sonnet-20241022-v1:0': { input: 0.003, output: 0.015 },
|
|
738
|
+
'anthropic.claude-3-5-haiku-20241022-v1:0': { input: 0.00025, output: 0.00125 },
|
|
739
|
+
'anthropic.claude-3-opus-20240229-v1:0': { input: 0.015, output: 0.075 },
|
|
740
|
+
'anthropic.claude-3-sonnet-20240229-v1:0': { input: 0.003, output: 0.015 },
|
|
741
|
+
'anthropic.claude-3-haiku-20240307-v1:0': { input: 0.00025, output: 0.00125 },
|
|
742
|
+
'anthropic.claude-v2:1': { input: 0.008, output: 0.024 },
|
|
743
|
+
'anthropic.claude-v2': { input: 0.008, output: 0.024 },
|
|
744
|
+
'anthropic.claude-instant-v1': { input: 0.00163, output: 0.00551 },
|
|
745
|
+
|
|
746
|
+
// Amazon models
|
|
747
|
+
'amazon.titan-text-express-v1': { input: 0.0008, output: 0.0016 },
|
|
748
|
+
'amazon.titan-text-lite-v1': { input: 0.0003, output: 0.0004 },
|
|
749
|
+
'amazon.titan-embed-text-v1': { input: 0.0001, output: 0 },
|
|
750
|
+
'amazon.titan-embed-image-v1': { input: 0.0001, output: 0 },
|
|
751
|
+
'amazon.titan-image-generator-v1': { input: 0.008, output: 0 },
|
|
752
|
+
|
|
753
|
+
// AI21 models
|
|
754
|
+
'ai21.j2-ultra-v1': { input: 0.0128, output: 0.0128 },
|
|
755
|
+
'ai21.j2-mid-v1': { input: 0.008, output: 0.008 },
|
|
756
|
+
'ai21.j2-light-v1': { input: 0.0006, output: 0.0006 },
|
|
757
|
+
'ai21.j2-ultra-v1:0': { input: 0.0128, output: 0.0128 },
|
|
758
|
+
'ai21.j2-mid-v1:0': { input: 0.008, output: 0.008 },
|
|
759
|
+
'ai21.j2-light-v1:0': { input: 0.0006, output: 0.0006 },
|
|
760
|
+
|
|
761
|
+
// Meta models
|
|
762
|
+
'meta.llama2-13b-chat-v1': { input: 0.00075, output: 0.001 },
|
|
763
|
+
'meta.llama2-70b-chat-v1': { input: 0.00195, output: 0.00256 },
|
|
764
|
+
'meta.llama2-7b-chat-v1': { input: 0.0006, output: 0.0006 },
|
|
765
|
+
'meta.llama2-13b-chat-v1:0': { input: 0.00075, output: 0.001 },
|
|
766
|
+
'meta.llama2-70b-chat-v1:0': { input: 0.00195, output: 0.00256 },
|
|
767
|
+
'meta.llama2-7b-chat-v1:0': { input: 0.0006, output: 0.0006 },
|
|
768
|
+
'meta.llama3-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
769
|
+
'meta.llama3-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
770
|
+
'meta.llama3-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
771
|
+
|
|
772
|
+
// Cohere models
|
|
773
|
+
'cohere.command-text-v14': { input: 0.0015, output: 0.002 },
|
|
774
|
+
'cohere.command-light-text-v14': { input: 0.0003, output: 0.0006 },
|
|
775
|
+
'cohere.embed-english-v3': { input: 0.0001, output: 0 },
|
|
776
|
+
'cohere.embed-multilingual-v3': { input: 0.0001, output: 0 },
|
|
777
|
+
|
|
778
|
+
// Mistral models
|
|
779
|
+
'mistral.mistral-7b-instruct-v0:2': { input: 0.00015, output: 0.0002 },
|
|
780
|
+
'mistral.mixtral-8x7b-instruct-v0:1': { input: 0.00045, output: 0.0007 },
|
|
781
|
+
'mistral.mistral-large-2402-v1:0': { input: 0.008, output: 0.024 },
|
|
782
|
+
'mistral.mistral-small-2402-v1:0': { input: 0.001, output: 0.003 },
|
|
783
|
+
|
|
784
|
+
// Stability AI models
|
|
785
|
+
'stability.stable-diffusion-xl-v1': { input: 0.036, output: 0 }, // per image
|
|
786
|
+
'stability.stable-diffusion-xl-v1:0': { input: 0.036, output: 0 }, // per image
|
|
787
|
+
|
|
788
|
+
// TwelveLabs models
|
|
789
|
+
'twelvelabs.pegasus-1.2': { input: 0.00049, output: 0.0075 }, // per second + per token
|
|
790
|
+
'twelvelabs.marengo-embed-2.7': { input: 0.0007, output: 0.00007 }, // per minute + per request
|
|
791
|
+
|
|
792
|
+
// Writer models
|
|
793
|
+
'writer.palmyra-x-5': { input: 0.003, output: 0.015 },
|
|
794
|
+
'writer.palmyra-x-5:0': { input: 0.003, output: 0.015 },
|
|
795
|
+
},
|
|
796
|
+
|
|
797
|
+
'ap-northeast-1': {
|
|
798
|
+
// Anthropic models
|
|
799
|
+
'anthropic.claude-3-5-sonnet-20241022-v1:0': { input: 0.003, output: 0.015 },
|
|
800
|
+
'anthropic.claude-3-5-haiku-20241022-v1:0': { input: 0.00025, output: 0.00125 },
|
|
801
|
+
'anthropic.claude-3-opus-20240229-v1:0': { input: 0.015, output: 0.075 },
|
|
802
|
+
'anthropic.claude-3-sonnet-20240229-v1:0': { input: 0.003, output: 0.015 },
|
|
803
|
+
'anthropic.claude-3-haiku-20240307-v1:0': { input: 0.00025, output: 0.00125 },
|
|
804
|
+
'anthropic.claude-v2:1': { input: 0.008, output: 0.024 },
|
|
805
|
+
'anthropic.claude-v2': { input: 0.008, output: 0.024 },
|
|
806
|
+
'anthropic.claude-instant-v1': { input: 0.00163, output: 0.00551 },
|
|
807
|
+
|
|
808
|
+
// Amazon models
|
|
809
|
+
'amazon.titan-text-express-v1': { input: 0.0008, output: 0.0016 },
|
|
810
|
+
'amazon.titan-text-lite-v1': { input: 0.0003, output: 0.0004 },
|
|
811
|
+
'amazon.titan-embed-text-v1': { input: 0.0001, output: 0 },
|
|
812
|
+
'amazon.titan-embed-image-v1': { input: 0.0001, output: 0 },
|
|
813
|
+
'amazon.titan-image-generator-v1': { input: 0.008, output: 0 },
|
|
814
|
+
|
|
815
|
+
// AI21 models
|
|
816
|
+
'ai21.j2-ultra-v1': { input: 0.0128, output: 0.0128 },
|
|
817
|
+
'ai21.j2-mid-v1': { input: 0.008, output: 0.008 },
|
|
818
|
+
'ai21.j2-light-v1': { input: 0.0006, output: 0.0006 },
|
|
819
|
+
'ai21.j2-ultra-v1:0': { input: 0.0128, output: 0.0128 },
|
|
820
|
+
'ai21.j2-mid-v1:0': { input: 0.008, output: 0.008 },
|
|
821
|
+
'ai21.j2-light-v1:0': { input: 0.0006, output: 0.0006 },
|
|
822
|
+
|
|
823
|
+
// Meta models
|
|
824
|
+
'meta.llama2-13b-chat-v1': { input: 0.00075, output: 0.001 },
|
|
825
|
+
'meta.llama2-70b-chat-v1': { input: 0.00195, output: 0.00256 },
|
|
826
|
+
'meta.llama2-7b-chat-v1': { input: 0.0006, output: 0.0006 },
|
|
827
|
+
'meta.llama2-13b-chat-v1:0': { input: 0.00075, output: 0.001 },
|
|
828
|
+
'meta.llama2-70b-chat-v1:0': { input: 0.00195, output: 0.00256 },
|
|
829
|
+
'meta.llama2-7b-chat-v1:0': { input: 0.0006, output: 0.0006 },
|
|
830
|
+
'meta.llama3-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
831
|
+
'meta.llama3-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
832
|
+
'meta.llama3-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
833
|
+
|
|
834
|
+
// Cohere models
|
|
835
|
+
'cohere.command-text-v14': { input: 0.0015, output: 0.002 },
|
|
836
|
+
'cohere.command-light-text-v14': { input: 0.0003, output: 0.0006 },
|
|
837
|
+
'cohere.embed-english-v3': { input: 0.0001, output: 0 },
|
|
838
|
+
'cohere.embed-multilingual-v3': { input: 0.0001, output: 0 },
|
|
839
|
+
|
|
840
|
+
// Mistral models
|
|
841
|
+
'mistral.mistral-7b-instruct-v0:2': { input: 0.00015, output: 0.0002 },
|
|
842
|
+
'mistral.mixtral-8x7b-instruct-v0:1': { input: 0.00045, output: 0.0007 },
|
|
843
|
+
'mistral.mistral-large-2402-v1:0': { input: 0.008, output: 0.024 },
|
|
844
|
+
'mistral.mistral-small-2402-v1:0': { input: 0.001, output: 0.003 },
|
|
845
|
+
|
|
846
|
+
// Stability AI models
|
|
847
|
+
'stability.stable-diffusion-xl-v1': { input: 0.036, output: 0 }, // per image
|
|
848
|
+
'stability.stable-diffusion-xl-v1:0': { input: 0.036, output: 0 }, // per image
|
|
849
|
+
|
|
850
|
+
// TwelveLabs models
|
|
851
|
+
'twelvelabs.pegasus-1.2': { input: 0.00049, output: 0.0075 }, // per second + per token
|
|
852
|
+
'twelvelabs.marengo-embed-2.7': { input: 0.0007, output: 0.00007 }, // per minute + per request
|
|
853
|
+
|
|
854
|
+
// Writer models
|
|
855
|
+
'writer.palmyra-x-5': { input: 0.003, output: 0.015 },
|
|
856
|
+
'writer.palmyra-x-5:0': { input: 0.003, output: 0.015 },
|
|
857
|
+
},
|
|
858
|
+
|
|
859
|
+
'ap-south-1': {
|
|
860
|
+
// Anthropic models
|
|
861
|
+
'anthropic.claude-3-5-sonnet-20241022-v1:0': { input: 0.003, output: 0.015 },
|
|
862
|
+
'anthropic.claude-3-5-haiku-20241022-v1:0': { input: 0.00025, output: 0.00125 },
|
|
863
|
+
'anthropic.claude-3-opus-20240229-v1:0': { input: 0.015, output: 0.075 },
|
|
864
|
+
'anthropic.claude-3-sonnet-20240229-v1:0': { input: 0.003, output: 0.015 },
|
|
865
|
+
'anthropic.claude-3-haiku-20240307-v1:0': { input: 0.00025, output: 0.00125 },
|
|
866
|
+
'anthropic.claude-v2:1': { input: 0.008, output: 0.024 },
|
|
867
|
+
'anthropic.claude-v2': { input: 0.008, output: 0.024 },
|
|
868
|
+
'anthropic.claude-instant-v1': { input: 0.00163, output: 0.00551 },
|
|
869
|
+
|
|
870
|
+
// Amazon models
|
|
871
|
+
'amazon.titan-text-express-v1': { input: 0.0008, output: 0.0016 },
|
|
872
|
+
'amazon.titan-text-lite-v1': { input: 0.0003, output: 0.0004 },
|
|
873
|
+
'amazon.titan-embed-text-v1': { input: 0.0001, output: 0 },
|
|
874
|
+
'amazon.titan-embed-image-v1': { input: 0.0001, output: 0 },
|
|
875
|
+
'amazon.titan-image-generator-v1': { input: 0.008, output: 0 },
|
|
876
|
+
|
|
877
|
+
// AI21 models
|
|
878
|
+
'ai21.j2-ultra-v1': { input: 0.0128, output: 0.0128 },
|
|
879
|
+
'ai21.j2-mid-v1': { input: 0.008, output: 0.008 },
|
|
880
|
+
'ai21.j2-light-v1': { input: 0.0006, output: 0.0006 },
|
|
881
|
+
'ai21.j2-ultra-v1:0': { input: 0.0128, output: 0.0128 },
|
|
882
|
+
'ai21.j2-mid-v1:0': { input: 0.008, output: 0.008 },
|
|
883
|
+
'ai21.j2-light-v1:0': { input: 0.0006, output: 0.0006 },
|
|
884
|
+
|
|
885
|
+
// Meta models
|
|
886
|
+
'meta.llama2-13b-chat-v1': { input: 0.00075, output: 0.001 },
|
|
887
|
+
'meta.llama2-70b-chat-v1': { input: 0.00195, output: 0.00256 },
|
|
888
|
+
'meta.llama2-7b-chat-v1': { input: 0.0006, output: 0.0006 },
|
|
889
|
+
'meta.llama2-13b-chat-v1:0': { input: 0.00075, output: 0.001 },
|
|
890
|
+
'meta.llama2-70b-chat-v1:0': { input: 0.00195, output: 0.00256 },
|
|
891
|
+
'meta.llama2-7b-chat-v1:0': { input: 0.0006, output: 0.0006 },
|
|
892
|
+
'meta.llama3-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
893
|
+
'meta.llama3-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
894
|
+
'meta.llama3-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
895
|
+
|
|
896
|
+
// Cohere models
|
|
897
|
+
'cohere.command-text-v14': { input: 0.0015, output: 0.002 },
|
|
898
|
+
'cohere.command-light-text-v14': { input: 0.0003, output: 0.0006 },
|
|
899
|
+
'cohere.embed-english-v3': { input: 0.0001, output: 0 },
|
|
900
|
+
'cohere.embed-multilingual-v3': { input: 0.0001, output: 0 },
|
|
901
|
+
|
|
902
|
+
// Mistral models
|
|
903
|
+
'mistral.mistral-7b-instruct-v0:2': { input: 0.00015, output: 0.0002 },
|
|
904
|
+
'mistral.mixtral-8x7b-instruct-v0:1': { input: 0.00045, output: 0.0007 },
|
|
905
|
+
'mistral.mistral-large-2402-v1:0': { input: 0.008, output: 0.024 },
|
|
906
|
+
'mistral.mistral-small-2402-v1:0': { input: 0.001, output: 0.003 },
|
|
907
|
+
|
|
908
|
+
// Stability AI models
|
|
909
|
+
'stability.stable-diffusion-xl-v1': { input: 0.036, output: 0 }, // per image
|
|
910
|
+
'stability.stable-diffusion-xl-v1:0': { input: 0.036, output: 0 }, // per image
|
|
911
|
+
|
|
912
|
+
// TwelveLabs models
|
|
913
|
+
'twelvelabs.pegasus-1.2': { input: 0.00049, output: 0.0075 }, // per second + per token
|
|
914
|
+
'twelvelabs.marengo-embed-2.7': { input: 0.0007, output: 0.00007 }, // per minute + per request
|
|
915
|
+
|
|
916
|
+
// Writer models
|
|
917
|
+
'writer.palmyra-x-5': { input: 0.003, output: 0.015 },
|
|
918
|
+
'writer.palmyra-x-5:0': { input: 0.003, output: 0.015 },
|
|
919
|
+
},
|
|
920
|
+
|
|
921
|
+
'ca-central-1': {
|
|
922
|
+
// Anthropic models
|
|
923
|
+
'anthropic.claude-3-5-sonnet-20241022-v1:0': { input: 0.003, output: 0.015 },
|
|
924
|
+
'anthropic.claude-3-5-haiku-20241022-v1:0': { input: 0.00025, output: 0.00125 },
|
|
925
|
+
'anthropic.claude-3-opus-20240229-v1:0': { input: 0.015, output: 0.075 },
|
|
926
|
+
'anthropic.claude-3-sonnet-20240229-v1:0': { input: 0.003, output: 0.015 },
|
|
927
|
+
'anthropic.claude-3-haiku-20240307-v1:0': { input: 0.00025, output: 0.00125 },
|
|
928
|
+
'anthropic.claude-v2:1': { input: 0.008, output: 0.024 },
|
|
929
|
+
'anthropic.claude-v2': { input: 0.008, output: 0.024 },
|
|
930
|
+
'anthropic.claude-instant-v1': { input: 0.00163, output: 0.00551 },
|
|
931
|
+
|
|
932
|
+
// Amazon models
|
|
933
|
+
'amazon.titan-text-express-v1': { input: 0.0008, output: 0.0016 },
|
|
934
|
+
'amazon.titan-text-lite-v1': { input: 0.0003, output: 0.0004 },
|
|
935
|
+
'amazon.titan-embed-text-v1': { input: 0.0001, output: 0 },
|
|
936
|
+
'amazon.titan-embed-image-v1': { input: 0.0001, output: 0 },
|
|
937
|
+
'amazon.titan-image-generator-v1': { input: 0.008, output: 0 },
|
|
938
|
+
|
|
939
|
+
// AI21 models
|
|
940
|
+
'ai21.j2-ultra-v1': { input: 0.0128, output: 0.0128 },
|
|
941
|
+
'ai21.j2-mid-v1': { input: 0.008, output: 0.008 },
|
|
942
|
+
'ai21.j2-light-v1': { input: 0.0006, output: 0.0006 },
|
|
943
|
+
'ai21.j2-ultra-v1:0': { input: 0.0128, output: 0.0128 },
|
|
944
|
+
'ai21.j2-mid-v1:0': { input: 0.008, output: 0.008 },
|
|
945
|
+
'ai21.j2-light-v1:0': { input: 0.0006, output: 0.0006 },
|
|
946
|
+
|
|
947
|
+
// Meta models
|
|
948
|
+
'meta.llama2-13b-chat-v1': { input: 0.00075, output: 0.001 },
|
|
949
|
+
'meta.llama2-70b-chat-v1': { input: 0.00195, output: 0.00256 },
|
|
950
|
+
'meta.llama2-7b-chat-v1': { input: 0.0006, output: 0.0006 },
|
|
951
|
+
'meta.llama2-13b-chat-v1:0': { input: 0.00075, output: 0.001 },
|
|
952
|
+
'meta.llama2-70b-chat-v1:0': { input: 0.00195, output: 0.00256 },
|
|
953
|
+
'meta.llama2-7b-chat-v1:0': { input: 0.0006, output: 0.0006 },
|
|
954
|
+
'meta.llama3-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
955
|
+
'meta.llama3-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
956
|
+
'meta.llama3-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
957
|
+
|
|
958
|
+
// Cohere models
|
|
959
|
+
'cohere.command-text-v14': { input: 0.0015, output: 0.002 },
|
|
960
|
+
'cohere.command-light-text-v14': { input: 0.0003, output: 0.0006 },
|
|
961
|
+
'cohere.embed-english-v3': { input: 0.0001, output: 0 },
|
|
962
|
+
'cohere.embed-multilingual-v3': { input: 0.0001, output: 0 },
|
|
963
|
+
|
|
964
|
+
// Mistral models
|
|
965
|
+
'mistral.mistral-7b-instruct-v0:2': { input: 0.00015, output: 0.0002 },
|
|
966
|
+
'mistral.mixtral-8x7b-instruct-v0:1': { input: 0.00045, output: 0.0007 },
|
|
967
|
+
'mistral.mistral-large-2402-v1:0': { input: 0.008, output: 0.024 },
|
|
968
|
+
'mistral.mistral-small-2402-v1:0': { input: 0.001, output: 0.003 },
|
|
969
|
+
|
|
970
|
+
// Stability AI models
|
|
971
|
+
'stability.stable-diffusion-xl-v1': { input: 0.036, output: 0 }, // per image
|
|
972
|
+
'stability.stable-diffusion-xl-v1:0': { input: 0.036, output: 0 }, // per image
|
|
973
|
+
|
|
974
|
+
// TwelveLabs models
|
|
975
|
+
'twelvelabs.pegasus-1.2': { input: 0.00049, output: 0.0075 }, // per second + per token
|
|
976
|
+
'twelvelabs.marengo-embed-2.7': { input: 0.0007, output: 0.00007 }, // per minute + per request
|
|
977
|
+
|
|
978
|
+
// Writer models
|
|
979
|
+
'writer.palmyra-x-5': { input: 0.003, output: 0.015 },
|
|
980
|
+
'writer.palmyra-x-5:0': { input: 0.003, output: 0.015 },
|
|
981
|
+
},
|
|
982
|
+
|
|
983
|
+
'sa-east-1': {
|
|
984
|
+
// Anthropic models
|
|
985
|
+
'anthropic.claude-3-5-sonnet-20241022-v1:0': { input: 0.003, output: 0.015 },
|
|
986
|
+
'anthropic.claude-3-5-haiku-20241022-v1:0': { input: 0.00025, output: 0.00125 },
|
|
987
|
+
'anthropic.claude-3-opus-20240229-v1:0': { input: 0.015, output: 0.075 },
|
|
988
|
+
'anthropic.claude-3-sonnet-20240229-v1:0': { input: 0.003, output: 0.015 },
|
|
989
|
+
'anthropic.claude-3-haiku-20240307-v1:0': { input: 0.00025, output: 0.00125 },
|
|
990
|
+
'anthropic.claude-v2:1': { input: 0.008, output: 0.024 },
|
|
991
|
+
'anthropic.claude-v2': { input: 0.008, output: 0.024 },
|
|
992
|
+
'anthropic.claude-instant-v1': { input: 0.00163, output: 0.00551 },
|
|
993
|
+
|
|
994
|
+
// Amazon models
|
|
995
|
+
'amazon.titan-text-express-v1': { input: 0.0008, output: 0.0016 },
|
|
996
|
+
'amazon.titan-text-lite-v1': { input: 0.0003, output: 0.0004 },
|
|
997
|
+
'amazon.titan-embed-text-v1': { input: 0.0001, output: 0 },
|
|
998
|
+
'amazon.titan-embed-image-v1': { input: 0.0001, output: 0 },
|
|
999
|
+
'amazon.titan-image-generator-v1': { input: 0.008, output: 0 },
|
|
1000
|
+
|
|
1001
|
+
// AI21 models
|
|
1002
|
+
'ai21.j2-ultra-v1': { input: 0.0128, output: 0.0128 },
|
|
1003
|
+
'ai21.j2-mid-v1': { input: 0.008, output: 0.008 },
|
|
1004
|
+
'ai21.j2-light-v1': { input: 0.0006, output: 0.0006 },
|
|
1005
|
+
'ai21.j2-ultra-v1:0': { input: 0.0128, output: 0.0128 },
|
|
1006
|
+
'ai21.j2-mid-v1:0': { input: 0.008, output: 0.008 },
|
|
1007
|
+
'ai21.j2-light-v1:0': { input: 0.0006, output: 0.0006 },
|
|
1008
|
+
|
|
1009
|
+
// Meta models
|
|
1010
|
+
'meta.llama2-13b-chat-v1': { input: 0.00075, output: 0.001 },
|
|
1011
|
+
'meta.llama2-70b-chat-v1': { input: 0.00195, output: 0.00256 },
|
|
1012
|
+
'meta.llama2-7b-chat-v1': { input: 0.0006, output: 0.0006 },
|
|
1013
|
+
'meta.llama2-13b-chat-v1:0': { input: 0.00075, output: 0.001 },
|
|
1014
|
+
'meta.llama2-70b-chat-v1:0': { input: 0.00195, output: 0.00256 },
|
|
1015
|
+
'meta.llama2-7b-chat-v1:0': { input: 0.0006, output: 0.0006 },
|
|
1016
|
+
'meta.llama3-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
1017
|
+
'meta.llama3-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
1018
|
+
'meta.llama3-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
1019
|
+
|
|
1020
|
+
// Cohere models
|
|
1021
|
+
'cohere.command-text-v14': { input: 0.0015, output: 0.002 },
|
|
1022
|
+
'cohere.command-light-text-v14': { input: 0.0003, output: 0.0006 },
|
|
1023
|
+
'cohere.embed-english-v3': { input: 0.0001, output: 0 },
|
|
1024
|
+
'cohere.embed-multilingual-v3': { input: 0.0001, output: 0 },
|
|
1025
|
+
|
|
1026
|
+
// Mistral models
|
|
1027
|
+
'mistral.mistral-7b-instruct-v0:2': { input: 0.00015, output: 0.0002 },
|
|
1028
|
+
'mistral.mixtral-8x7b-instruct-v0:1': { input: 0.00045, output: 0.0007 },
|
|
1029
|
+
'mistral.mistral-large-2402-v1:0': { input: 0.008, output: 0.024 },
|
|
1030
|
+
'mistral.mistral-small-2402-v1:0': { input: 0.001, output: 0.003 },
|
|
1031
|
+
|
|
1032
|
+
// Stability AI models
|
|
1033
|
+
'stability.stable-diffusion-xl-v1': { input: 0.036, output: 0 }, // per image
|
|
1034
|
+
'stability.stable-diffusion-xl-v1:0': { input: 0.036, output: 0 }, // per image
|
|
1035
|
+
|
|
1036
|
+
// TwelveLabs models
|
|
1037
|
+
'twelvelabs.pegasus-1.2': { input: 0.00049, output: 0.0075 }, // per second + per token
|
|
1038
|
+
'twelvelabs.marengo-embed-2.7': { input: 0.0007, output: 0.00007 }, // per minute + per request
|
|
1039
|
+
|
|
1040
|
+
// Writer models
|
|
1041
|
+
'writer.palmyra-x-5': { input: 0.003, output: 0.015 },
|
|
1042
|
+
'writer.palmyra-x-5:0': { input: 0.003, output: 0.015 },
|
|
1043
|
+
},
|
|
1044
|
+
|
|
1045
|
+
'ap-northeast-2': {
|
|
1046
|
+
// Anthropic models
|
|
1047
|
+
'anthropic.claude-3-5-sonnet-20241022-v1:0': { input: 0.003, output: 0.015 },
|
|
1048
|
+
'anthropic.claude-3-5-haiku-20241022-v1:0': { input: 0.00025, output: 0.00125 },
|
|
1049
|
+
'anthropic.claude-3-opus-20240229-v1:0': { input: 0.015, output: 0.075 },
|
|
1050
|
+
'anthropic.claude-3-sonnet-20240229-v1:0': { input: 0.003, output: 0.015 },
|
|
1051
|
+
'anthropic.claude-3-haiku-20240307-v1:0': { input: 0.00025, output: 0.00125 },
|
|
1052
|
+
'anthropic.claude-v2:1': { input: 0.008, output: 0.024 },
|
|
1053
|
+
'anthropic.claude-v2': { input: 0.008, output: 0.024 },
|
|
1054
|
+
'anthropic.claude-instant-v1': { input: 0.00163, output: 0.00551 },
|
|
1055
|
+
'anthropic.claude-sonnet-4': { input: 0.003, output: 0.015 },
|
|
1056
|
+
'anthropic.claude-opus-4': { input: 0.015, output: 0.075 },
|
|
1057
|
+
'anthropic.claude-haiku-4': { input: 0.00025, output: 0.00125 },
|
|
1058
|
+
|
|
1059
|
+
// Amazon models
|
|
1060
|
+
'amazon.titan-text-express-v1': { input: 0.0008, output: 0.0016 },
|
|
1061
|
+
'amazon.titan-text-lite-v1': { input: 0.0003, output: 0.0004 },
|
|
1062
|
+
'amazon.titan-embed-text-v1': { input: 0.0001, output: 0 },
|
|
1063
|
+
'amazon.titan-embed-image-v1': { input: 0.0001, output: 0 },
|
|
1064
|
+
'amazon.titan-image-generator-v1': { input: 0.008, output: 0 },
|
|
1065
|
+
|
|
1066
|
+
// AI21 models
|
|
1067
|
+
'ai21.j2-ultra-v1': { input: 0.0128, output: 0.0128 },
|
|
1068
|
+
'ai21.j2-mid-v1': { input: 0.008, output: 0.008 },
|
|
1069
|
+
'ai21.j2-light-v1': { input: 0.0006, output: 0.0006 },
|
|
1070
|
+
'ai21.j2-ultra-v1:0': { input: 0.0128, output: 0.0128 },
|
|
1071
|
+
'ai21.j2-mid-v1:0': { input: 0.008, output: 0.008 },
|
|
1072
|
+
'ai21.j2-light-v1:0': { input: 0.0006, output: 0.0006 },
|
|
1073
|
+
|
|
1074
|
+
// Meta models
|
|
1075
|
+
'meta.llama2-13b-chat-v1': { input: 0.00075, output: 0.001 },
|
|
1076
|
+
'meta.llama2-70b-chat-v1': { input: 0.00195, output: 0.00256 },
|
|
1077
|
+
'meta.llama2-7b-chat-v1': { input: 0.0006, output: 0.0006 },
|
|
1078
|
+
'meta.llama2-13b-chat-v1:0': { input: 0.00075, output: 0.001 },
|
|
1079
|
+
'meta.llama2-70b-chat-v1:0': { input: 0.00195, output: 0.00256 },
|
|
1080
|
+
'meta.llama2-7b-chat-v1:0': { input: 0.0006, output: 0.0006 },
|
|
1081
|
+
'meta.llama3-8b-instruct-v1:0': { input: 0.0002, output: 0.0002 },
|
|
1082
|
+
'meta.llama3-70b-instruct-v1:0': { input: 0.0008, output: 0.0008 },
|
|
1083
|
+
'meta.llama3-405b-instruct-v1:0': { input: 0.0012, output: 0.0012 },
|
|
1084
|
+
|
|
1085
|
+
// Cohere models
|
|
1086
|
+
'cohere.command-text-v14': { input: 0.0015, output: 0.002 },
|
|
1087
|
+
'cohere.command-light-text-v14': { input: 0.0003, output: 0.0006 },
|
|
1088
|
+
'cohere.embed-english-v3': { input: 0.0001, output: 0 },
|
|
1089
|
+
'cohere.embed-multilingual-v3': { input: 0.0001, output: 0 },
|
|
1090
|
+
|
|
1091
|
+
// Mistral models
|
|
1092
|
+
'mistral.mistral-7b-instruct-v0:2': { input: 0.00015, output: 0.0002 },
|
|
1093
|
+
'mistral.mixtral-8x7b-instruct-v0:1': { input: 0.00045, output: 0.0007 },
|
|
1094
|
+
'mistral.mistral-large-2402-v1:0': { input: 0.008, output: 0.024 },
|
|
1095
|
+
'mistral.mistral-small-2402-v1:0': { input: 0.001, output: 0.003 },
|
|
1096
|
+
|
|
1097
|
+
// Stability AI models
|
|
1098
|
+
'stability.stable-diffusion-xl-v1': { input: 0.036, output: 0 }, // per image
|
|
1099
|
+
'stability.stable-diffusion-xl-v1:0': { input: 0.036, output: 0 }, // per image
|
|
1100
|
+
|
|
1101
|
+
// TwelveLabs models
|
|
1102
|
+
'twelvelabs.pegasus-1.2': { input: 0.00049, output: 0.0075 }, // per second + per token
|
|
1103
|
+
'twelvelabs.marengo-embed-2.7': { input: 0.0007, output: 0.00007 }, // per minute + per request
|
|
1104
|
+
|
|
1105
|
+
// Writer models
|
|
1106
|
+
'writer.palmyra-x-5': { input: 0.003, output: 0.015 },
|
|
1107
|
+
'writer.palmyra-x-5:0': { input: 0.003, output: 0.015 },
|
|
1108
|
+
},
|
|
1109
|
+
};
|
|
1110
|
+
|
|
1111
|
+
function calculateCost(
|
|
1112
|
+
promptTokens: number,
|
|
1113
|
+
completionTokens: number,
|
|
1114
|
+
model: string | null,
|
|
1115
|
+
region: string = 'us-east-1',
|
|
1116
|
+
): number | null {
|
|
1117
|
+
if (!model || promptTokens <= 0 || completionTokens <= 0) {
|
|
1118
|
+
return null;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
const regionPricing = BedrockPricing[region];
|
|
1122
|
+
if (!regionPricing) {
|
|
1123
|
+
console.warn(`No pricing information available for region: ${region}`);
|
|
1124
|
+
return null;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
const pricing =
|
|
1128
|
+
regionPricing[model] ?? Object.entries(regionPricing).find(([key]) => model.startsWith(key))?.[1];
|
|
1129
|
+
if (!pricing) {
|
|
1130
|
+
console.warn(`No pricing information available for model: ${model} in region: ${region}`);
|
|
1131
|
+
return null;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
const inputCost = (promptTokens / 1000) * pricing['input'];
|
|
1135
|
+
const outputCost = (completionTokens / 1000) * pricing['output'];
|
|
1136
|
+
|
|
1137
|
+
return inputCost + outputCost;
|
|
1138
|
+
}
|