Skip to content

Commit

Permalink
feat: Add pricing information for new AI models (#43)
Browse files Browse the repository at this point in the history
This commit adds pricing information for new AI models from different
providers. The models include GPT Models from OpenAI, Claude Models from
Anthropic, Gemini Models from Google, and Mistral Models.
  • Loading branch information
OdinSweng authored Aug 16, 2024
2 parents 1df4cda + 2beb97c commit d757161
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 9 deletions.
74 changes: 74 additions & 0 deletions src/utils/llmCostCalculator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {logger} from "./logger";

const modelsPricing = [
// GPT Models from OpenAI
{
"modelCode": "gpt-4o-mini",
"provider": "openai",
Expand Down Expand Up @@ -42,6 +43,79 @@ const modelsPricing = [
"inputPricePerMillionTokens": 30.00,
"outputPricePerMillionTokens": 60.00,
"features": "Latest generation AI"
},
// Claude Models from Anthropic
{
"modelCode": "claude-3-5-sonnet-20240620",
"provider": "anthropic",
"inputPricePerMillionTokens": 3,
"outputPricePerMillionTokens": 15,
"features": "Highest level of intelligence and capability"
},
{
"modelCode": "claude-3-opus-20240229",
"provider": "anthropic",
"inputPricePerMillionTokens": 15,
"outputPricePerMillionTokens": 75,
"features": "Top-level performance, intelligence, fluency, and understanding"
},
{
"modelCode": "claude-3-sonnet-20240229",
"provider": "anthropic",
"inputPricePerMillionTokens": 3,
"outputPricePerMillionTokens": 15,
"features": "Strong utility, balanced for scaled deployments"
},
{
"modelCode": "claude-3-haiku-20240307",
"provider": "anthropic",
"inputPricePerMillionTokens": 0.25,
"outputPricePerMillionTokens": 1.25,
"features": "Quick and accurate targeted performance"
},
// Gemini Models from Google
{
"modelCode": "gemini-1.5-flash",
"provider": "google",
"inputPricePerMillionTokens": 0.35,
"outputPricePerMillionTokens": 1.05,
"features": "Fast multimodal model with 1 million token context window"
},
{
"modelCode": "gemini-1.5-pro",
"provider": "google",
"inputPricePerMillionTokens": 3.50,
"outputPricePerMillionTokens": 10.50,
"features": "Next-generation model with 2 million token context window"
},
{
"modelCode": "gemini-1.0-pro",
"provider": "google",
"inputPricePerMillionTokens": 0.50,
"outputPricePerMillionTokens": 1.50,
"features": "First-generation model, only text and image reasoning"
},
// Mistral Models
{
"modelCode": "open-mistral-nemo-2407",
"provider": "mistral",
"inputPricePerMillionTokens": 0.3,
"outputPricePerMillionTokens": 0.3,
"features": "Mistral Nemo is a state-of-the-art 12B model developed with NVIDIA"
},
{
"modelCode": "mistral-large-2407",
"provider": "mistral",
"inputPricePerMillionTokens": 3,
"outputPricePerMillionTokens": 9,
"features": "Top-tier reasoning for high-complexity tasks, for your most sophisticated needs"
},
{
"modelCode": "codestral-2405",
"provider": "mistral",
"inputPricePerMillionTokens": 1,
"outputPricePerMillionTokens": 3,
"features": "State-of-the-art Mistral model trained specifically for code tasks"
}
];

Expand Down
18 changes: 9 additions & 9 deletions tests/e2e/__snapshots__/sportNewsTeam.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6922,9 +6922,9 @@ This victory was a testament to the team's unwavering spirit, their ability to o
"logType": "TaskStatusUpdate",
"metadata": {
"costDetails": {
"costInputTokens": -1,
"costOutputTokens": -1,
"totalCost": -1,
"costInputTokens": 0.0121,
"costOutputTokens": 0.0031,
"totalCost": 0.0152,
},
"duration": "[REDACTED]",
"endTime": "[REDACTED]",
Expand Down Expand Up @@ -25140,9 +25140,9 @@ This victory was a testament to the team's unwavering spirit, their ability to o
"logType": "TaskStatusUpdate",
"metadata": {
"costDetails": {
"costInputTokens": -1,
"costOutputTokens": -1,
"totalCost": -1,
"costInputTokens": 0.0488,
"costOutputTokens": 0.0164,
"totalCost": 0.0652,
},
"duration": "[REDACTED]",
"endTime": "[REDACTED]",
Expand Down Expand Up @@ -25354,9 +25354,9 @@ This victory was a testament to the team's unwavering spirit, their ability to o
"metadata": {
"agentCount": 2,
"costDetails": {
"costInputTokens": -1,
"costOutputTokens": -1,
"totalCost": -1,
"costInputTokens": 0.061,
"costOutputTokens": 0.0195,
"totalCost": 0.0805,
},
"duration": "[REDACTED]",
"endTime": "[REDACTED]",
Expand Down

0 comments on commit d757161

Please sign in to comment.