diff --git a/ui/litellm-dashboard/src/components/model_dashboard.tsx b/ui/litellm-dashboard/src/components/model_dashboard.tsx index 61d2a5277..16bef04a9 100644 --- a/ui/litellm-dashboard/src/components/model_dashboard.tsx +++ b/ui/litellm-dashboard/src/components/model_dashboard.tsx @@ -33,6 +33,7 @@ import { import { Badge, BadgeDelta, Button } from "@tremor/react"; import RequestAccess from "./request_model_access"; import { Typography } from "antd"; +import TextArea from "antd/es/input/TextArea"; const { Title: Title2, Link } = Typography; @@ -117,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) { @@ -138,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); @@ -183,6 +196,22 @@ const ModelDashboard: React.FC = ({ // Add key-value pair to model_info dictionary modelInfoObj[key] = value; } + + + if (key == "litellm_extra_params") { + console.log("litellm_extra_params:", value); + let litellmExtraParams = {}; + try { + litellmExtraParams = JSON.parse(value); + } + catch (error) { + message.error("Failed to parse LiteLLM Extra Paras: " + error); + throw new Error("Failed to parse litellm_extra_params: " + error); + } + for (const [key, value] of Object.entries(litellmExtraParams)) { + litellmParamsObj[key] = value; + } + } } const new_model: Model = { @@ -244,7 +273,7 @@ const ModelDashboard: React.FC = ({ ) } - Access + Extra litellm Params Input Price per token ($) Output Price per token ($) @@ -265,15 +294,9 @@ const ModelDashboard: React.FC = ({ } - {model.user_access ? ( - Yes - ) : ( - - )} +
+                    {JSON.stringify(model.cleanedLitellmParams, null, 2)}
+                    
{model.input_cost} @@ -420,6 +443,22 @@ const ModelDashboard: React.FC = ({ } + +