Skip to content

Commit

Permalink
added 3.3 cost
Browse files Browse the repository at this point in the history
  • Loading branch information
chitalian committed Jan 23, 2025
1 parent 7a392e4 commit bd4c5de
Show file tree
Hide file tree
Showing 24 changed files with 941 additions and 383 deletions.
2 changes: 1 addition & 1 deletion bifrost/lib/clients/jawnTypes/private.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ Json: JsonObject;
};
"Result_ScoreV2-or-null.string_": components["schemas"]["ResultSuccess_ScoreV2-or-null_"] | components["schemas"]["ResultError_string_"];
/** @enum {string} */
ProviderName: "OPENAI" | "ANTHROPIC" | "AZURE" | "LOCAL" | "HELICONE" | "AMDBARTEK" | "ANYSCALE" | "CLOUDFLARE" | "2YFV" | "TOGETHER" | "LEMONFOX" | "FIREWORKS" | "PERPLEXITY" | "GOOGLE" | "OPENROUTER" | "WISDOMINANUTSHELL" | "GROQ" | "COHERE" | "MISTRAL" | "DEEPINFRA" | "QSTASH" | "FIRECRAWL" | "AWS" | "DEEPSEEK";
ProviderName: "OPENAI" | "ANTHROPIC" | "AZURE" | "LOCAL" | "HELICONE" | "AMDBARTEK" | "ANYSCALE" | "CLOUDFLARE" | "2YFV" | "TOGETHER" | "LEMONFOX" | "FIREWORKS" | "PERPLEXITY" | "GOOGLE" | "OPENROUTER" | "WISDOMINANUTSHELL" | "GROQ" | "COHERE" | "MISTRAL" | "DEEPINFRA" | "QSTASH" | "FIRECRAWL" | "AWS" | "DEEPSEEK" | "X";
Provider: components["schemas"]["ProviderName"] | string | "CUSTOM";
/** @enum {string} */
LlmType: "chat" | "completion";
Expand Down
2 changes: 1 addition & 1 deletion bifrost/lib/clients/jawnTypes/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ Json: JsonObject;
evaluator_scoring_type: string;
};
/** @enum {string} */
ProviderName: "OPENAI" | "ANTHROPIC" | "AZURE" | "LOCAL" | "HELICONE" | "AMDBARTEK" | "ANYSCALE" | "CLOUDFLARE" | "2YFV" | "TOGETHER" | "LEMONFOX" | "FIREWORKS" | "PERPLEXITY" | "GOOGLE" | "OPENROUTER" | "WISDOMINANUTSHELL" | "GROQ" | "COHERE" | "MISTRAL" | "DEEPINFRA" | "QSTASH" | "FIRECRAWL" | "AWS" | "DEEPSEEK";
ProviderName: "OPENAI" | "ANTHROPIC" | "AZURE" | "LOCAL" | "HELICONE" | "AMDBARTEK" | "ANYSCALE" | "CLOUDFLARE" | "2YFV" | "TOGETHER" | "LEMONFOX" | "FIREWORKS" | "PERPLEXITY" | "GOOGLE" | "OPENROUTER" | "WISDOMINANUTSHELL" | "GROQ" | "COHERE" | "MISTRAL" | "DEEPINFRA" | "QSTASH" | "FIRECRAWL" | "AWS" | "DEEPSEEK" | "X";
Provider: components["schemas"]["ProviderName"] | string | "CUSTOM";
/** @enum {string} */
LlmType: "chat" | "completion";
Expand Down
9 changes: 9 additions & 0 deletions bifrost/packages/cost/providers/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { openAIProvider } from "./openai";
import { anthropicProvider } from "./anthropic";
import { costs as awsBedrockCosts } from "./awsBedrock";
import { costs as deepseekCosts } from "./deepseek";
import { costs as xCosts } from "./x";

const openAiPattern = /^https:\/\/api\.openai\.com/;
const anthropicPattern = /^https:\/\/api\.anthropic\.com/;
Expand Down Expand Up @@ -52,6 +53,8 @@ const firecrawl = /^https:\/\/api\.firecrawl\.dev/;
const awsBedrock = /^https:\/\/bedrock-runtime\.[a-z0-9-]+\.amazonaws\.com\/.*/;
// https://api.deepseek.com
const deepseek = /^https:\/\/api\.deepseek\.com/;
// https://api.x.ai
const x = /^https:\/\/api\.x\.ai/;

export const providersNames = [
"OPENAI",
Expand All @@ -78,6 +81,7 @@ export const providersNames = [
"FIRECRAWL",
"AWS",
"DEEPSEEK",
"X",
] as const;

export type ProviderName = (typeof providersNames)[number];
Expand Down Expand Up @@ -127,6 +131,11 @@ export const providers: {
pattern: cloudflareAiGatewayPattern,
provider: "CLOUDFLARE",
},
{
pattern: x,
provider: "X",
costs: xCosts,
},
{
pattern: twoYFV,
provider: "2YFV",
Expand Down
Loading

0 comments on commit bd4c5de

Please sign in to comment.