litellm/ui
Tin Chi Lo db15ef3742 fix(spend): charge the cold-cache write to the model switch that caused it
Staying on one model writes the prompt cache once and reads it thereafter.
Switching leaves the new model cold, so it pays to write the whole prompt again,
and that charge exists only because the router switched.

Both arms were priced as if each model wrote the cache, which credited the
baseline a cache-creation charge it would never have paid again. On a
sonnet to haiku switch mid-conversation that phantom write was larger than the
entire real cost of the request: the route lost $0.0104 and was reported as
having saved $0.0179, with the sign inverted.

The baseline is now priced as the warm cache a single-model deployment would
have had, so the cold-cache write counts against the saving. A request that read
nothing from cache is a genuine first turn the baseline would have paid to write
too, so both arms still write there and cold-start savings stay honest.

The result is signed rather than floored at zero. A cache-thrashing route is a
real cost and the dashboard has to be able to report it; flooring per request
would leave a number that can only ever go up and would hide exactly the routing
behaviour an operator needs to see. The donut plots only drivers that saved,
since a negative slice has no meaning, while the card and the range total keep
the signed truth. usd() now sizes and signs off the magnitude so a small loss
reads as -$0.0004 rather than $-0.00.
2026-07-31 17:02:39 -07:00
..
litellm-dashboard fix(spend): charge the cold-cache write to the model switch that caused it 2026-07-31 17:02:39 -07:00
Dockerfile feat: add componentized proxy deployment with gateway, backend, ui, and migrations (#27557) 2026-05-16 09:25:17 -07:00
nginx.conf fix(ui): serve /ui/assets from the nginx image instead of SPA fallback (#34066) 2026-07-21 09:22:02 -07:00