diff --git a/README.md b/README.md index a580bcbe..2de2c5e6 100644 --- a/README.md +++ b/README.md @@ -229,6 +229,7 @@ Langtrace automatically captures traces from the following vendors and framework | Weaviate | ✅ | ✅ | | PGVector | ✅ | ✅ (SQLAlchemy) | | MongoDB | ❌ | ✅ | +| Milvus | ❌ | ✅ | --- @@ -318,4 +319,4 @@ Absolutely! We love developers and welcome contributions. Get involved early by Programming Languages: Typescript and Python. Framework knowledge: NextJS. Database: Postgres and Prisma ORM. -Nice to haves: Opentelemetry instrumentation framework, experience with distributed tracing. \ No newline at end of file +Nice to haves: Opentelemetry instrumentation framework, experience with distributed tracing. diff --git a/components/shared/conversation-view.tsx b/components/shared/conversation-view.tsx index 975ca44a..5ff7f1b8 100644 --- a/components/shared/conversation-view.tsx +++ b/components/shared/conversation-view.tsx @@ -85,7 +85,7 @@ export default function ConversationView({ )}
{role}

+ ); + } + if (vendor.includes("mongodb")) { const color = vendorColor("mongodb"); return ( diff --git a/lib/constants.ts b/lib/constants.ts index 252d4f6e..0992af3b 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -154,6 +154,14 @@ export const XAI_PRICING: Record = { }; export const ANTHROPIC_PRICING: Record = { + "claude-3-5-sonnet": { + input: 0.003, + output: 0.015, + }, + "claude-3-5-haiku": { + input: 0.001, + output: 0.005, + }, "claude-3-haiku": { input: 0.00025, output: 0.00125, @@ -166,18 +174,6 @@ export const ANTHROPIC_PRICING: Record = { input: 0.015, output: 0.075, }, - "claude-2.1": { - input: 0.008, - output: 0.024, - }, - "claude-2.0": { - input: 0.008, - output: 0.024, - }, - "claude-instant": { - input: 0.0008, - output: 0.0024, - }, }; // https://docs.perplexity.ai/docs/pricing --> slightly unclear @@ -379,6 +375,7 @@ export const SUPPORTED_VENDORS: Record = { LANGCHAIN_CORE: "Langchain Core", LANGGRAPH: "Langgraph", LLAMAINDEX: "LlamaIndex", + MILVUS: "Milvus", OPENAI: "OpenAI", PINECONE: "Pinecone", COHERE: "Cohere", diff --git a/lib/utils.ts b/lib/utils.ts index f0216bf9..6ac8f0f4 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -520,6 +520,7 @@ export function calculatePriceFromUsage( ): any { if (!model) return { total: 0, input: 0, output: 0 }; let costTable: CostTableEntry | undefined = undefined; + // set vendor correctly if vendor is ai if (vendor === "ai") { if (model.startsWith("gpt-4") || model.includes("gpt-4")) { vendor = "openai"; @@ -541,7 +542,9 @@ export function calculatePriceFromUsage( ) { vendor = "groq"; } - } else if (vendor === "litellm") { + } + + if (vendor === "litellm" || vendor.includes("bedrock")) { let correctModel = model; if (model.includes("gpt") || model.includes("o1")) { if (model.includes("gpt-4o-mini")) { @@ -558,18 +561,16 @@ export function calculatePriceFromUsage( costTable = OPENAI_PRICING[correctModel]; } else if (model.includes("claude")) { let cmodel = ""; - if (model.includes("opus")) { + if (model.includes("3-opus")) { cmodel = "claude-3-opus"; - } else if (model.includes("sonnet")) { + } else if (model.includes("3-sonnet")) { cmodel = "claude-3-sonnet"; - } else if (model.includes("haiku")) { + } else if (model.includes("3-haiku")) { cmodel = "claude-3-haiku"; - } else if (model.includes("claude-2.1")) { - cmodel = "claude-2.1"; - } else if (model.includes("claude-2.0")) { - cmodel = "claude-2.0"; - } else if (model.includes("instant")) { - cmodel = "claude-instant"; + } else if (model.includes("3-5-sonnet")) { + cmodel = "claude-3-5-sonnet"; + } else if (model.includes("3-5-haiku")) { + cmodel = "claude-3-5-haiku"; } else { return 0; } @@ -600,18 +601,16 @@ export function calculatePriceFromUsage( costTable = OPENAI_PRICING[correctModel]; } else if (vendor === "anthropic") { let cmodel = ""; - if (model.includes("opus")) { + if (model.includes("3-opus")) { cmodel = "claude-3-opus"; - } else if (model.includes("sonnet")) { + } else if (model.includes("3-sonnet")) { cmodel = "claude-3-sonnet"; - } else if (model.includes("haiku")) { + } else if (model.includes("3-haiku")) { cmodel = "claude-3-haiku"; - } else if (model.includes("claude-2.1")) { - cmodel = "claude-2.1"; - } else if (model.includes("claude-2.0")) { - cmodel = "claude-2.0"; - } else if (model.includes("instant")) { - cmodel = "claude-instant"; + } else if (model.includes("3-5-sonnet")) { + cmodel = "claude-3-5-sonnet"; + } else if (model.includes("3-5-haiku")) { + cmodel = "claude-3-5-haiku"; } else { return 0; } @@ -835,8 +834,10 @@ export function getVendorFromSpan(span: Span): string { vendor = "mongodb"; } else if (span.name.includes("guard") || serviceName.includes("guard")) { vendor = "guardrails"; - } else if (span.name.includes("mistral") || serviceName.includes("mistral")) { + } else if (span.name.includes("mistral") || serviceName.includes("mistral")) { vendor = "mistral"; + } else if (span.name.includes("milvus") || serviceName.includes("milvus")) { + vendor = "milvus"; } return vendor; } diff --git a/public/milvus.png b/public/milvus.png new file mode 100644 index 00000000..498e48ac Binary files /dev/null and b/public/milvus.png differ