litellm/litellm-proxy-extras/litellm_proxy_extras
yucheng-berri e5386c10a7
feat(ptu): configure provisioned-throughput flat cost on a model deployment (#35341)
Add ptu_count, cost_per_ptu_per_hour, ptu_effective_from and ptu_effective_to to
ModelInfo so a model deployment can carry the inputs for provisioned-throughput
flat-cost attribution. ModelInfo validates per-field bounds (positive count,
non-negative rate, effective_to after effective_from); model/new and
model/{id}/update enforce the cross-field invariant (count and rate set together,
team_id required) on the effective model_info so partial updates validate the
merged result, and v1/model/info returns the fields.

LiteLLM_DailyTeamSpend gains ptu_flat_cost and ptu_source_model_id columns plus a
sentinel api_key constant; the daily rollup that writes them lands in a follow-up
PR. Adding the optional model_info fields is backward compatible; models without
them are unaffected.

ptu_effective_from is required alongside the count and rate rather than optional. Flat
cost accrues from that instant, so an absent start has to be inferred, and inferring it
let a deployment configured today be billed for days it did not exist. Both PTU validators
also run over the merged view before any write on the update path, beside the premium check the create path
already runs there: the team ACL update below autocommits, so a validator raising further
down left the team mutated and the deployment row never written.

The update path validates the model_info a patch would store rather than the patch
alone. An invariant holds over the deployment as it will exist, not over whichever
subset of fields a caller sent, and validating the patch rejected raising the rate on
an already configured model because that patch carries no start of its own.
2026-08-10 09:51:16 -07:00
..
migrations feat(ptu): configure provisioned-throughput flat cost on a model deployment (#35341) 2026-08-10 09:51:16 -07:00
__init__.py install prisma migration files - connects litellm proxy to litellm's prisma migration files (#9637) 2025-03-29 15:27:09 -07:00
_logging.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
prisma_toolchain.py fix(migrations): keep the toolchain heal from raising on an unreadable nodeenv cache (#35986) 2026-08-05 13:38:53 -07:00
py.typed fix(lint): bring basedpyright rule counts back under their budget limits 2026-08-05 10:23:02 -07:00
replica_identity.py fix(migrations): recover from an interrupted Prisma toolchain install (#35832) 2026-08-05 10:14:46 -07:00
schema.prisma feat(ptu): configure provisioned-throughput flat cost on a model deployment (#35341) 2026-08-10 09:51:16 -07:00
utils.py fix(migrations): recover from an interrupted Prisma toolchain install (#35832) 2026-08-05 10:14:46 -07:00