Merge pull request #3871 from BerriAI/litellm_custom_pricing_ui_fix

fix(model_dashboard.tsx): accurately show the input/output cost per token when custom pricing is set
This commit is contained in:
Krish Dholakia 2024-05-27 18:35:54 -07:00 committed by GitHub
commit 60c06cd7df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1231,9 +1231,15 @@ const ModelDashboard: React.FC<ModelDashboardProps> = ({
}}
>
<pre style={{ fontSize: "10px" }}>
{model.input_cost ||
model.litellm_params.input_cost_per_token ||
"-"}
{model.input_cost
? model.input_cost
: model.litellm_params.input_cost_per_token
? (
Number(
model.litellm_params.input_cost_per_token
) * 1000000
).toFixed(2)
: null}
</pre>
</TableCell>
<TableCell
@ -1244,9 +1250,15 @@ const ModelDashboard: React.FC<ModelDashboardProps> = ({
}}
>
<pre style={{ fontSize: "10px" }}>
{model.output_cost ||
model.litellm_params.output_cost_per_token ||
"-"}
{model.output_cost
? model.output_cost
: model.litellm_params.output_cost_per_token
? (
Number(
model.litellm_params.output_cost_per_token
) * 1000000
).toFixed(2)
: null}
</pre>
</TableCell>
<TableCell>