Commit graph

48716 commits

Author SHA1 Message Date
yucheng
cd322fafbe refactor(proxy): read ModelResponse off the litellm package in key health
CodeQL flags the module-level import of ModelResponse from litellm.types.utils
as part of a cyclic import; the isinstance check now goes through the
already-imported litellm package like the other proxy hooks do.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 09:40:56 +00:00
yucheng
ba9e47e684 test(proxy): type the /key/health GCS test helpers
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 09:37:27 +00:00
yucheng
62b9130c5f refactor(proxy): import CustomLogger under TYPE_CHECKING in key management endpoints
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 09:02:59 +00:00
yucheng
d45f42f220 fix(proxy): keep /key/health from failing when key metadata logging is null
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 08:39:11 +00:00
yucheng
661295634e fix(gcs_bucket): drain the queue before uploading so a health flush never retries its own requeued batch
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 02:21:43 +00:00
yucheng
caa0a66760 fix(gcs_bucket): serialize the /key/health flush with the periodic flush so an in-flight failure is not missed
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 02:08:47 +00:00
yucheng
ff98dcdc55 fix(proxy): judge /key/health GCS status by the health check's own event
The flush result now carries the ids it uploaded and the ids it failed, so
/key/health reports unhealthy only when its own event failed to upload.
Another team's broken bucket or a leftover retry in the shared queue no
longer marks a working key unhealthy, and the flush walks every pending
batch so an event queued behind more than batch_size items is still judged

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 01:50:04 +00:00
yucheng
b6f46c1eaf test(proxy): register the GCS test logger so the healthy /key/health flush test passes without a license
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 01:03:27 +00:00
yucheng
edfa4b0a32 test(gcs): cover the requeue drop on a refilled queue and the healthy GCS flush in /key/health
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 00:49:49 +00:00
yucheng
8536c5cdf6 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_team_callback_resolution 2026-09-13 00:32:38 +00:00
yucheng
14a7093bfb fix(proxy): keep a team's empty logging list as the disabled state instead of falling back to config callbacks
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 00:23:34 +00:00
yucheng
edea717f3c fix(proxy): report callback entries requests ignore as unhealthy in /key/health
Entries that fail AddTeamCallback validation (for example a key entry without
callback_vars) are dropped by the request-time resolver. /key/health used to
fall through to the next level and call the key healthy with no callbacks.
It now returns unhealthy with the offending entry and the validation error

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 00:07:14 +00:00
yucheng
8ca3812e99 chore(ui): regenerate schema.d.ts for the /key/health docstring change
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 23:53:46 +00:00
ryan-crabbe-berri
d4a72e7372
Merge pull request #40907 from BerriAI/litellm_key_alias_substring_non_admin
fix(proxy): allow key_alias substring matching on /key/list for non-admins
2026-09-12 16:48:17 -07:00
yucheng
7b459ac1bc fix(proxy): resolve team callbacks when key logging is empty and report GCS flush failures
An empty key-level logging list is now treated as unset, so team logging,
deprecated team callback_settings and default_team_settings apply. /key/health
tests the effective callbacks, flushes the GCS logger explicitly and reports
failed uploads. Failed GCS batches stay queued for the next flush instead of
being dropped

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 23:40:18 +00:00
kerry-berri
d565031b9c
Merge pull request #40902 from BerriAI/litellm_openai_reasoning_fallback_rule
feat(registry): add openai reasoning-family fallback generalization
2026-09-12 16:27:16 -07:00
ryan
8ccde3879d Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_key_alias_substring_non_admin 2026-09-12 23:06:23 +00:00
devin-ai-integration[bot]
b1360efc2f
fix(proxy): attribute gate-rejected requests to their endpoint in cache analytics (#40824)
* fix(proxy): attribute gate-rejected requests to their endpoint in cache analytics

Requests rejected before dispatch (bad key, blocked key, budget, rate limit, malformed body) were spend-logged with an empty call_type because the synthesized logging object never reached the failure lifter. The caching dashboard rolled all of them, plus failed calls on info routes such as /model/info, into one Unknown group.

Resolve call_type from the matched route first, falling back to body shape, and keep the synthesized logging object on request_data so the lifter sees it. Log bare auth exceptions with the 401 ProxyException the client gets so error_code is never empty. Exclude info routes from the cache analytics groups and error breakdown. The dashboard explains the Unknown group when older rows still produce one.

Resolves LIT-5884

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): keep the raw auth exception for failure callbacks

Record the client-facing status in the spend log through a separate client_exception argument so custom failure callbacks still receive the exception auth raised.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): keep the route for multi-operation endpoints and exclude info routes from cache filter options

Routes such as /v1/files map to several operations (create, list) and the
method is not available in the failure hook, so a rejected request there is
filed under its route instead of the first mapped call type. The key alias and
model filter-option queries now apply the same info-route exclusion as the
groups and error breakdown, so every offered filter value returns data. The
info-route exclusion and Unknown grouping are now covered against a real
Postgres in tests/proxy_behavior/spend/test_cache_activity.py

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): drop client_exception, the spend log row never used it

The DB spend row for a gate rejection is written by _ProxyDBLogger from the
original exception, so the status-bearing copy only reached the in-memory
logging payload. Live runs at the tip still recorded bare auth exceptions as
Unknown/Exception, the same as the base branch. Removing the plumbing keeps
this PR to endpoint attribution and the info-route exclusion

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 16:03:38 -07:00
ryan-crabbe-berri
c134fb7a38
Merge pull request #39395 from seyeong-han/litellm_meta_muse_voice_realtime
Some checks failed
Unit Tests: Proxy DB Operations / assert-shard-coverage (push) Waiting to run
Unit Tests: Proxy DB Operations / auth-checks (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / budgets (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / custom-logging (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / db-and-spend (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / endpoints-and-responses (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / guardrails-hooks (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / proxy-utils (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / jwt-and-keys (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / key-generation (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / logging-misc (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / proxy-runtime (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / proxy-server-core (push) Blocked by required conditions
Unit Tests / caching-local (push) Waiting to run
Unit Tests / core-utils (push) Waiting to run
Unit Tests / enterprise-package (push) Waiting to run
Unit Tests / enterprise-routing (push) Waiting to run
Unit Tests / integrations (push) Waiting to run
Unit Tests / All Other Providers (push) Waiting to run
Unit Tests / Vertex AI (push) Waiting to run
Unit Tests / misc (push) Waiting to run
Unit Tests / proxy-auth (push) Waiting to run
Unit Tests / proxy-endpoints (push) Waiting to run
Unit Tests / proxy-extras (push) Waiting to run
Unit Tests / proxy-infra (push) Waiting to run
Unit Tests / proxy-server (push) Waiting to run
Unit Tests / responses-caching-types (push) Waiting to run
GitHub Actions Security Analysis / zizmor (push) Waiting to run
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
feat(realtime): add Meta Muse Voice transcription
2026-09-12 15:58:24 -07:00
Mateo Wang
566f026c1c
Merge pull request #40767 from BerriAI/litellm_ocr_custom_pricing
fix(cost): honour deployment custom pricing for OCR calls
2026-09-12 15:55:44 -07:00
mateo-berri
d7158ba795 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_ocr_custom_pricing 2026-09-12 15:42:59 -07:00
Mateo Wang
426e675c49
Merge pull request #40764 from BerriAI/litellm_redis_pool_timeout_counts_as_timeout
fix(redis): count pool wait timeouts as breaker timeouts
2026-09-12 15:42:57 -07:00
ryan-crabbe-berri
0e435e4148 fix(realtime): run transcription guardrails on transcription-only sessions
The provider_config path skipped run_realtime_guardrails for transcription
sessions to avoid sending response.create, which also dropped every
realtime_input_transcription guardrail: no violation error reached the
client and on_violation / end_session_after_n_fails never fired. Run the
guardrail for every completed transcript and only suppress response.create
when the session has no assistant turn.
2026-09-12 15:32:45 -07:00
ryan
02dbff485b test(proxy): mark prisma_client patch in /key/list alias test with test-quality reason
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 22:32:14 +00:00
Mateo Wang
fe5ff9d3b0
Merge pull request #40771 from BerriAI/litellm_regression_coverage_followup
test: tighten regression tests added in #37974
2026-09-12 15:29:36 -07:00
mateo-berri
51abb95de0 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_redis_pool_timeout_counts_as_timeout
# Conflicts:
#	tests/test_litellm/caching/test_redis_cache.py
2026-09-12 15:26:08 -07:00
Mateo Wang
9276317b34
Merge pull request #40855 from BerriAI/litellm_registry_audit_2026_09_12
fix(registry): sync Azure/Together deprecation dates, fix computer-use-preview and OpenRouter metadata
2026-09-12 15:23:26 -07:00
Mateo Wang
e1bff56f0b
Merge pull request #40772 from BerriAI/litellm_lit6982_bucket_config_includes
fix(proxy): resolve config include directives for bucket-hosted configs
2026-09-12 15:21:56 -07:00
Mateo Wang
c040061f15
Merge pull request #40766 from BerriAI/litellm_fix_v1_messages_disconnect_partial_cost
fix(anthropic): price recovered tokens when a /v1/messages client disconnects mid-stream
2026-09-12 15:21:43 -07:00
Mateo Wang
d72ae3b9a2
Merge pull request #39895 from BerriAI/litellm_deflake_20260905
test: deflake redis semantic cache sys.modules leak, LangSmith init loop patch, wall-clock stagger assertion, and zombie grandchild check in the fake prisma cli
2026-09-12 15:20:26 -07:00
Mateo Wang
fc053dae3e
Merge pull request #40770 from BerriAI/litellm_lit6996_agent_skills_wellknown
feat(proxy): serve registered skills as an Agent Skills well-known index
2026-09-12 15:20:20 -07:00
Mateo Wang
f531537aa3
Merge pull request #40768 from BerriAI/litellm_prisma_cli_resolve
fix(proxy): run migrations through python -m prisma when the prisma console script is not on PATH
2026-09-12 15:20:06 -07:00
ryan
df6ec79810 test(proxy): assert /key/list alias substring results end to end for non-admins
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 22:15:11 +00:00
ryan-crabbe-berri
4647cd1215 fix(realtime): keep a Muse turn active for turnless partials after speechEnd
Muse partials carry no turnId and belong to the most recent speechStart,
and the docs say the model may keep post processing a turn after speechEnd
until speechComplete. Releasing the active turn on speechEnd made any
partial arriving in that window raise and get dropped in ENDPOINTING mode.
The turn now stays active until its speechComplete or final transcript.
2026-09-12 15:13:44 -07:00
ryan-crabbe-berri
ba6a0c9fc6
Merge pull request #40652 from BerriAI/litellm_key_activity_search
feat(ui): search Key Activity by key alias, key hash, user id, or email
2026-09-12 15:05:53 -07:00
ryan
a3ebeae28b chore(ui): regenerate schema.d.ts for /key/list substring_matching descriptions
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 22:05:20 +00:00
kerry
df272d7e2f fix(registry): limit reasoning fallback to single-digit gpt majors
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 22:01:58 +00:00
kerry
ca35119168 style(tests): wrap oversized model tuples
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 21:56:11 +00:00
kerry-berri
0f03fc2985
Merge pull request #40901 from BerriAI/litellm_remove_fireworks_price_snapshot_tests
test(fireworks): stop pinning prices in the cost-map tests
2026-09-12 14:53:58 -07:00
ryan
20787ba186 fix(proxy): allow key_alias substring matching on /key/list for non-admins
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 21:52:49 +00:00
yuneng-jiang
626d7aaf6a
Merge pull request #40905 from BerriAI/litellm_/release-version-bump-5f3482
chore: bump litellm-enterprise 0.1.66 -> 0.1.67, litellm-proxy-extras 0.4.96 -> 0.4.97
2026-09-12 14:49:46 -07:00
ryan-crabbe-berri
9a3f752724
Merge pull request #40656 from BerriAI/litellm_ui_table_search_pending_state
fix(ui): show loading state instead of stale rows while a table search is pending
2026-09-12 14:49:24 -07:00
Yuneng Jiang
f3ecdccb59
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_/release-version-bump-5f3482 2026-09-12 14:40:07 -07:00
Yuneng Jiang
147eb23aab
bump: litellm-enterprise 0.1.66 -> 0.1.67, litellm-proxy-extras 0.4.96 -> 0.4.97 2026-09-12 14:40:01 -07:00
devin-ai-integration[bot]
5b36de4646
fix(guardrails): log mask when a guardrail adds request keys (#40882)
* fix(guardrails): log mask when a guardrail adds request keys

_inputs_were_modified only compared keys present in the pre-hook baseline, so a
guardrail that injected a new key such as tools was logged as allow. Compare over
the union of both key sets, and narrow the pre_call return value to the same
prompt-bearing keys the baseline holds so passthrough stays allow.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(guardrails): snapshot apply_guardrail inputs before the hook mutates them

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 14:39:40 -07:00
kerry
543ed2f6da fix(registry): scope codex/deep-research/chat-latest markers to gpt bases
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 21:23:24 +00:00
yuneng-jiang
883b722fd2
Merge pull request #40895 from BerriAI/litellm_budget_clear_persistence
fix(ui): persist cleared budgets and reset intervals
2026-09-12 14:22:24 -07:00
kerry
fbcc602122 test(fireworks): stop pinning prices in the cost-map tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 21:19:35 +00:00
devin-ai-integration[bot]
311d9bba37
perf(policy_engine): dedup attachments in one pass after sorting (#40883)
get_attached_policies_with_reasons rescanned the sorted matches with next() once
per distinct policy, which is quadratic and misses the one second budget past a
few thousand global attachments. Build a policy to broadest attachment map in one
pass instead, keeping the specificity sort and result order.

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 14:19:20 -07:00
kerry
db6b851884 feat(registry): add openai reasoning-family fallback generalization
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 21:14:24 +00:00