From 1dabf424f37e3099d2b92c18e67965d6e2e08a12 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 16 May 2024 15:10:39 -0700 Subject: [PATCH] ui - show model prices as /1M tokens --- .../src/components/model_dashboard.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ui/litellm-dashboard/src/components/model_dashboard.tsx b/ui/litellm-dashboard/src/components/model_dashboard.tsx index e11619165..d5c60e464 100644 --- a/ui/litellm-dashboard/src/components/model_dashboard.tsx +++ b/ui/litellm-dashboard/src/components/model_dashboard.tsx @@ -677,6 +677,17 @@ const handleEditSubmit = async (formValues: Record) => { modelData.data[i].provider = provider; modelData.data[i].input_cost = input_cost; modelData.data[i].output_cost = output_cost; + + + // Convert Cost in terms of Cost per 1M tokens + if (modelData.data[i].input_cost) { + modelData.data[i].input_cost = (Number(modelData.data[i].input_cost) * 1000000).toFixed(2); + } + + if (modelData.data[i].output_cost) { + modelData.data[i].output_cost = (Number(modelData.data[i].output_cost) * 1000000).toFixed(2); + } + modelData.data[i].max_tokens = max_tokens; modelData.data[i].api_base = curr_model?.litellm_params?.api_base; modelData.data[i].cleanedLitellmParams = cleanedLitellmParams; @@ -932,8 +943,8 @@ const handleEditSubmit = async (formValues: Record) => { Extra litellm Params - Input Price per token ($) - Output Price per token ($) + Input Price/1M Tokens ($) + Output Price/1M Tokens ($) Max Tokens Status