forked from phoenix/litellm-mirror
ui - show extra litellm params
This commit is contained in:
parent
1bb07e54d4
commit
312e64623b
2 changed files with 17 additions and 10 deletions
|
@ -118,6 +118,7 @@ const ModelDashboard: React.FC<ModelDashboardProps> = ({
|
||||||
let input_cost = "Undefined";
|
let input_cost = "Undefined";
|
||||||
let output_cost = "Undefined";
|
let output_cost = "Undefined";
|
||||||
let max_tokens = "Undefined";
|
let max_tokens = "Undefined";
|
||||||
|
let cleanedLitellmParams = {};
|
||||||
|
|
||||||
// Check if litellm_model_name is null or undefined
|
// Check if litellm_model_name is null or undefined
|
||||||
if (litellm_model_name) {
|
if (litellm_model_name) {
|
||||||
|
@ -139,11 +140,22 @@ const ModelDashboard: React.FC<ModelDashboardProps> = ({
|
||||||
output_cost = model_info?.output_cost_per_token;
|
output_cost = model_info?.output_cost_per_token;
|
||||||
max_tokens = model_info?.max_tokens;
|
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].provider = provider;
|
||||||
modelData.data[i].input_cost = input_cost;
|
modelData.data[i].input_cost = input_cost;
|
||||||
modelData.data[i].output_cost = output_cost;
|
modelData.data[i].output_cost = output_cost;
|
||||||
modelData.data[i].max_tokens = max_tokens;
|
modelData.data[i].max_tokens = max_tokens;
|
||||||
modelData.data[i].api_base = curr_model?.litellm_params?.api_base;
|
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);
|
all_models_on_proxy.push(curr_model.model_name);
|
||||||
|
|
||||||
|
@ -261,7 +273,7 @@ const ModelDashboard: React.FC<ModelDashboardProps> = ({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
<TableHeaderCell>
|
<TableHeaderCell>
|
||||||
Access
|
Extra litellm Params
|
||||||
</TableHeaderCell>
|
</TableHeaderCell>
|
||||||
<TableHeaderCell>Input Price per token ($)</TableHeaderCell>
|
<TableHeaderCell>Input Price per token ($)</TableHeaderCell>
|
||||||
<TableHeaderCell>Output Price per token ($)</TableHeaderCell>
|
<TableHeaderCell>Output Price per token ($)</TableHeaderCell>
|
||||||
|
@ -282,15 +294,9 @@ const ModelDashboard: React.FC<ModelDashboardProps> = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{model.user_access ? (
|
<pre>
|
||||||
<Badge color={"green"}>Yes</Badge>
|
{JSON.stringify(model.cleanedLitellmParams, null, 2)}
|
||||||
) : (
|
</pre>
|
||||||
<RequestAccess
|
|
||||||
userModels={all_models_on_proxy}
|
|
||||||
accessToken={accessToken}
|
|
||||||
userID={userID}
|
|
||||||
></RequestAccess>
|
|
||||||
)}
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
||||||
<TableCell>{model.input_cost}</TableCell>
|
<TableCell>{model.input_cost}</TableCell>
|
||||||
|
|
|
@ -339,6 +339,7 @@ export const modelInfoCall = async (
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
console.log("modelInfoCall:", data);
|
||||||
//message.info("Received model data");
|
//message.info("Received model data");
|
||||||
return data;
|
return data;
|
||||||
// Handle success - you might want to update some state or UI based on the created key
|
// Handle success - you might want to update some state or UI based on the created key
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue