mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-13 23:11:40 +00:00
Renders the per-session rollup as a tab on the cost-optimization page. Savings is the single hero figure on the view, paired in one card with the session count and turn count that number was earned over, because a dollar figure with no denominator beside it is not something an operator can size. That pairing makes two derived numbers worth showing, both computed from the response the tab already fetches: savings per session, and how many auto-routers are in scope. Neither needs a backend change, and both move with the router selector. Beneath it the three session-shape metrics, then the prompt-caching section: hit rate over a stacked share-of-turns bar with a three-bucket breakdown, and a warming estimate showing rescued writes and replay cost separately against the break-even for the TTL in use. Every rate is recomputed from summed counts whenever more than one router is in view. Averaging the routers' own rates would weight a router with three turns the same as one with three thousand, which lands the blended figure nowhere near either. Savings reads "Not measured" rather than $0.00 when no baseline is configured, since autorouter_savings_baseline_model is what the driver needs and a confident zero against real spend is worse than saying nothing. Built on the base shadcn primitives (Card, CardHeader, CardAction, Separator, Table) so padding, header layout and table density come from the design system rather than being restated per block. The tab test renders a real component tree and stubs only the network, so it is named for the integration tier; the fold it exercises is unit-tested separately against its own module. |
||
|---|---|---|
| .. | ||
| litellm-dashboard | ||
| Dockerfile | ||
| nginx.conf | ||