Commit graph

54174 commits

Author SHA1 Message Date
devin-ai-integration[bot]
bc2cc42340
docs(proxy): describe /v1/decisions and /v1/systemone in Swagger UI (#45838)
* docs(proxy): describe /v1/decisions and /v1/systemone in Swagger UI

Add summaries, descriptions, inlined request body schemas with examples and typed 200 responses to the
decision routes and their aliases, so the OpenAPI document and the lazy snapshot show both request formats

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

* fix(proxy): cap _inlined schema walk depth for the recursion check

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

---------

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 21:04:59 +00:00
devin-ai-integration[bot]
5b6ecab52d
fix(proxy): describe rejected characters in key_alias validation error (#41412)
* fix(proxy): describe rejected characters in key_alias validation error

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

* fix(proxy): wrap key_alias validation error message

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

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Yuneng Jiang <yuneng@berri.ai>
2026-10-10 14:03:33 -07:00
nate-berri
c582bc6e68
refactor(core_utils): move resource_ownership out of the proxy (#45805)
* refactor(types): move LitellmUserRoles and KeyManagementRoutes into litellm.types.proxy.auth.user_roles

Part of LIT-9423

* refactor(types): move is_jwt into litellm.types.proxy.auth.user_api_key_auth

Part of LIT-9423

* refactor(auth): alias is_jwt import so JWTHandler.is_jwt is not read as recursive

* refactor(types): type UserAPIKeyAuth, its token view and hash_token in place

Part of LIT-9423

* refactor(types): move UserAPIKeyAuth, its token view and hash_token into litellm.types.proxy.auth.user_api_key_auth

Part of LIT-9423

* fix(types): keep agent, budget snapshot and is_jwt names importable from proxy._types

Part of LIT-9423

* refactor(core_utils): move resource_ownership out of the proxy

Part of LIT-9423

* fix(types): restore main's _types.py content alongside the user_api_key_auth move

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

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

* style(types): drop blank lines between proxy._types re-export imports

Part of LIT-9423

* refactor(proxy): keep only user_api_key_auth re-exports in _types.py

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

* refactor(proxy): carry main's UserAPIKeyAuth field into moved file

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

* style(types): drop blank lines between proxy._types re-export imports

Part of LIT-9423

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 21:02:53 +00:00
nate-berri
9e7e5c24e4
refactor(types): move UserAPIKeyAuth, its token view and hash_token into litellm.types.proxy.auth.user_api_key_auth (#45800)
* refactor(types): move LitellmUserRoles and KeyManagementRoutes into litellm.types.proxy.auth.user_roles

Part of LIT-9423

* refactor(types): move is_jwt into litellm.types.proxy.auth.user_api_key_auth

Part of LIT-9423

* refactor(auth): alias is_jwt import so JWTHandler.is_jwt is not read as recursive

* refactor(types): type UserAPIKeyAuth, its token view and hash_token in place

Part of LIT-9423

* refactor(types): move UserAPIKeyAuth, its token view and hash_token into litellm.types.proxy.auth.user_api_key_auth

Part of LIT-9423

* fix(types): keep agent, budget snapshot and is_jwt names importable from proxy._types

Part of LIT-9423

* fix(types): restore main's _types.py content alongside the user_api_key_auth move

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

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

* style(types): drop blank lines between proxy._types re-export imports

Part of LIT-9423

* refactor(proxy): keep only user_api_key_auth re-exports in _types.py

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

* refactor(proxy): carry main's UserAPIKeyAuth field into moved file

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

* style(types): drop blank lines between proxy._types re-export imports

Part of LIT-9423

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 21:02:16 +00:00
Soham Chatterjee
b6037990c2
feat(models): register ScaleDown text pricing (#44167)
* Add ScaleDown model pricing

Registers the five ScaleDown models in the pricing map. ScaleDown bills on
input tokens only, so output_cost_per_token is zero for every entry. The
classify and decisions models bill at $0.04 per million input tokens, and
extract, summarize, and compress bill at $0.05 per million.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Price all ScaleDown models at $0.04 per million and drop unverified context limits

Every ScaleDown model now bills $0.04 per million input tokens. The
32000-token max_input_tokens/max_output_tokens values were not confirmed
against the service, so they are removed rather than registered.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Price all ScaleDown models at $0.05 per million input tokens

This is the standard rate in ScaleDown's billing and matches the usage dashboard.
The Decisions usage.cost field is not used for pricing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Add regression tests for the ScaleDown pricing entries

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Cite the source of the ScaleDown rate in the pricing tests and type them

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(scaledown): type the pricing model registry

* fix(scaledown): address pricing review annotations

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: moe-berri <moe@berri.ai>
2026-10-10 14:02:03 -07:00
Soham Chatterjee
38bdda9ca7
feat(scaledown): add native text provider support (#44168)
* Add ScaleDown model pricing

Registers the five ScaleDown models in the pricing map. ScaleDown bills on
input tokens only, so output_cost_per_token is zero for every entry. The
classify and decisions models bill at $0.04 per million input tokens, and
extract, summarize, and compress bill at $0.05 per million.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Price all ScaleDown models at $0.04 per million and drop unverified context limits

Every ScaleDown model now bills $0.04 per million input tokens. The
32000-token max_input_tokens/max_output_tokens values were not confirmed
against the service, so they are removed rather than registered.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Price all ScaleDown models at $0.05 per million input tokens

This is the standard rate in ScaleDown's billing and matches the usage dashboard.
The Decisions usage.cost field is not used for pricing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Add regression tests for the ScaleDown pricing entries

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Cite the source of the ScaleDown rate in the pricing tests and type them

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Add ScaleDown as a chat provider

ScaleDown serves five models over two wire protocols. extract, summarize, and
compress speak OpenAI chat on /v1/chat/completions, while classify and
decisions implement the Jev Decisions API on /v1/scaledown, taking a state
object plus a questions map and returning one typed answer per question.

The provider authenticates with x-api-key rather than a bearer token, and the
decisions models need a non-chat request body, so it routes through the HTTP
handler instead of the OpenAI passthrough. Malformed decisions requests are
rejected locally with a message naming the problem, so callers do not have to
decode an opaque 422 from upstream. Decisions bills one model call per
question, so the cost upstream reports is passed through rather than
re-estimated from token counts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Route ScaleDown domain models to the native API and stop trusting usage.cost

The /v1/chat/completions and /v1/models routes return 403 on api.scaledown.xyz,
so extract, summarize and compress now call the native /extract,
/summarization/abstractive and /compress/raw/ endpoints. The default api_base is
the bare host; a trailing /v1 is stripped and re-added only for decisions.

The Decisions usage.cost field was about 600x the dashboard amount, so it is no
longer passed through; cost is computed from input tokens at the registered rate.
Native responses are returned unchanged as JSON, including the _value/_span_anchor
wrappers on nested extraction. They carry no output token count, so
completion_tokens is reported as 0 and documented as unmeasured.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Move ScaleDown translation into llms/ and address review findings

- Dispatch moves to llms/scaledown/chat/handler.py; main.py keeps a thin call
  and get_llm_provider_logic.py no longer has a ScaleDown branch, since the
  config resolves key and base URL itself.
- questions passed via extra_body are merged and validated after the shared
  merge (sign_request), so the documented extra_body path works.
- extra_body can no longer change the upstream model, and decisions state may
  carry a document but not text, so guardrails always see the text.
- A custom api_base requires its own api_key; the environment key is only sent
  to the default host or SCALEDOWN_API_BASE.
- Image content parts become the decisions document; max_completion_tokens maps
  to max_tokens; stream is served as one chunk for every model.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Refuse prompt-bearing extra_body keys and empty-key fallback to the env credential

extra_body is merged after guardrails inspect the messages, so each model now
accepts only option keys there (extract threshold/top_n, compress
compression_rate, decisions questions/state); text, instructions, prompt,
context and model are rejected. An empty api_key no longer lets the
SCALEDOWN_API_KEY from the environment go to a custom api_base.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Read compress token usage from the real response shape

/compress/raw/ nests the per-prompt counts under results and reports the total
as a top-level input_tokens; the provider read a top-level original_prompt_tokens
that is not there, so compress reported zero tokens and zero cost.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Accept the router's max_retries and word the extra_body error clearly

The proxy adds max_retries to every call, which map_openai_params rejected, so
every proxied ScaleDown request failed with a 400. It is now accepted and not
forwarded.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Return extracted fields from extract, follow schema refs, and meet the type-discipline gate

- extract content is now the extracted fields (span anchors dropped, wrappers
  unwrapped), so it validates against the caller's response_format; the raw
  payload stays on _hidden_params['scaledown_response'].
- Local $ref/$defs in the response_format schema are resolved.
- The adapter is rewritten with Final locals, read-only annotations, one raising
  helper and a typed handler; check_type_discipline reports no violations.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Fix stream_options, schema-guided extract cleaning, document input and multi-image handling

- stream_options is accepted and not sent upstream, so include_usage streams work.
- Extract output is cleaned against the requested entities, so a field named
  _value or *_span_anchor is no longer dropped.
- Extract and summarize send an image or PDF as the native document fields.
- More than one image is rejected instead of silently using the first.
- The cost test derives its rate from the cost map.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Cut recursive schema refs at the cycle and cap the expanded entity count

A small response_format schema with a self-referencing $def expanded to 4^16
leaves before any request was sent. Refs that point back into themselves are now
cut off at that point, and the total expanded entities are capped at 1000 so
repeated acyclic refs are rejected with a clear error.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Bound ref chains and schema nesting so long schemas fail cleanly

Resolving a chain of thousands of distinct $refs recursed until RecursionError.
Ref resolution is now an iterative walk capped at 32 hops, and nested properties
are capped at 32 levels; both raise a clear 400 instead.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(scaledown): support native classify and preserve extraction results

* test(scaledown): include provider regressions in CI shard

* fix(scaledown): pass registry typing and bounded recursion checks

* docs(scaledown): capture provider setup before and after

* fix(scaledown): preserve nullable schemas and reject malformed requests

* fix(scaledown): isolate provider dispatch from existing providers

* fix(scaledown): preserve the shared dispatch return contract

* fix(scaledown): preserve failure logging and reject lossy schemas

* fix(scaledown): keep timeout typing annotation on its expression

* fix(scaledown): resolve escaped extraction schema references

* fix(scaledown): annotate the bounded reference walk

* chore(scaledown): remove unused loop suppression

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: moe-berri <moe@berri.ai>
2026-10-10 14:01:17 -07:00
nate-berri
2011004d0a
refactor(types): move MemberDeleteRequest into litellm.types.proxy.management_endpoints.team_endpoints (#45814)
* refactor(types): move LitellmUserRoles and KeyManagementRoutes into litellm.types.proxy.auth.user_roles

Part of LIT-9423

* refactor(types): annotate GenerateRequestBase containers and check_max_budget

Part of LIT-9423

* refactor(types): move GenerateRequestBase and LiteLLM_ObjectPermissionBase into litellm.types.proxy.management_endpoints.request_base

Part of LIT-9423

* refactor(types): annotate user request metadata and check_user_info validators

Part of LIT-9423

* refactor(types): move user request models into litellm.types.proxy.management_endpoints.user_requests

Part of LIT-9423

* refactor(types): move MemberDeleteRequest into litellm.types.proxy.management_endpoints.team_endpoints

Part of LIT-9423

* fix(types): restore main's _types.py content alongside the request_base move

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

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

* style(types): merge request_base re-exports into one import block

Part of LIT-9423

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 20:58:46 +00:00
nate-berri
513e7a89ac
refactor(types): move user request models into litellm.types.proxy.management_endpoints.user_requests (#45813)
* refactor(types): move LitellmUserRoles and KeyManagementRoutes into litellm.types.proxy.auth.user_roles

Part of LIT-9423

* refactor(types): annotate GenerateRequestBase containers and check_max_budget

Part of LIT-9423

* refactor(types): move GenerateRequestBase and LiteLLM_ObjectPermissionBase into litellm.types.proxy.management_endpoints.request_base

Part of LIT-9423

* refactor(types): annotate user request metadata and check_user_info validators

Part of LIT-9423

* refactor(types): move user request models into litellm.types.proxy.management_endpoints.user_requests

Part of LIT-9423

* fix(types): restore main's _types.py content alongside the request_base move

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

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

* style(types): merge request_base re-exports into one import block

Part of LIT-9423

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 20:58:11 +00:00
nate-berri
c9d706adb5
refactor(types): move key request models into litellm.types.proxy.management_endpoints.key_requests (#45810)
* refactor(types): move LitellmUserRoles and KeyManagementRoutes into litellm.types.proxy.auth.user_roles

Part of LIT-9423

* refactor(types): annotate GenerateRequestBase containers and check_max_budget

Part of LIT-9423

* refactor(types): move GenerateRequestBase and LiteLLM_ObjectPermissionBase into litellm.types.proxy.management_endpoints.request_base

Part of LIT-9423

* refactor(types): annotate key request containers and drop_blank_team_id

Part of LIT-9423

* refactor(types): move key request models into litellm.types.proxy.management_endpoints.key_requests

Part of LIT-9423

* fix(types): keep MappingProxyType exported from litellm.proxy._types for star importers

Part of LIT-9423

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main
2026-10-10 20:58:07 +00:00
devin-ai-integration[bot]
dc95de5209
feat(otel)!: let a team capture_message_content override the global setting for its OTel v2 destination (#44264)
* feat(otel): let a team strip captured message content from its own OTel v2 destination

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

* refactor(proxy): split the shared callback option conflict check and sync dashboard API types

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

* fix(otel): address review feedback on team capture_message_content

Classify capture_message_content as NotSecret in the credential slot registry, inject test exporters through register_exporter_factory instead of patching _exporter_from_spec, type the test helpers, and stop reassigning processor in build_tracer_provider

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

* test(otel): add integration cells for team capture_message_content

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

* test(otel): cover weave_otel and newrelic team destinations in capture_message_content cells

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

* fix(otel): stop rejecting client-sent capture_message_content at the request body boundary

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

* feat(otel): let a team capture_message_content override the global setting in both directions

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

* fix(otel): keep a team's capture_message_content on its own OTel v2 destination

The setting no longer rides the flattened team callback vars, so a sibling destination and a routed provider follow the global mode. Request bodies get the base 400 back, a failure-only entry rejects the setting, and entries for one backend must agree

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

* test(otel): type the capture_message_content callback validation tests

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

* test(otel): type the remaining capture_message_content test signatures

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

* test(otel): mark the new capture_message_content test locals Final

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

* fix(otel): default tenant capture to callback_settings.otel and keep CaptureMessageContent formatting bare

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

* fix(otel): keep CaptureMessageContent a plain str like main

The str-to-Enum switch changed the public type: the config field's type,
repr and model_dump, a constructor that now raised on unknown values, and
unknown env values coerced to no_content. CaptureMessageContent is the plain
str subclass main ships again, the field is a str, and a
captures_span_content helper replaces the enum property. A test pins that a
published preset's capture mode stays the default for an unowned
destination, which is what main forwards.

* test(otel): drop the module-level CaptureMessageContent import the rewritten test no longer uses

* fix(lint): keep the merged branch within main's type budgets

Freeze the capture-mode settings model (LIT015) and read stored logging
entries through one typed sequence helper, so the conflicting-capture checks
add no unknown types.

* fix(otel): reject a destination capture_message_content while OTel v2 is off

The legacy OTel callbacks never read the per-destination setting, so a team
could register no_content and still export prompts and replies under the
global capture mode. Registration now refuses the var unless the proxy runs
with LITELLM_OTEL_V2=true, the same rule the Arize transport and New Relic
routing vars follow.

* test(otel): type the OTel v2 fixtures and the v2-off regression test

* fix(otel): accept only no_content and span_only on a team or key destination

OTel v2 writes captured content only to span attributes, so event_only
behaved like no_content and span_and_event like span_only on a
destination. The proxy-wide setting keeps all four values

* docs(otel): say an omitted capture setting follows the proxy's own callback for that backend

* test(otel): describe the general capture fallback in the unowned destination test

---------

Co-authored-by: mrinal <mrinal@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: yucheng-berri <yucheng@berri.ai>
Co-authored-by: yucheng-berri <293926326+yucheng-berri@users.noreply.github.com>
2026-10-10 13:52:32 -07:00
nate-berri
3981228d70
refactor(anthropic): move raw SSE stream assembly helpers out of proxy guardrails (#45749)
* refactor(anthropic): move passthrough SSE stream assembly into litellm/llms

Part of LIT-9423

* refactor(anthropic): move raw SSE stream assembly helpers out of proxy guardrails

Part of LIT-9423

* refactor(anthropic): give the anthropic_sse re-exports reasoned noqa codes

Part of LIT-9423

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

* test(anthropic): cover the raw SSE helpers in stream_assembly

Part of LIT-9423
2026-10-10 20:35:49 +00:00
yuneng-jiang
f58c86f1d7
perf(ci): use native timing splits with bounded integration concurrency (#45837)
* perf(ci): use native timing splits with bounded integration concurrency

* fix(ci): make integration parallelism opt in
2026-10-10 13:35:11 -07:00
nate-berri
981710fab8
refactor(types): move GenerateRequestBase and LiteLLM_ObjectPermissionBase into litellm.types.proxy.management_endpoints.request_base (#45802)
* refactor(types): move LitellmUserRoles and KeyManagementRoutes into litellm.types.proxy.auth.user_roles

Part of LIT-9423

* refactor(types): annotate GenerateRequestBase containers and check_max_budget

Part of LIT-9423

* refactor(types): move GenerateRequestBase and LiteLLM_ObjectPermissionBase into litellm.types.proxy.management_endpoints.request_base

Part of LIT-9423

* fix(types): restore main's _types.py content alongside the request_base move

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

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

* style(types): merge request_base re-exports into one import block

Part of LIT-9423

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 20:35:07 +00:00
nate-berri
2374b0c398
refactor(types): annotate key request containers and drop_blank_team_id (#45809)
* refactor(types): annotate key request containers and drop_blank_team_id

Part of LIT-9423

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 20:34:39 +00:00
nate-berri
12c36b054b
refactor(constants): move AUTH_OBJECTS_TARGET into litellm.constants (#45779)
* refactor(constants): move AUTH_OBJECTS_TARGET into litellm.constants

Part of LIT-9423

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 20:33:58 +00:00
devin-ai-integration[bot]
5325c4a236
feat(proxy): per-model team member budgets with router fallback (#43887)
Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 20:33:55 +00:00
nate-berri
7383f59ad2
refactor(skills): move NewSkillRequest to litellm.models.skills (#45768)
* refactor(skills): move NewSkillRequest to litellm.models.skills

Part of LIT-9423

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 20:33:16 +00:00
Yassin Kortam
3a0803aaa1
fix(ui): store SSO exchange token via storeLoginToken to keep Secure flag (#45840)
Co-authored-by: Nabil Ameena <nabilaameena@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 13:33:03 -07:00
Marcus Greer
4e44b382fd
fix(terraform): stop sending blocked on litellm_user updates (#45410)
* fix(terraform): stop sending blocked on litellm_user updates

/user/update writes blocked into the user table upsert, but blocked only
exists as a column on keys, so every litellm_user update failed with a 400
from Prisma. Updates no longer send it. Create sends it only when set to
true, since /user/new applies it to the auto-created key

blocked only applies at creation; litellm_key_block covers changes after that

* fix(terraform): always send blocked on litellm_user create

/user/new fills an omitted blocked from default_internal_user_params, so
leaving it out on create let a proxy-side blocked=true default block the
auto-created key. Create sends the configured value again, including
false, while updates still never send it

* chore(terraform): drop comment on litellm_user create blocked

* fix(terraform): keep litellm_user blocked undeprecated

Create sends blocked again, so it still controls the auto-created key.
Whether to deprecate it in favor of litellm_key_block is left to the
provider maintainers; the docs describe it as creation-only instead
2026-10-10 13:32:54 -07:00
nate-berri
c397b57f2b
refactor(anthropic): move prompt cache pricing helper out of the proxy package (#45753)
* refactor(anthropic): move prompt cache pricing helper out of the proxy package

Part of LIT-9423

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 20:32:34 +00:00
nate-berri
691ca03266
fix(sdk): resolve litellm.proxy lazily on attribute access (#45845)
The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main
2026-10-10 13:20:31 -07:00
Yassin Kortam
cf1284f3d5
fix(proxy-extras): bound migration DDL lock waits with lock_timeout and retry (#45389)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 12:52:52 -07:00
devin-ai-integration[bot]
b72bfa735b
fix(ui): show the team member budget on keys without their own budget (#43927)
Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 12:36:59 -07:00
devin-ai-integration[bot]
77b6d048df
fix(proxy): let configured pass-through endpoints outrank built-in provider prefix routes (#44133)
Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 12:26:17 -07:00
Yassin Kortam
cb73bad48a
fix(caching): give RedisClusterCache one async client per event loop (#45784)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 12:23:45 -07:00
Yassin Kortam
3f16213906
feat(usage): add top users by spend and user activity views (#45310)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-10 12:21:43 -07:00
nate-berri
7831d8a991
refactor(types): move is_jwt into litellm.types.proxy.auth.user_api_key_auth (#45747)
* refactor(types): move LitellmUserRoles and KeyManagementRoutes into litellm.types.proxy.auth.user_roles

Part of LIT-9423

* refactor(types): move is_jwt into litellm.types.proxy.auth.user_api_key_auth

Part of LIT-9423

* refactor(auth): alias is_jwt import so JWTHandler.is_jwt is not read as recursive
2026-10-10 19:08:56 +00:00
nate-berri
a859d844ed
refactor(types): annotate user request metadata and check_user_info validators (#45808)
Part of LIT-9423
2026-10-10 19:08:31 +00:00
nate-berri
b7d48ecd28
refactor(types): annotate GenerateRequestBase containers and check_max_budget (#45801)
Part of LIT-9423
2026-10-10 19:08:25 +00:00
nate-berri
dec8ec5daa
refactor(types): type UserAPIKeyAuth, its token view and hash_token in place (#45799)
Part of LIT-9423
2026-10-10 19:08:14 +00:00
nate-berri
c9e0ec8719
refactor(responses): move ColdStorageHandler out of proxy into litellm_core_utils (#45783)
Part of LIT-9423
2026-10-10 19:08:04 +00:00
nate-berri
d1c4d0666f
refactor(repositories): import proxy helpers inside the methods that use them (#45781)
Part of LIT-9423
2026-10-10 19:07:53 +00:00
nate-berri
0fc6d4d16d
refactor(types): move complexity router request models next to their base config (#45780)
* refactor(types): move complexity router request models next to their base config

Part of LIT-9423

* test(types): cover the old auto-router import path for the moved request models

Part of LIT-9423
2026-10-10 19:07:41 +00:00
nate-berri
4606bf532e
refactor(types): import litellm lazily in prometheus types helpers (#45776)
Part of LIT-9423
2026-10-10 19:07:32 +00:00
nate-berri
9d559d8579
refactor(core): move path_utils from proxy common_utils to litellm_core_utils (#45775)
Part of LIT-9423
2026-10-10 19:07:22 +00:00
nate-berri
13191e5b66
refactor(types): import CustomLogger and CustomLLM under TYPE_CHECKING in adapter TypedDicts (#45774)
Part of LIT-9423
2026-10-10 19:07:11 +00:00
nate-berri
d02dc43154
refactor(responses): move responses_api_bridge_check out of litellm.main (#45772)
Part of LIT-9423
2026-10-10 19:07:00 +00:00
nate-berri
8d510a6b1b
refactor(cost-calc): move cache token extractors out of proxy savings (#45771)
Part of LIT-9423
2026-10-10 19:06:49 +00:00
nate-berri
9e3cd2f0a4
refactor: move stream_chunk_builder into streaming_chunk_builder_utils (#45766)
Part of LIT-9423
2026-10-10 19:06:41 +00:00
nate-berri
8f047e0a33
refactor(types): move PassThroughGuardrailSettings into the pass-through types module (#45763)
Part of LIT-9423
2026-10-10 19:06:30 +00:00
nate-berri
9c8083e323
refactor(types): move slack alerting leaf types out of proxy/_types.py (#45752)
Part of LIT-9423
2026-10-10 19:06:22 +00:00
nate-berri
ebf2156ec4
refactor(anthropic): move prompt cache observation lookup out of the proxy hook (#45748)
* refactor(anthropic): move prompt cache observation lookup out of the proxy hook

Part of LIT-9423

* test(internal_context): exempt moved prompt cache lookup helper from key-family check
2026-10-10 19:06:16 +00:00
nate-berri
38880fd5ce
refactor(types): move CommonProxyErrors into litellm/types/proxy (#45745)
Part of LIT-9423
2026-10-10 19:06:04 +00:00
nate-berri
396e8d1e6c
refactor(llms): move typesafe passthrough logging handler out of proxy (#45742)
Part of LIT-9423
2026-10-10 19:05:58 +00:00
nate-berri
3fafd0062a
refactor(types): import team and user table models from litellm.models (#45740)
Part of LIT-9423
2026-10-10 19:05:47 +00:00
nate-berri
7f5abfffb4
refactor(anthropic): move passthrough SSE stream assembly into litellm/llms (#45744)
Part of LIT-9423
2026-10-10 19:05:37 +00:00
nate-berri
a3f05fb52f
refactor(types): move LitellmUserRoles and KeyManagementRoutes into litellm.types.proxy.auth.user_roles (#45741)
Part of LIT-9423
2026-10-10 19:05:26 +00:00
nate-berri
6c71452355
refactor(skills): import LiteLLM_SkillsTable from litellm.models (#45737)
Part of LIT-9423
2026-10-10 19:05:15 +00:00
berriai-litellm-provider-info-sync[bot]
290ac3d4d2
fix(bedrock): price the regionless Kimi K2.5 and K2 Thinking rows from the us-east-1 Bedrock price map (#45836)
Price-Sync: litellm-providers

Co-authored-by: berriai-litellm-provider-info-sync[bot] <328147090+berriai-litellm-provider-info-sync[bot]@users.noreply.github.com>
2026-10-10 12:00:47 -07:00
devin-ai-integration[bot]
6fcf9ef62d
feat(proxy): require trace IDs per team on LLM, MCP and agent requests (#44933)
* feat(proxy): require trace IDs per team on LLM, MCP and agent requests

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

* test(proxy): assert trace ID authorization outcomes

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

* fix(proxy): clear trace ID type gate errors

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

* style(proxy): format trace ID type check

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

* fix(proxy): validate trace ID metadata

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

* fix(proxy): use read-only trace metadata types

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

* fix(proxy): skip trace ID metadata validation for teams without dict metadata

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

* perf(proxy): check team trace ID setting before route matching

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-10-10 11:50:28 -07:00