Commit graph

37852 commits

Author SHA1 Message Date
Ishaan Jaffer
41d2cc1012
fix(budget): reseed model counters on miss and avoid baseline double-count 2026-04-25 13:59:43 -07:00
Ishaan Jaffer
7ea753e415
fix(auth): remove model-spend DB reads from hot path 2026-04-25 12:44:26 -07:00
Ishaan Jaffer
e41b337097
refactor(auth): use cached helper fallback for team-member model spend 2026-04-25 10:58:28 -07:00
Ishaan Jaffer
e52098e1d4
fix(reset): clear team-member model spend on budget rollover 2026-04-25 10:56:59 -07:00
Ishaan Jaffer
4a87c6babe
fix(proxy): align team-member budget keys and validate model budget types 2026-04-25 10:38:38 -07:00
Ishaan Jaffer
ad6e88547d
fix(proxy): simplify team-member model budget keying and alias checks 2026-04-25 09:37:34 -07:00
Ishaan Jaffer
f38f5d48b0
fix: guard team_object.team_id is None in _check_team_member_model_budget to prevent budget bypass 2026-04-24 20:26:33 -07:00
Ishaan Jaffer
d9067925f5
fix: use async_set_cache (not async_increment_cache) to seed spend counter on cold-start in auth check 2026-04-24 20:12:20 -07:00
Ishaan Jaffer
09362b525d
fix: seed spend_counter_cache after DB reseed in _check_team_member_model_budget to prevent O(N) concurrent DB hits 2026-04-24 20:04:52 -07:00
Ishaan Jaffer
1fbb9a3bd3
refactor: neutralize dead model_spend migration (replaced by dedicated table approach) 2026-04-24 19:21:07 -07:00
Ishaan Jaffer
3f362cdaff
refactor: remove dead model_spend field from LiteLLM_TeamMembership schema (superseded by LiteLLM_TeamMemberModelSpend table) 2026-04-24 19:21:02 -07:00
Ishaan Jaffer
368f2a6687
fix: reseed from DB on cache miss in _check_team_member_model_budget to prevent cold-start budget bypass 2026-04-24 19:20:55 -07:00
Ishaan Jaffer
36294ffcb2
fix: use rsplit to correctly parse OIDC user IDs with colons in spend counter key 2026-04-24 19:04:51 -07:00
Ishaan Jaffer
fd4e8209d7
fix: correct Prisma accessor typo litellm_teammembermodelspend (was litellm_teammembermodeispend) 2026-04-24 19:04:48 -07:00
Ishaan Jaffer
d6d654bc55
fix: reseed per-model spend from LiteLLM_TeamMemberModelSpend table, not JSON field 2026-04-24 18:56:13 -07:00
Ishaan Jaffer
3db26a5faa
fix: use atomic upsert+increment on LiteLLM_TeamMemberModelSpend instead of non-atomic JSON read-modify-write 2026-04-24 18:56:09 -07:00
Ishaan Jaffer
501271b168
migration: create LiteLLM_TeamMemberModelSpend table 2026-04-24 18:56:05 -07:00
Ishaan Jaffer
b6692ef754
schema: add LiteLLM_TeamMemberModelSpend table for atomic per-model spend tracking 2026-04-24 18:56:02 -07:00
Ishaan Jaffer
2d11231737
feat: replace raw JSON TextInput with ModelBudgetEditor in CreateTeamModal 2026-04-24 18:37:35 -07:00
Ishaan Jaffer
a8bfd352a8
docs: remove budget_duration from team_member_model_max_budget comment (not yet enforced) 2026-04-24 18:37:31 -07:00
Ishaan Jaffer
1a9edf3a6c
fix: check all models in list against per-model budget, not just model[0] 2026-04-24 18:37:28 -07:00
Ishaan Jaffer
138e182459
fix: add team_member_model_list_transactions to DBSpendUpdateTransactions init in redis buffer 2026-04-24 18:25:40 -07:00
Ishaan Jaffer
5f2b88ea5b
schema: add model_spend to root schema.prisma (source of truth for sync check) 2026-04-24 18:25:36 -07:00
Ishaan Jaffer
9cdd4789da
feat: seed per-model spend counter from DB on cache miss to prevent budget bypass after restart 2026-04-24 18:19:44 -07:00
Ishaan Jaffer
5c02d62710
feat: persist per-model team member spend to DB via _commit_team_member_model_spend_to_db 2026-04-24 18:19:40 -07:00
Ishaan Jaffer
aeb0b7cad6
feat: handle TEAM_MEMBER_MODEL entity type in spend update queue aggregation 2026-04-24 18:19:37 -07:00
Ishaan Jaffer
890652e27e
feat: add TEAM_MEMBER_MODEL entity type and team_member_model_list_transactions to spend types 2026-04-24 18:19:35 -07:00
Ishaan Jaffer
da1c05b116
migration: add model_spend JSONB column to LiteLLM_TeamMembership 2026-04-24 18:19:32 -07:00
Ishaan Jaffer
a04ecf221b
schema: add model_spend to LiteLLM_TeamMembership in proxy-extras schema 2026-04-24 18:19:29 -07:00
Ishaan Jaffer
6d9e3e0e8d
schema: add model_spend Json column to LiteLLM_TeamMembership for per-model spend tracking 2026-04-24 18:19:26 -07:00
Ishaan Jaffer
8f1f7eb157
fix: use inspect.signature instead of broad TypeError to detect use_v2_resolver support 2026-04-24 18:19:23 -07:00
Ishaan Jaffer
fe7ca53950
fix: skip model budget rows with null max_budget to avoid silently blocking all traffic 2026-04-24 17:47:41 -07:00
Ishaan Jaffer
39207405d7
docs: add team_member_model_max_budget to new_team and update_team docstrings 2026-04-24 17:47:38 -07:00
Ishaan Jaffer
6725fb957e
fix: black formatting on _types.py 2026-04-24 17:47:35 -07:00
Ishaan Jaffer
17b8749e1a
fix: remove budget_duration from ModelBudgetEditor (not yet enforced) 2026-04-24 17:19:05 -07:00
Ishaan Jaffer
ee3e4f00a3
fix: use model_group not resolved model name for per-model spend counter key 2026-04-24 17:19:05 -07:00
Ishaan Jaffer
f844ff664e
feat: replace JSON textarea with model dropdown editor for team_member_model_max_budget 2026-04-24 17:11:24 -07:00
Ishaan Jaffer
e5c33ca695
feat: show team_member_model_max_budget field in Create Team modal UI
Add 'Default Member Model Budget' input field to the Create Team form in OldTeams.tsx
so admins can set per-model spend limits for team members without expanding the
Additional Settings accordion. Field accepts JSON format and is parsed before submission.
2026-04-24 17:11:24 -07:00
Ishaan Jaffer
4aa097e645
fix: handle older proxy-extras that don't support use_v2_resolver kwarg 2026-04-24 17:11:24 -07:00
Ishaan Jaffer
871786c32c
feat: pass model to increment_spend_counters in cost callback 2026-04-24 17:11:24 -07:00
Ishaan Jaffer
af31004761
feat: track per-model spend in increment_spend_counters 2026-04-24 17:11:24 -07:00
Ishaan Jaffer
000d819620
feat: add _check_team_member_model_budget to common_checks 2026-04-24 17:11:24 -07:00
Ishaan Jaffer
41a9bfc94f
feat: add team_member_model_max_budget field to NewTeamRequest and UpdateTeamRequest 2026-04-24 17:11:24 -07:00
yuneng-jiang
70a986e689
Merge pull request #26457 from BerriAI/litellm_enterpriseLicenseMetadata
[Infra] Declare proprietary license in litellm-enterprise metadata
2026-04-24 16:10:32 -07:00
ryan-crabbe-berri
c91a22a001
Merge pull request #26438 from BerriAI/litellm_fix-jwt-admin-bypass
fix(jwt-auth): apply team TPM/RPM + attribution for admins using x-litellm-team-id
2026-04-24 16:07:50 -07:00
ishaan-berri
7cf6a95b62
fix(vertex passthrough): log :embedContent and :batchEmbedContents responses (#26146)
* fix(vertex passthrough): log :embedContent and :batchEmbedContents responses

* test(vertex passthrough): add unit tests for :embedContent and :batchEmbedContents logging

* fix(vertex passthrough): extract input text from request body for embedContent token counting

* fix(vertex passthrough): add embedContent and batchEmbedContents to TRACKED_VERTEX_ROUTES

* fix(vertex passthrough): detect Google AI Studio URLs in embedContent handler

* test(vertex passthrough): add unit test for Google AI Studio URL embedContent provider detection

* style: black format vertex_passthrough_logging_handler
2026-04-24 16:07:11 -07:00
Yuneng Jiang
5d8ef97fa1
chore(packaging): declare proprietary license in litellm-enterprise metadata
The enterprise package ships under the BerriAI Enterprise License defined
in enterprise/LICENSE.md, which is not an SPDX-listed license. Declare it
via PEP 639's LicenseRef-Proprietary expression so metadata-reading tools
(PyPI classifiers, Nexus IQ, pip-licenses) resolve it instead of reporting
License-None. The existing license-files entry already ships the full terms.
2026-04-24 14:56:28 -07:00
shin-berri
082a8faf46
Merge pull request #26454 from BerriAI/litellm_remove_docs_repo_moved
[Infra] Remove docs/my-website, point contributors to litellm-docs repo
2026-04-24 14:54:35 -07:00
Ryan Crabbe
a0bba43cea
fix(jwt-auth): soft-fail unresolvable x-litellm-team-id for admins
Previously, an admin JWT sending a stale/typo'd/missing x-litellm-team-id
on an LLM API route received a hard 404 from get_team_object, blocking the
request. Restore pre-PR admin behavior: if the header can't be resolved,
skip team attribution and proceed with admin access, logging a warning
with the header value and route so the misconfigured caller is diagnosable.
2026-04-24 14:31:36 -07:00
Yuneng Jiang
d42281338e ci: check out litellm-docs directly into docs/my-website
Replaces the rm-and-symlink hack with a plain actions/checkout
using path: docs/my-website. The previous approach failed on this
branch because docs/my-website no longer exists in the repo (its
parent docs/ directory was also removed), so ln -s had nowhere
to create the symlink.

Also adds the same checkout step to test-unit-documentation.yml,
which was silently relying on docs/my-website existing in-tree
for test_env_keys.py and test_router_settings.py.
2026-04-24 14:21:18 -07:00