mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
session_id is caller-controlled, and this row sums spend, baseline spend and the savings between them. Keyed on the session alone, one caller reusing another's id folds their turns into that tenant's dollars and merges two conversations into one benchmark row. The codebase has two keying conventions and this table was following the wrong one. Session-scoped state is keyed on the session and the router that owns it: LiteLLM_AdaptiveRouterSession is @@id([session_id, router_name, model_name]) and the deployment-affinity cache key is model_group plus session_id, neither carrying a tenant. Spend accounting is keyed on the credential: every daily table is @@unique([<entity>, date, api_key, model, ...]). The discriminator is not whether a row is per-session, it is whether the row adds up money, and this one does. So the key gains api_key, matching the accounting tables it belongs with. A credential rotated mid-conversation now splits that session's rollup in two, which undercounts one row rather than merging two tenants into one wrong number. |
||
|---|---|---|
| .. | ||
| dist | ||
| litellm_proxy_extras | ||
| tests | ||
| build_and_publish.md | ||
| LICENSE | ||
| migration_runbook.md | ||
| pyproject.toml | ||
| README.md | ||
Additional files for the proxy. Reduces the size of the main litellm package.
Currently, only stores the migration.sql files for litellm-proxy.
To install, run:
uv add litellm-proxy-extras
OR
uv tool install 'litellm[proxy]' # installs litellm-proxy-extras and other proxy dependencies
To use the migrations, run:
litellm --use_prisma_migrate