diff --git a/bifrost/app/llm-cost/CalculatorInfo.tsx b/bifrost/app/llm-cost/CalculatorInfo.tsx
index 6f6784fcad..6e386bbe97 100644
--- a/bifrost/app/llm-cost/CalculatorInfo.tsx
+++ b/bifrost/app/llm-cost/CalculatorInfo.tsx
@@ -1,9 +1,12 @@
+import { providers } from "@/packages/cost/providers/mappings";
import {
Accordion,
AccordionItem,
AccordionTrigger,
AccordionContent,
} from "@radix-ui/react-accordion";
+import { ChevronRight } from "lucide-react";
+import Link from "next/link";
import React from "react";
// Function to format provider names
@@ -25,6 +28,24 @@ export function formatProviderName(provider: string): string {
return formattingMap[provider.toUpperCase()] || provider.toUpperCase();
}
+const getParentModelInfo = (provider: string, model: string) => {
+ const providerData = providers.find(
+ (p) => p.provider.toLowerCase() === provider.toLowerCase()
+ );
+ if (!providerData?.modelDetails) return null;
+
+ for (const [parentModel, details] of Object.entries(
+ providerData.modelDetails
+ )) {
+ if (details.matches.includes(model)) {
+ return {
+ name: details.searchTerms[0],
+ matches: details.matches,
+ };
+ }
+ }
+ return null;
+};
// Reusable FAQ component
const LLMPricingFAQ = () => {
@@ -41,10 +62,15 @@ const LLMPricingFAQ = () => {
- As an open-source project, we welcome contributions from the community to keep the pricing data accurate and - up-to-date. + As an open-source project, we welcome contributions from the community to + keep the pricing data accurate and up-to-date.
Use the calculator to compare costs across different models
and providers to find the best fit for your needs.
@@ -713,7 +782,9 @@ const CalculatorInfo: React.FC
Experiment with different input and output token counts to
estimate costs for various use cases.
@@ -736,7 +807,9 @@ const CalculatorInfo: React.FC
Remember to factor in your expected usage volume when
comparing costs across different providers.
diff --git a/bifrost/app/llm-cost/ModelPriceCalculator.tsx b/bifrost/app/llm-cost/ModelPriceCalculator.tsx
index 0c8bf29a9f..c84e753ac6 100644
--- a/bifrost/app/llm-cost/ModelPriceCalculator.tsx
+++ b/bifrost/app/llm-cost/ModelPriceCalculator.tsx
@@ -40,208 +40,6 @@ type CostData = {
totalCost: number;
};
-// Custom MultiSelect component
-const MultiSelect = ({
- label,
- options,
- selected,
- onToggle,
-}: {
- label: string;
- options: { value: string; label: string }[];
- selected: string[];
- onToggle: (value: string) => void;
-}) => {
- const [isOpen, setIsOpen] = useState(false);
-
- return (
-
{provider && model
? `Calculate the cost of using ${model} with Helicone's free pricing tool.`
@@ -834,7 +654,7 @@ Optimize your AI API costs:`;
Adjust token counts
+
+ Adjust token counts
+
Consider your usage volume
+
+ Consider your usage volume
+
+
+
{provider && model ? (
<>
{formatProviderName(provider)}{" "}
@@ -597,7 +417,7 @@ Optimize your AI API costs:`;
"LLM API "
)}
Pricing Calculator
-
@@ -844,7 +664,7 @@ Optimize your AI API costs:`;
@@ -854,7 +674,7 @@ Optimize your AI API costs:`;
@@ -864,7 +684,7 @@ Optimize your AI API costs:`;
@@ -874,7 +694,7 @@ Optimize your AI API costs:`;
@@ -884,7 +704,7 @@ Optimize your AI API costs:`;
@@ -894,7 +714,7 @@ Optimize your AI API costs:`;
diff --git a/bifrost/app/llm-cost/provider/[provider]/model/[model]/page.tsx b/bifrost/app/llm-cost/provider/[provider]/model/[model]/page.tsx
index 7db1a5ec6d..55d4f02f65 100644
--- a/bifrost/app/llm-cost/provider/[provider]/model/[model]/page.tsx
+++ b/bifrost/app/llm-cost/provider/[provider]/model/[model]/page.tsx
@@ -32,6 +32,18 @@ export async function generateStaticParams() {
model: encodeURIComponent(cost.model.value),
});
}
+
+ if (provider.modelDetails) {
+ for (const parentModel in provider.modelDetails) {
+ const searchTerms = provider.modelDetails[parentModel].searchTerms;
+ if (searchTerms && searchTerms.length > 0) {
+ paths.push({
+ provider: encodeURIComponent(provider.provider.toLowerCase()),
+ model: encodeURIComponent(searchTerms[0]),
+ });
+ }
+ }
+ }
}
return paths;