From 312e64623b08ae02faf7a16538f5cbe6eb9ad737 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Mon, 8 Apr 2024 13:38:59 -0700 Subject: [PATCH] ui - show extra litellm params --- .../src/components/model_dashboard.tsx | 26 ++++++++++++------- .../src/components/networking.tsx | 1 + 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ui/litellm-dashboard/src/components/model_dashboard.tsx b/ui/litellm-dashboard/src/components/model_dashboard.tsx index 4194b56cc..16bef04a9 100644 --- a/ui/litellm-dashboard/src/components/model_dashboard.tsx +++ b/ui/litellm-dashboard/src/components/model_dashboard.tsx @@ -118,6 +118,7 @@ const ModelDashboard: React.FC = ({ let input_cost = "Undefined"; let output_cost = "Undefined"; let max_tokens = "Undefined"; + let cleanedLitellmParams = {}; // Check if litellm_model_name is null or undefined if (litellm_model_name) { @@ -139,11 +140,22 @@ const ModelDashboard: React.FC = ({ output_cost = model_info?.output_cost_per_token; max_tokens = model_info?.max_tokens; } + + // let cleanedLitellmParams == litellm_params without model, api_base + if (curr_model?.litellm_params) { + cleanedLitellmParams = Object.fromEntries( + Object.entries(curr_model?.litellm_params).filter( + ([key]) => key !== "model" && key !== "api_base" + ) + ); + } + modelData.data[i].provider = provider; modelData.data[i].input_cost = input_cost; modelData.data[i].output_cost = output_cost; modelData.data[i].max_tokens = max_tokens; modelData.data[i].api_base = curr_model?.litellm_params?.api_base; + modelData.data[i].cleanedLitellmParams = cleanedLitellmParams; all_models_on_proxy.push(curr_model.model_name); @@ -261,7 +273,7 @@ const ModelDashboard: React.FC = ({ ) } - Access + Extra litellm Params Input Price per token ($) Output Price per token ($) @@ -282,15 +294,9 @@ const ModelDashboard: React.FC = ({ } - {model.user_access ? ( - Yes - ) : ( - - )} +
+                    {JSON.stringify(model.cleanedLitellmParams, null, 2)}
+                    
{model.input_cost} diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx index 9ccf25496..c00dc194c 100644 --- a/ui/litellm-dashboard/src/components/networking.tsx +++ b/ui/litellm-dashboard/src/components/networking.tsx @@ -339,6 +339,7 @@ export const modelInfoCall = async ( } const data = await response.json(); + console.log("modelInfoCall:", data); //message.info("Received model data"); return data; // Handle success - you might want to update some state or UI based on the created key