🤖 feat: Support for new AWS Nova Models & Updated Anthropic Rates (#4852)

* updated Claude 3.5 Haiku pricing

https://www.anthropic.com/pricing#anthropic-api
Claude 3.5 Haiku
$0.80 / MTok
Input
$1 / MTok
Prompt caching write
$0.08 / MTok
Prompt caching read
$4 / MTok
Output

* Update tx.js

* refactor: fix tests for cache multiplier and add new AWS models

---------

Co-authored-by: khfung <68192841+khfung@users.noreply.github.com>
This commit is contained in:
Danny Avila 2024-12-03 22:25:15 -05:00 committed by GitHub
parent d6f7279bce
commit ebae494337
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 43 additions and 11 deletions

View file

@ -30,6 +30,9 @@ const bedrockValues = {
'amazon.titan-text-lite-v1': { prompt: 0.15, completion: 0.2 },
'amazon.titan-text-express-v1': { prompt: 0.2, completion: 0.6 },
'amazon.titan-text-premier-v1:0': { prompt: 0.5, completion: 1.5 },
'amazon.nova-micro-v1:0': { prompt: 0.035, completion: 0.14 },
'amazon.nova-lite-v1:0': { prompt: 0.06, completion: 0.24 },
'amazon.nova-pro-v1:0': { prompt: 0.8, completion: 3.2 },
};
/**
@ -56,8 +59,8 @@ const tokenValues = Object.assign(
'claude-3-sonnet': { prompt: 3, completion: 15 },
'claude-3-5-sonnet': { prompt: 3, completion: 15 },
'claude-3.5-sonnet': { prompt: 3, completion: 15 },
'claude-3-5-haiku': { prompt: 1, completion: 5 },
'claude-3.5-haiku': { prompt: 1, completion: 5 },
'claude-3-5-haiku': { prompt: 0.8, completion: 4 },
'claude-3.5-haiku': { prompt: 0.8, completion: 4 },
'claude-3-haiku': { prompt: 0.25, completion: 1.25 },
'claude-2.1': { prompt: 8, completion: 24 },
'claude-2': { prompt: 8, completion: 24 },
@ -83,8 +86,8 @@ const tokenValues = Object.assign(
const cacheTokenValues = {
'claude-3.5-sonnet': { write: 3.75, read: 0.3 },
'claude-3-5-sonnet': { write: 3.75, read: 0.3 },
'claude-3.5-haiku': { write: 1.25, read: 0.1 },
'claude-3-5-haiku': { write: 1.25, read: 0.1 },
'claude-3.5-haiku': { write: 1, read: 0.08 },
'claude-3-5-haiku': { write: 1, read: 0.08 },
'claude-3-haiku': { write: 0.3, read: 0.03 },
};
@ -208,4 +211,11 @@ const getCacheMultiplier = ({ valueKey, cacheType, model, endpoint, endpointToke
return cacheTokenValues[valueKey]?.[cacheType] ?? null;
};
module.exports = { tokenValues, getValueKey, getMultiplier, getCacheMultiplier, defaultRate };
module.exports = {
tokenValues,
getValueKey,
getMultiplier,
getCacheMultiplier,
defaultRate,
cacheTokenValues,
};