forked from phoenix/litellm-mirror
Merge pull request #3388 from BerriAI/litellm_ui_latency_tracker
[UI] Fix show latency < 0.0001 for deployments that have low latency + only show non cache hits on latency UI
This commit is contained in:
commit
8c148506a0
2 changed files with 15 additions and 12 deletions
|
@ -7549,7 +7549,7 @@ async def model_metrics(
|
||||||
"LiteLLM_SpendLogs"
|
"LiteLLM_SpendLogs"
|
||||||
WHERE
|
WHERE
|
||||||
"startTime" >= NOW() - INTERVAL '30 days'
|
"startTime" >= NOW() - INTERVAL '30 days'
|
||||||
AND "model" = $1
|
AND "model" = $1 AND "cache_hit" != 'True'
|
||||||
GROUP BY
|
GROUP BY
|
||||||
api_base,
|
api_base,
|
||||||
model,
|
model,
|
||||||
|
@ -7598,7 +7598,7 @@ async def model_metrics(
|
||||||
for day in _daily_entries:
|
for day in _daily_entries:
|
||||||
entry = {"date": str(day)}
|
entry = {"date": str(day)}
|
||||||
for model_key, latency in _daily_entries[day].items():
|
for model_key, latency in _daily_entries[day].items():
|
||||||
entry[model_key] = round(latency, 8)
|
entry[model_key] = latency
|
||||||
response.append(entry)
|
response.append(entry)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -720,17 +720,20 @@ const handleEditSubmit = async (formValues: Record<string, any>) => {
|
||||||
return (
|
return (
|
||||||
<div className="w-150 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown">
|
<div className="w-150 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown">
|
||||||
{date && <p className="text-tremor-content-emphasis mb-2">Date: {date}</p>}
|
{date && <p className="text-tremor-content-emphasis mb-2">Date: {date}</p>}
|
||||||
{sortedPayload.map((category: any, idx: number) => (
|
{sortedPayload.map((category: any, idx: number) => {
|
||||||
<div key={idx} className="flex justify-between">
|
const roundedValue = parseFloat(category.value.toFixed(5));
|
||||||
<div className="flex items-center space-x-2">
|
const displayValue =
|
||||||
<div className={`w-2 h-2 mt-1 rounded-full bg-${category.color}-500`} />
|
roundedValue === 0 && category.value > 0 ? "<0.00001" : roundedValue.toFixed(5);
|
||||||
<p className="text-tremor-content">{category.dataKey}</p>
|
return (
|
||||||
|
<div key={idx} className="flex justify-between">
|
||||||
|
<div className="flex items-center space-x-2">
|
||||||
|
<div className={`w-2 h-2 mt-1 rounded-full bg-${category.color}-500`} />
|
||||||
|
<p className="text-tremor-content">{category.dataKey}</p>
|
||||||
|
</div>
|
||||||
|
<p className="font-medium text-tremor-content-emphasis text-righ ml-2">{displayValue}</p>
|
||||||
</div>
|
</div>
|
||||||
<p className="font-medium text-tremor-content-emphasis text-righ ml-2">
|
);
|
||||||
{category.value.toFixed(5)}
|
})}
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue