diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index d77ef78..357eee4 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -153,6 +153,20 @@ "litellm_provider": "text-completion-openai", "mode": "completion" }, + "text-embedding-ada-002-v2": { + "max_tokens": 8191, + "input_cost_per_token": 0.0000001, + "output_cost_per_token": 0.0000001, + "litellm_provider": "text-completion-openai", + "mode": "completion" + }, + "text-embedding-ada-002": { + "max_tokens": 8191, + "input_cost_per_token": 0.0000001, + "output_cost_per_token": 0.0000001, + "litellm_provider": "text-completion-openai", + "mode": "completion" + }, "text-ada-001": { "max_tokens": 2049, "input_cost_per_token": 0.0000004, diff --git a/src/index.test.ts b/src/index.test.ts index faf9570..f7ae1cb 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -27,4 +27,13 @@ describe("estimateCost", () => { }) ).toBe(0.216); }); + + it("should estimate cost correctly for embeddings model", () => { + expect( + estimateCost({ + model: "text-embedding-ada-002", + inputTokens: 3000, + }) + ).toBe(0.0003); + }); });