Commit graph

156 commits

Author SHA1 Message Date
Yujong Lee
29e810170a refactor(native): wrap endpoint execution in a shared harness 2026-09-07 10:43:50 -07:00
Yujong Lee
3c7bb5131e refactor(native): separate attempts from declarative dispatch 2026-09-07 10:43:50 -07:00
Yujong Lee
f9a1fd42af refactor(ocr): dispatch complete operations through shared runtime 2026-09-07 10:43:50 -07:00
Yujong Lee
20de0ce755 refactor(native): share dispatch lifecycle across existing bridges 2026-09-07 10:43:50 -07:00
mateo-berri
29dcd0cc2e Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_opus5_r4
# Conflicts:
#	basedpyright-code-budget.json
#	type-discipline-budget.json
2026-09-04 21:02:19 -07:00
mateo-berri
9c068117e7 chore: merge origin/litellm_internal_staging into litellm_decrease_anys_opus5_r4 2026-09-04 18:59:35 -07:00
mateo
aedaf0d5a7 chore: ratchet lint budgets after merging litellm_internal_staging
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-05 00:45:00 +00:00
mateo
2e3c58c0fc chore: merge litellm_internal_staging into litellm_techdebt_20260903
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-05 00:35:26 +00:00
ryan-crabbe-berri
b29f9a94bc refactor(router): resolve retry policy by exception MRO and add DefaultRetries
Replace the hand-ordered isinstance ladder in get_num_retries_from_retry_policy
with a class-to-field mapping walked along the exception's MRO, most specific
class first. A RetryPolicy field can no longer go silently dead the way
InternalServerErrorRetries did, and subclasses such as
ContentPolicyViolationError or MidStreamFallbackError pick up their parent's
field when they have none of their own.

Add a DefaultRetries catch-all so errors without a dedicated field
(BadGatewayError, APIConnectionError, NotFoundError, ...) can be governed by the
policy too. Specific fields still win over DefaultRetries.

Wiring the previously dead InternalServerErrorRetries changes one test
expectation: a policy of 2 now overrides a per-deployment num_retries of 5, so
the amplification test sees 3 upstream requests instead of 6.

Expose DefaultRetries as "All other errors" in the Admin UI retry settings tab
and ratchet the lint budgets down by the violations this branch fixed.
2026-09-04 16:09:01 -07:00
mateo
966ab10fd6 chore: ratchet lint budgets after merging litellm_internal_staging
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-04 22:33:15 +00:00
mateo
e7c29351e8 chore: ratchet lint budgets after merging litellm_internal_staging
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-04 16:35:26 +00:00
mateo
41cb19df55 chore: merge litellm_internal_staging into litellm_techdebt_20260903
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-04 16:23:52 +00:00
Yujong Lee
6675e1fd9c fix: preserve Python 3.10 harness compatibility 2026-09-04 09:13:05 -07:00
Yujong Lee
fae3d224eb Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_python_version_ci
# Conflicts:
#	basedpyright-code-budget.json
#	tests/sdk_function_trace/profiler.py
#	tests/sdk_function_trace/test_profiler.py
2026-09-04 09:01:13 -07:00
mateo
8b37de14b1 refactor: drop fresh Any annotations and suppressions from admission control, spend summary, and dual cache
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-04 08:05:04 +00:00
devin-ai-integration[bot]
cf3af0f486
perf(spend): group /spend/logs summary by day in Postgres instead of per-row Prisma group_by (#39351)
* perf(spend): group /spend/logs summary by day in Postgres instead of per-row Prisma group_by

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

* refactor(spend): simplify /spend/logs daily summary aggregation

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

* fix(spend): preserve spend logs response schema

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

* chore: ratchet lint budgets after merge

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

* chore: ratchet lint budgets after merge

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

* fix(spend): compare spend log range bounds as naive UTC timestamps

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

* chore: ratchet lint budgets after merge

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

* chore: ratchet lint budgets after merge

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

* chore: ratchet lint budgets after merge

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

* chore: ratchet lint budgets after merge

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

* test: cover spend logs summary edge cases

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

* chore: ratchet lint budgets after merge

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

* test: cover spend summary request filters

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

* chore: ratchet lint budgets after merge

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

* chore: ratchet lint budgets after merge

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

---------

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-03 23:53:59 +00:00
mateo-berri
2df5f4a7c8 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_responses_queued_id_encryption
# Conflicts:
#	type-discipline-budget.json
2026-09-03 14:45:19 -07:00
mateo-berri
2f5d9ae194 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_responses_queued_id_encryption
# Conflicts:
#	type-discipline-budget.json
2026-09-03 14:29:02 -07:00
mateo-berri
d3b6ce98d6 fix(responses): encrypt the response id on every streamed event
Background streaming emits event types with no typed model, which arrive
as GenericEvent holding a plain dict. Only typed events had their nested
response id rewritten, so those frames advertised the raw internal id
while their siblings advertised the encrypted one. The raw shape skips
the ownership check, so any other key could retrieve or cancel that
response.

Rewrite the advertised id wherever an event carries one, whichever shape
it arrives in, so a future event type cannot reopen this.
2026-09-03 02:41:04 -07:00
mateo-berri
c6bd682a5c Merge branch 'litellm_internal_staging' into litellm_fix_failing_request_slowdown
Resolve type-discipline-budget.json by taking the lower limit per rule so no
ceiling ratchets back up.

Staging's 66a3d24b3f left a duplicate embedding_executor parameter in the
Bedrock KB fake handler, which makes ruff fail on the whole tests tree. Drop
the duplicate here so this branch compiles; #39502 makes the same change on
staging.
2026-09-03 00:20:51 -07:00
mateo-berri
71f5b89499 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_python_version_ci
Resolves two conflicts:

- tests/test_litellm/vector_stores/test_main.py: staging moved search() to a
  RouterVectorStoreEmbeddingExecutor while this branch parametrized the same
  test over query; keep both the executor assertions and the parametrize.
- tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py: staging
  carries a duplicate embedding_executor kwarg that makes the file a
  SyntaxError; drop the trailing duplicate.
2026-09-03 00:16:19 -07:00
mateo-berri
e5c1133a79 chore(lint): re-ratchet lint budgets after merging staging 2026-09-03 06:53:19 +00:00
yuneng-jiang
3cac5e5cd4
fix(sso): resolve multi-valued role claims to the highest privilege role (#39480)
* fix(sso): resolve multi-valued role claims to the highest privilege role

A role claim carrying several roles used to resolve to whichever one the IdP
listed first, so a user holding both proxy_admin_viewer and internal_user lost
org-level spend visibility depending on claim ordering alone.

get_litellm_user_role now picks the highest privilege role out of a list-valued
claim, and the Entra app_roles path shares that same resolution instead of
keeping its own copy of the hierarchy. SAML assertions carrying several role
values go through the same path rather than taking the first value.

* test(sso): lock ranked-over-unranked role resolution for mixed claims

org_admin, team and customer sit outside the privilege ladder. Pin the
resolution for a claim that mixes one of them with a ranked role so the
asymmetry is covered rather than implicit.

* fix(sso): label the claim-sequence cast for the type-discipline gate

* fix(sso): resolve claim entries without recursing

The repo's recursive-function gate rejects self-recursion here, and a role
claim is flat anyway. Pull the single-value lookup into its own helper so the
list branch maps over it instead of calling back into itself.
2026-09-02 22:44:17 -07:00
mateo-berri
59f9d3a799 Merge branch 'litellm_internal_staging' of https://github.com/BerriAI/litellm into litellm_fix_failing_request_slowdown
# Conflicts:
#	basedpyright-code-budget.json
#	type-discipline-budget.json
2026-09-02 22:00:30 -07:00
mateo-berri
7c87451ead chore(router): document the breadcrumb write-back and ratchet lint budgets 2026-09-02 21:40:25 -07:00
mateo-berri
748075be4f Merge origin/litellm_internal_staging into litellm_python_version_ci 2026-09-02 18:21:48 -07:00
mateo-berri
3f9e44f839 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_responses_guardrail_namespace_tools
# Conflicts:
#	type-discipline-budget.json
2026-09-02 16:45:49 -07:00
mateo-berri
1636fdd3e6 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_responses_guardrail_namespace_tools
# Conflicts:
#	basedpyright-code-budget.json
#	type-discipline-budget.json
2026-09-02 16:29:34 -07:00
yujonglee
082bea851e
Merge pull request #39334 from BerriAI/litellm_rust_opt_in_configuration
feat(python): unify Rust opt-in and bridge policy
2026-09-02 16:26:36 -07:00
devin-ai-integration[bot]
a701effbad
refactor(utils): remove the dead get_api_key provider-key resolver (#39260)
get_api_key had no callers. main.py imported it without using it, and
because main.py declares no __all__, the star import in __init__.py
published it as litellm.get_api_key. It duplicated key resolution that
get_llm_provider_logic already performs, which is how a misspelled env
var survived in it unnoticed until #35985. Drop the definition, the
unused import, the test that pinned the ai21 branch, and ratchet the
lint budgets down by the violations it carried.

Resolves LIT-5245

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-02 15:06:36 -07:00
Yujong Lee
77d6aedf0a fix: address cross-version CI failures 2026-09-02 14:17:19 -07:00
mateo-berri
d7ee215c57 fix(responses): keep namespace tools intact when a guardrail returns them unchanged
Any pre_call guardrail on /v1/responses flattened Codex namespace tools
into ns__member functions and wrote the flattened list back to the
request, so the model called mcp__server__tool with no namespace and
Codex rejected the call as unsupported.

The handler now keeps the client's original tools, hands the guardrail a
deep copy of the flattened ones, and rebuilds data["tools"] by matching
the guardrail's output to the originals by type and name. Unchanged
tools go back as the original objects, a dropped or edited namespace
member changes only that member, and tools the guardrail injects are
still appended.

Fixes #39183
2026-09-02 11:32:04 -07:00
Mateo Wang
695d943745
Merge pull request #39104 from BerriAI/litellm_decrease_anys_opus5_r3
refactor(types): replace Any with precise types across 73 modules
2026-09-01 12:26:52 -07:00
Mateo Wang
6661e915a5
Merge pull request #38774 from BerriAI/litellm_fix_openai_embedding_encoding_format_omit
fix(embeddings): omit encoding_format when the client omits it on OpenAI-compatible calls
2026-09-01 10:13:38 -07:00
mateo-berri
215bf03373 refactor(types): replace Any with precise types across 73 modules
Narrows reportAny / reportExplicitAny hot spots in provider transformations,
proxy endpoints, integrations and secret managers by introducing TypedDicts,
Protocols and object-typed boundaries instead of Any, then ratchets the
budget ceilings down to match.

reportAny 14765 -> 14076, reportExplicitAny 4493 -> 4128, ANN401 387 -> 307
2026-09-01 11:05:02 +00:00
mateo-berri
4d19a889fb Merge branch 'litellm_internal_staging' of https://github.com/BerriAI/litellm into litellm_decrease_anys_opus5_r2
# Conflicts:
#	basedpyright-code-budget.json
2026-08-31 15:05:34 -07:00
mateo-berri
fb9ec79d7c Merge branch 'litellm_internal_staging' into litellm_decrease_anys_opus5_r2 2026-08-30 12:49:29 -07:00
mateo-berri
1f702f50ad Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_openai_embedding_encoding_format_omit
Staging moved again mid-recovery; only the ANN201 ratchet conflicted and this branch's tighter limit stands.
2026-08-30 12:43:40 -07:00
mateo-berri
11e0502239 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_openai_embedding_encoding_format_omit
Resolves budget-ratchet conflicts by taking staging's tighter limits and reworks the embedding raw-response helpers so the branch stays net-negative on the LIT001/LIT002 ceilings staging lowered: the request methods now return the LegacyAPIResponse and each caller keeps a single dict(headers) conversion.
2026-08-30 12:32:49 -07:00
mateo-berri
c236bcf241 Merge branch 'litellm_internal_staging' into litellm_decrease_anys_opus5_r2 2026-08-30 12:16:13 -07:00
mateo-berri
fbf7644676 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_fable6
# Conflicts:
#	basedpyright-code-budget.json
#	litellm/integrations/websearch_interception/handler.py
#	litellm/proxy/response_polling/background_streaming.py
#	ruff-strict-budget.json
#	type-discipline-budget.json
2026-08-30 10:02:06 -07:00
mateo-berri
43c838f4b9 Merge branch 'litellm_internal_staging' into litellm_decrease_anys_opus5 2026-08-29 21:41:04 -07:00
mateo-berri
22ff5a8a69 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_fable6
# Conflicts:
#	basedpyright-code-budget.json
#	ruff-strict-budget.json
#	type-discipline-budget.json
2026-08-29 21:32:59 -07:00
mateo-berri
d804b9d4fe fix(vertex_ai): skip non-dict property values in set_schema_property_ordering
The typed rewrite made the properties recursion call .get on every child,
so a malformed schema with a string or list property value raised
AttributeError where it previously passed through untouched.
2026-08-29 16:26:47 -07:00
mateo-berri
ed416a06cb Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_opus5_r2
# Conflicts:
#	basedpyright-code-budget.json
#	litellm/proxy/spend_tracking/budget_reservation.py
#	litellm/proxy/spend_tracking/spend_tracking_utils.py
2026-08-29 16:22:20 -07:00
mateo-berri
048e82ec65 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_opus5_r2
# Conflicts:
#	basedpyright-code-budget.json
#	enterprise/litellm_enterprise/proxy/common_utils/check_batch_cost.py
#	ruff-strict-budget.json
#	type-discipline-budget.json
2026-08-29 15:11:45 -07:00
devin-ai-integration[bot]
645792955d
feat(proxy): cyberark conjur secret manager configuration via Admin UI (#38445)
* feat(proxy): CyberArk Conjur secret manager configuration via Admin UI

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

* test(ui): mock networking base-url helpers in AdminPanel test

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

* fix(proxy): restore deployment CyberArk env config on delete and roll back on persist failure

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

* fix(proxy): reinit env-configured hashicorp vault manager after cyberark persist rollback

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

---------

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-29 13:36:08 -07:00
mateo-berri
39d81380ba chore(lint): fix post-merge type regressions and ratchet lint budgets 2026-08-29 20:16:04 +00:00
mateo-berri
8e687f1004 test(embeddings): move legacy intercepts to the wire for the omitted-format path
The omitted-format path deliberately no longer dispatches through
embeddings.create, so four legacy tests now intercept at the transport or
client.post instead. Also adds a bypass error-path unit test, rewords a stale
comment and a README scope note, and ratchets the lint budgets down.
2026-08-29 12:04:44 -07:00
mateo-berri
c4663a4ae9 chore(budgets): drop stale PLW0133 entry graduated to ruff.toml 2026-08-29 06:51:54 -07:00