Skip to content

Commit

Permalink
Merge branch 'development' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikscale3 committed Sep 26, 2024
2 parents c18ec55 + 482bc7e commit ae99faf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export const metadata: Metadata = {
};

export default function Layout({ children }: { children: React.ReactNode }) {
return <LayoutClient children={children} />;
return <LayoutClient>{children}</LayoutClient>;
}
22 changes: 20 additions & 2 deletions lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,26 @@ export function calculatePriceFromUsage(
): any {
if (!model) return { total: 0, input: 0, output: 0 };
let costTable: CostTableEntry | undefined = undefined;

if (vendor === "litellm") {
if (vendor === "ai") {
if (model.startsWith("gpt-4") || model.includes("gpt-4")) {
vendor = "openai";
} else if (model.includes("claude")) {
vendor = "anthropic";
} else if (model.includes("mistral")) {
vendor = "mistral"; // Assuming there is a MISTRAL_PRICING object
} else if (model.includes("gemini")) {
vendor =
model.includes("flash") || model.includes("pro")
? "google generative ai"
: "google vertex";
} else if (
model.includes("llama") ||
model.includes("mixtral") ||
model.includes("gemma2")
) {
vendor = "groq";
}
} else if (vendor === "litellm") {
let correctModel = model;
if (model.includes("gpt") || model.includes("o1")) {
if (model.includes("gpt-4o-mini")) {
Expand Down

0 comments on commit ae99faf

Please sign in to comment.