diff --git a/bifrost/packages/cost/providers/avian/index.ts b/bifrost/packages/cost/providers/avian/index.ts new file mode 100644 index 000000000..0ae179db3 --- /dev/null +++ b/bifrost/packages/cost/providers/avian/index.ts @@ -0,0 +1,44 @@ +import { ModelRow } from "../../interfaces/Cost"; + +export const costs: ModelRow[] = [ + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-405B-Instruct", + }, + cost: { + prompt_token: 0.0000015, + completion_token: 0.0000015, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.3-70B-Instruct", + }, + cost: { + prompt_token: 0.00000045, + completion_token: 0.00000045, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-70B-Instruct", + }, + cost: { + prompt_token: 0.00000045, + completion_token: 0.00000045, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-8B-Instruct", + }, + cost: { + prompt_token: 0.0000001, + completion_token: 0.0000001, + }, + }, +]; diff --git a/bifrost/packages/cost/providers/mappings.ts b/bifrost/packages/cost/providers/mappings.ts index 2a7fdf359..f4b7a2d53 100644 --- a/bifrost/packages/cost/providers/mappings.ts +++ b/bifrost/packages/cost/providers/mappings.ts @@ -17,6 +17,7 @@ import { anthropicProvider } from "./anthropic"; import { costs as awsBedrockCosts } from "./awsBedrock"; import { costs as deepseekCosts } from "./deepseek"; import { costs as xCosts } from "./x"; +import { costs as avianCosts } from "./avian"; const openAiPattern = /^https:\/\/api\.openai\.com/; const anthropicPattern = /^https:\/\/api\.anthropic\.com/; @@ -55,6 +56,7 @@ const awsBedrock = /^https:\/\/bedrock-runtime\.[a-z0-9-]+\.amazonaws\.com\/.*/; const deepseek = /^https:\/\/api\.deepseek\.com/; // https://api.x.ai const x = /^https:\/\/api\.x\.ai/; +const avianPattern = /^https:\/\/api\.avian\.io/; export const providersNames = [ "OPENAI", @@ -82,6 +84,7 @@ export const providersNames = [ "AWS", "DEEPSEEK", "X", + "AVIAN" ] as const; export type ProviderName = (typeof providersNames)[number]; @@ -215,6 +218,11 @@ export const providers: { provider: "DEEPSEEK", costs: deepseekCosts, }, + { + pattern: avianPattern, + provider: "AVIAN", + costs: avianCosts, + }, ]; export const playgroundModels: { diff --git a/costs/__tests__/ensureOnlyOne.ts b/costs/__tests__/ensureOnlyOne.ts index 2ac5fb02d..5314570ea 100644 --- a/costs/__tests__/ensureOnlyOne.ts +++ b/costs/__tests__/ensureOnlyOne.ts @@ -821,6 +821,15 @@ WHEN (request_response_rmt.provider = 'DEEPSEEK') THEN ( WHEN (request_response_rmt.model ILIKE 'deepseek-chat') THEN 14 * request_response_rmt.prompt_tokens + 28 * request_response_rmt.completion_tokens ELSE 0 END +) +WHEN (request_response_rmt.provider = 'AVIAN') THEN ( + CASE + WHEN (request_response_rmt.model ILIKE 'Meta-Llama-3.1-405B-Instruct') THEN 1500 * request_response_rmt.prompt_tokens + 1500 * request_response_rmt.completion_tokens +WHEN (request_response_rmt.model ILIKE 'Meta-Llama-3.3-70B-Instruct') THEN 450 * request_response_rmt.prompt_tokens + 450 * request_response_rmt.completion_tokens +WHEN (request_response_rmt.model ILIKE 'Meta-Llama-3.1-70B-Instruct') THEN 450 * request_response_rmt.prompt_tokens + 450 * request_response_rmt.completion_tokens +WHEN (request_response_rmt.model ILIKE 'Meta-Llama-3.1-8B-Instruct') THEN 100 * request_response_rmt.prompt_tokens + 100 * request_response_rmt.completion_tokens + ELSE 0 +END ) ELSE CASE diff --git a/costs/src/providers/avian/index.ts b/costs/src/providers/avian/index.ts new file mode 100644 index 000000000..0ae179db3 --- /dev/null +++ b/costs/src/providers/avian/index.ts @@ -0,0 +1,44 @@ +import { ModelRow } from "../../interfaces/Cost"; + +export const costs: ModelRow[] = [ + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-405B-Instruct", + }, + cost: { + prompt_token: 0.0000015, + completion_token: 0.0000015, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.3-70B-Instruct", + }, + cost: { + prompt_token: 0.00000045, + completion_token: 0.00000045, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-70B-Instruct", + }, + cost: { + prompt_token: 0.00000045, + completion_token: 0.00000045, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-8B-Instruct", + }, + cost: { + prompt_token: 0.0000001, + completion_token: 0.0000001, + }, + }, +]; diff --git a/costs/src/providers/mappings.ts b/costs/src/providers/mappings.ts index 2a7fdf359..f4b7a2d53 100644 --- a/costs/src/providers/mappings.ts +++ b/costs/src/providers/mappings.ts @@ -17,6 +17,7 @@ import { anthropicProvider } from "./anthropic"; import { costs as awsBedrockCosts } from "./awsBedrock"; import { costs as deepseekCosts } from "./deepseek"; import { costs as xCosts } from "./x"; +import { costs as avianCosts } from "./avian"; const openAiPattern = /^https:\/\/api\.openai\.com/; const anthropicPattern = /^https:\/\/api\.anthropic\.com/; @@ -55,6 +56,7 @@ const awsBedrock = /^https:\/\/bedrock-runtime\.[a-z0-9-]+\.amazonaws\.com\/.*/; const deepseek = /^https:\/\/api\.deepseek\.com/; // https://api.x.ai const x = /^https:\/\/api\.x\.ai/; +const avianPattern = /^https:\/\/api\.avian\.io/; export const providersNames = [ "OPENAI", @@ -82,6 +84,7 @@ export const providersNames = [ "AWS", "DEEPSEEK", "X", + "AVIAN" ] as const; export type ProviderName = (typeof providersNames)[number]; @@ -215,6 +218,11 @@ export const providers: { provider: "DEEPSEEK", costs: deepseekCosts, }, + { + pattern: avianPattern, + provider: "AVIAN", + costs: avianCosts, + }, ]; export const playgroundModels: { diff --git a/valhalla/jawn/src/packages/cost/providers/avian/index.ts b/valhalla/jawn/src/packages/cost/providers/avian/index.ts new file mode 100644 index 000000000..0ae179db3 --- /dev/null +++ b/valhalla/jawn/src/packages/cost/providers/avian/index.ts @@ -0,0 +1,44 @@ +import { ModelRow } from "../../interfaces/Cost"; + +export const costs: ModelRow[] = [ + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-405B-Instruct", + }, + cost: { + prompt_token: 0.0000015, + completion_token: 0.0000015, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.3-70B-Instruct", + }, + cost: { + prompt_token: 0.00000045, + completion_token: 0.00000045, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-70B-Instruct", + }, + cost: { + prompt_token: 0.00000045, + completion_token: 0.00000045, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-8B-Instruct", + }, + cost: { + prompt_token: 0.0000001, + completion_token: 0.0000001, + }, + }, +]; diff --git a/valhalla/jawn/src/packages/cost/providers/mappings.ts b/valhalla/jawn/src/packages/cost/providers/mappings.ts index 2a7fdf359..f4b7a2d53 100644 --- a/valhalla/jawn/src/packages/cost/providers/mappings.ts +++ b/valhalla/jawn/src/packages/cost/providers/mappings.ts @@ -17,6 +17,7 @@ import { anthropicProvider } from "./anthropic"; import { costs as awsBedrockCosts } from "./awsBedrock"; import { costs as deepseekCosts } from "./deepseek"; import { costs as xCosts } from "./x"; +import { costs as avianCosts } from "./avian"; const openAiPattern = /^https:\/\/api\.openai\.com/; const anthropicPattern = /^https:\/\/api\.anthropic\.com/; @@ -55,6 +56,7 @@ const awsBedrock = /^https:\/\/bedrock-runtime\.[a-z0-9-]+\.amazonaws\.com\/.*/; const deepseek = /^https:\/\/api\.deepseek\.com/; // https://api.x.ai const x = /^https:\/\/api\.x\.ai/; +const avianPattern = /^https:\/\/api\.avian\.io/; export const providersNames = [ "OPENAI", @@ -82,6 +84,7 @@ export const providersNames = [ "AWS", "DEEPSEEK", "X", + "AVIAN" ] as const; export type ProviderName = (typeof providersNames)[number]; @@ -215,6 +218,11 @@ export const providers: { provider: "DEEPSEEK", costs: deepseekCosts, }, + { + pattern: avianPattern, + provider: "AVIAN", + costs: avianCosts, + }, ]; export const playgroundModels: { diff --git a/web/packages/cost/providers/avian/index.ts b/web/packages/cost/providers/avian/index.ts new file mode 100644 index 000000000..0ae179db3 --- /dev/null +++ b/web/packages/cost/providers/avian/index.ts @@ -0,0 +1,44 @@ +import { ModelRow } from "../../interfaces/Cost"; + +export const costs: ModelRow[] = [ + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-405B-Instruct", + }, + cost: { + prompt_token: 0.0000015, + completion_token: 0.0000015, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.3-70B-Instruct", + }, + cost: { + prompt_token: 0.00000045, + completion_token: 0.00000045, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-70B-Instruct", + }, + cost: { + prompt_token: 0.00000045, + completion_token: 0.00000045, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-8B-Instruct", + }, + cost: { + prompt_token: 0.0000001, + completion_token: 0.0000001, + }, + }, +]; diff --git a/web/packages/cost/providers/mappings.ts b/web/packages/cost/providers/mappings.ts index 2a7fdf359..f4b7a2d53 100644 --- a/web/packages/cost/providers/mappings.ts +++ b/web/packages/cost/providers/mappings.ts @@ -17,6 +17,7 @@ import { anthropicProvider } from "./anthropic"; import { costs as awsBedrockCosts } from "./awsBedrock"; import { costs as deepseekCosts } from "./deepseek"; import { costs as xCosts } from "./x"; +import { costs as avianCosts } from "./avian"; const openAiPattern = /^https:\/\/api\.openai\.com/; const anthropicPattern = /^https:\/\/api\.anthropic\.com/; @@ -55,6 +56,7 @@ const awsBedrock = /^https:\/\/bedrock-runtime\.[a-z0-9-]+\.amazonaws\.com\/.*/; const deepseek = /^https:\/\/api\.deepseek\.com/; // https://api.x.ai const x = /^https:\/\/api\.x\.ai/; +const avianPattern = /^https:\/\/api\.avian\.io/; export const providersNames = [ "OPENAI", @@ -82,6 +84,7 @@ export const providersNames = [ "AWS", "DEEPSEEK", "X", + "AVIAN" ] as const; export type ProviderName = (typeof providersNames)[number]; @@ -215,6 +218,11 @@ export const providers: { provider: "DEEPSEEK", costs: deepseekCosts, }, + { + pattern: avianPattern, + provider: "AVIAN", + costs: avianCosts, + }, ]; export const playgroundModels: { diff --git a/worker/src/packages/cost/providers/avian/index.ts b/worker/src/packages/cost/providers/avian/index.ts new file mode 100644 index 000000000..0ae179db3 --- /dev/null +++ b/worker/src/packages/cost/providers/avian/index.ts @@ -0,0 +1,44 @@ +import { ModelRow } from "../../interfaces/Cost"; + +export const costs: ModelRow[] = [ + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-405B-Instruct", + }, + cost: { + prompt_token: 0.0000015, + completion_token: 0.0000015, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.3-70B-Instruct", + }, + cost: { + prompt_token: 0.00000045, + completion_token: 0.00000045, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-70B-Instruct", + }, + cost: { + prompt_token: 0.00000045, + completion_token: 0.00000045, + }, + }, + { + model: { + operator: "equals", + value: "Meta-Llama-3.1-8B-Instruct", + }, + cost: { + prompt_token: 0.0000001, + completion_token: 0.0000001, + }, + }, +]; diff --git a/worker/src/packages/cost/providers/mappings.ts b/worker/src/packages/cost/providers/mappings.ts index 2a7fdf359..f4b7a2d53 100644 --- a/worker/src/packages/cost/providers/mappings.ts +++ b/worker/src/packages/cost/providers/mappings.ts @@ -17,6 +17,7 @@ import { anthropicProvider } from "./anthropic"; import { costs as awsBedrockCosts } from "./awsBedrock"; import { costs as deepseekCosts } from "./deepseek"; import { costs as xCosts } from "./x"; +import { costs as avianCosts } from "./avian"; const openAiPattern = /^https:\/\/api\.openai\.com/; const anthropicPattern = /^https:\/\/api\.anthropic\.com/; @@ -55,6 +56,7 @@ const awsBedrock = /^https:\/\/bedrock-runtime\.[a-z0-9-]+\.amazonaws\.com\/.*/; const deepseek = /^https:\/\/api\.deepseek\.com/; // https://api.x.ai const x = /^https:\/\/api\.x\.ai/; +const avianPattern = /^https:\/\/api\.avian\.io/; export const providersNames = [ "OPENAI", @@ -82,6 +84,7 @@ export const providersNames = [ "AWS", "DEEPSEEK", "X", + "AVIAN" ] as const; export type ProviderName = (typeof providersNames)[number]; @@ -215,6 +218,11 @@ export const providers: { provider: "DEEPSEEK", costs: deepseekCosts, }, + { + pattern: avianPattern, + provider: "AVIAN", + costs: avianCosts, + }, ]; export const playgroundModels: {