Commit graph

16473 commits

Author SHA1 Message Date
mateo-berri
5561b8438c fix(responses): keep a namespace's non-function members when every function member is dropped 2026-09-02 14:18:16 -07:00
Yujong Lee
77d6aedf0a fix: address cross-version CI failures 2026-09-02 14:17:19 -07:00
Mateo Wang
719b67114d
Merge pull request #36811 from BerriAI/litellm_realtime_router_session_model
fix(router): resolve realtime session model to routed deployment
2026-09-02 14:16:00 -07:00
mateo-berri
86c8b93bf7 fix(vector-store): embed Milvus and Azure AI Search queries through the request executor
Milvus REST and Azure AI Search still embedded the query through the SDK, so
a bare Router alias as litellm_embedding_model kept failing after the executor
landed for Valkey. Both now share BaseQueryEmbeddingVectorStoreConfig, which
embeds through the injected executor, drops the empty litellm_embedding_config
requirement, and awaits aembedding on the async path.

The Router executor falls back to the SDK for models the Router does not
serve, so inline provider configs such as azure/text-embedding-3-large with
their own credentials keep working through the proxy.

Tests fake OpenAI and Milvus at the HTTP boundary with respx instead of
patching litellm.embedding.
2026-09-02 14:14:41 -07:00
mateo-berri
f6eff1bde0 fix(router): keep Claude Code session bindings across side calls and workers 2026-09-02 13:55:16 -07:00
Yujong Lee
c8f6531be2 fix: restore Python 3.10 imports and response construction 2026-09-02 13:52:35 -07:00
mateo-berri
ec1fba5dc7 chore: merge litellm_internal_staging into litellm_realtime_router_session_model
Carries a mutable-ok suppression on the router session rewrite for the
tightened LIT002 budget, since the realtime callees deep-copy and
JSON-dump the session, and captures the realtime session kwargs through
an async mock in the router tests instead of an untyped dict.
2026-09-02 13:42:30 -07:00
Yuneng Jiang
d4b0266192
fix(vector_stores): release MongoDB clients built on closed event loops
The async client cache is keyed per event loop, and pymongo's AsyncMongoClient
holds a reference to the loop it was built on, so an entry for a closed loop
kept that client and its sockets alive for the life of the process. A script
that calls asyncio.run once per search fills the cache to its cap this way and
then stops caching entirely. Measured live against Atlas over 40 loops: 32
pinned clients and 212 open descriptors before, 1 cached client and no
monotonic descriptor growth after.
2026-09-02 13:39:14 -07:00
mateo-berri
fd4b15fae6 fix(anthropic): upgrade legacy thinking after the Bedrock Invoke and Vertex structured-output stub swap 2026-09-02 13:37:14 -07:00
yassin
095be37ce5 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_agent_mcp_grants
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-02 20:35:21 +00:00
Yassin Kortam
711430216e
fix(ui): preserve full AgentCore runtime ARN in agent edit form (#39382)
parseDynamicAgentForForm recovered a credential field's value from a
stored model string by splitting both the model_template and the model
on "/" and matching by array index. That breaks for any placeholder
value that itself contains "/", such as a Bedrock AgentCore runtime ARN
resource path (runtime/<runtime-id>), silently dropping everything
after the first slash when populating the edit form. Saving without
touching the field then persisted the truncated ARN.

Replace the index-matching split with a non-mutating template parse
(split on the placeholder pattern, escape and rejoin the literal
segments into a regex) so a placeholder captures everything it needs
regardless of embedded slashes. Also add a lightweight ARN-shape
validator for the AgentCore runtime ARN field, guarded against a
malformed pattern string, so a truncated value is rejected client-side
before it reaches the backend.

Resolves LIT-6737
2026-09-02 13:33:14 -07:00
mateo-berri
7c91b0120f fix(mistral): ensure /v1 on the Voxtral TTS base URL
A host-only api_base or MISTRAL_API_BASE (the documented form, https://api.mistral.ai) built
https://api.mistral.ai/audio/speech and 404ed. Match the chat and OCR configs by appending /v1
when the configured base does not already end with it.
2026-09-02 13:32:51 -07:00
mateo-berri
6fae4b3c39 fix(guardrails): keep the presidio output masker from unmasking after an in-memory update 2026-09-02 13:32:21 -07:00
mateo-berri
808fac0d7e fix(spend-logs): scope non-admin id lookups to viewable rows so id collisions cannot deny the owner 2026-09-02 13:24:42 -07:00
Yuneng Jiang
ed8203757a
fix(vector_stores): refuse MongoDB vector store create with a 400, not a 500
litellm.exception_type passes only litellm's own exception types through
untouched, so the NotImplementedError the search-only refusal raised reached
the caller as APIConnectionError. The proxy served that as a 500 with a
traceback in the body for what is a plain client mistake. Raising
BadRequestError gives the caller a 400 and the message on its own.
2026-09-02 13:21:55 -07:00
mateo
211f5d2d10 test(savings): update gpt-5.5 priority baseline to the published 2.5x fast-mode rate
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-02 20:19:31 +00:00
yujonglee
d8bb7451bf
Merge pull request #39331 from BerriAI/litellm_rust_error_type
refactor(rust): standardize the core Error type
2026-09-02 13:17:19 -07:00
mateo-berri
c996fa75d9 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_agent_mcp_grants 2026-09-02 13:13:56 -07:00
mateo-berri
5da9b7ef90 fix(otel): stamp the Langfuse root observation from the post-guardrail request and response 2026-09-02 13:12:05 -07:00
mateo-berri
0f6d983c70 fix(router): skip Claude Code session binding without pre-routing strategies 2026-09-02 13:08:14 -07:00
mateo
71823afd78 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_registry_audit_2026_09_02 2026-09-02 20:07:27 +00:00
Mateo Wang
afb4d76b67
Merge pull request #39220 from BerriAI/litellm_containers_route_model_list_creds
fix(proxy): route container create and list through model_list deployments
2026-09-02 13:04:04 -07:00
Devin AI
0346bb2659 fix(bedrock): upgrade legacy thinking after the invoke response_format stub model swap
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-02 19:58:05 +00:00
mateo-berri
55c7872496 fix(proxy-extras): rebuild indexes left INVALID by a migration deadlock
Two replicas racing prisma migrate deploy can deadlock, and the loser dies
mid CREATE INDEX CONCURRENTLY, leaving the index INVALID. The retried
migration's IF NOT EXISTS then skips it, so the planner never uses it.

After migrations succeed, look for INVALID indexes on LiteLLM tables and
have one replica (advisory try-lock) REINDEX INDEX CONCURRENTLY each of
them, dropping _ccnew/_ccold leftovers of an interrupted rebuild instead.
The repair never blocks startup: a failed rebuild is logged and retried
on the next boot. Also encode DATABASE_URL query values with quote instead
of quote_plus so options=-c%20... reaches psycopg intact.
2026-09-02 12:57:06 -07:00
mateo-berri
dc12e4c2b4 fix(responses): match guardrail tools by ordinal in one pass
Sort the chat-tool keys once and number duplicates with groupby instead of
rescanning every preceding key per position, so the guardrail merge stays
O(n log n) on client-supplied tool lists. Drop the comment that restated the
unsupported-tool warning in the Responses-to-chat transformation.
2026-09-02 12:57:01 -07:00
mateo-berri
53a3d74b92 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_presidio_sibling_callback_leak 2026-09-02 12:55:37 -07:00
Yuneng Jiang
3d0223b661 ci: install the mongodb extra for the unit test shard that runs the provider
tests/test_litellm/llms/mongodb imports pymongo's exception classes to check the
error translation against the real hierarchy, and the shard that runs it
(tests/test_litellm/llms, per test-unit.yml) synced --extra google, proxy,
semantic-router and saml but not mongodb, so 24 of 109 tests would have errored
with ModuleNotFoundError on the first CI run. CircleCI hid this because it syncs
--all-groups --all-extras.

  uv export --frozen ... --extra saml                  -> no pymongo
  uv export --frozen ... --extra saml --extra mongodb  -> pymongo==4.17.0

Also close the two gaps a mutation run found in the suite: nothing asserted that
a short request timeout shortens server selection as well as connect, and the
existing code 13 case carried "not authorized", which the message markers match
too, so it could not tell whether the code was still being checked. 28 of 28
mutants now die.
2026-09-02 12:51:19 -07:00
Mateo Wang
d2fe8af276
Merge pull request #39365 from BerriAI/litellm_fix_v2_resolver_migrate_deploy_timeout
fix(proxy-extras): give prisma migrate deploy its own timeout budget
2026-09-02 12:48:54 -07:00
mateo-berri
cffa202bbf fix(guardrails): keep the resynced event_hook in the plain-string shape the constructor stores
update_in_memory_litellm_params validated mode into GuardrailEventHooks members while __init__ stores the plain strings LitellmParams.mode carries, so readers that stringify event_hook (akto, straiker) saw different values on the serving worker than on re-initialized workers. Presidio forced post_call assignments go through the same shape, and Straiker recomputes configured_modes on every update
2026-09-02 12:48:47 -07:00
devin-ai-integration[bot]
987ab76921
fix(proxy): share per-model budget counters across replicas through the spend counter cache (#39375)
* fix(proxy): share per-model budget counters across replicas through the spend counter cache

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

* test(proxy): keep the shared fake Redis store immutable

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-02 12:40:59 -07:00
mateo
7a8226e752 fix(model_prices): registry audit 2026-09-02, add claude-mythos-5-1 and gpt-daybreak aliases, fix gpt-5.5 Fast and W&B pricing
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-02 19:40:53 +00:00
devin-ai-integration[bot]
cde9d94c36
feat(agentcore-a2a): derive runtime session id from A2A message.contextId (#39371)
Native AgentCore A2A always sent either a fresh generated runtime session id
or the single configured runtimeSessionId, so related turns lost context and
unrelated callers shared one AgentCore microVM. The runtime session id is now
params.message.contextId scoped to the calling key hash, then runtimeSessionId,
then generated, and is length-validated (33-256) before the header is signed.
Invalid ids surface as JSON-RPC -32602 / HTTP 400 instead of a 500.

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-02 12:40:24 -07:00
mateo-berri
034ff58558 test(otel): assert Langfuse logger behavior instead of its class 2026-09-02 12:36:32 -07:00
mateo-berri
3af19cbf61 test(proxy-extras): use the modern optional annotation in the deploy budget test 2026-09-02 12:36:29 -07:00
mateo-berri
9bd870d47a fix(databricks): upgrade legacy thinking to adaptive on adaptive-only Claude models 2026-09-02 12:36:28 -07:00
Yujong Lee
90eadac409
test(build): keep wheel checks outside package 2026-09-02 12:16:25 -07:00
Yujong Lee
814204e21f
fix(rust): satisfy native wheel verifier lint 2026-09-02 12:16:25 -07:00
Yujong Lee
ce0c85ea69
refactor(rust): colocate native wheel contract checks 2026-09-02 12:16:25 -07:00
Yujong Lee
38150dfc2c
fix(ci): pin workflow toolchain dependencies 2026-09-02 12:16:25 -07:00
Yujong Lee
e6a317e079
fix(ci): enforce release wheel metadata contract 2026-09-02 12:16:25 -07:00
mateo-berri
c83b4a1d19 fix(proxy-extras): honor a raised command timeout for migrate deploy and name the right knob on db push timeouts 2026-09-02 12:10:54 -07:00
Devin AI
4a09c35d94 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_containers_route_model_list_creds 2026-09-02 19:10:45 +00:00
mateo-berri
01b20b78c0 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_lit_6342_claude_subagent_router 2026-09-02 12:10:37 -07:00
Yuneng Jiang
517e508700 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_/mongodb-vector-store-e4ff63
# Conflicts:
#	uv.lock
2026-09-02 12:10:20 -07:00
Yuneng Jiang
fdbee3af25 refactor(vector_stores): build the MongoDB pipeline immutably and inject the client class
The type-discipline and test-quality gates blamed the branch for 4 LIT001, 12
LIT002 and 5 TQ008 violations. Rather than suppress them:

- the $vectorSearch and $project stages are MappingProxyType and the query
  vector a tuple, verified against live Atlas to encode identically. The outer
  pipeline stays a list because pymongo's common.validate_list raises
  "pipeline must be a list, not <class 'tuple'>", which a unit test now pins.
- the client caches are Final[dict[...]] and _client_kwargs returns a
  MappingProxyType.
- _field_value recurses over the dotted path instead of rebinding a local.
- _client_key declared Final locals in one branch and reassigned them in the
  others, so it is split into an early-returning _timeout_ms.
- the injected callables carry explicit Final[Callable[...]] annotations, which
  stops pyright resolving self.embedding_fn against litellm.embedding's
  overloads.
- get_sync_client and get_async_client take an optional client_class, so the
  cache tests inject a recording double instead of patching the importer, and
  can assert the connection string and timeouts the client was built with.

SensitiveDataMasker is public SDK surface, so extra_sensitive_patterns moves to
the end of the signature: in slot two it silently reinterpreted an existing
caller's positional override set as extra sensitive patterns.
2026-09-02 12:09:51 -07:00
Ali Ahmed
a677242d6f
fix(headroom): stop re-compressing retrieved CCR content in client tool loops (#38591)
When the headroom_retrieve tool is exposed to a client that runs its own
tool-execution loop (the LiteLLM MCP gateway path), the client executes the
retrieve call and sends the recovered original content back as a tool result
on the next turn. The guardrail then compressed that row again, and because
CCR is content-addressed it collapsed back to the exact same hash it was just
retrieved from. The model never saw the expansion and the agent looped.

Hold tool-result rows that carry headroom_retrieve output back from the
compression service, the same way the live turn and trailing tool exchange are
already protected, so the expansion survives. Retrieve calls are matched by the
direct headroom_retrieve name and the mcp__<server>__headroom_retrieve gateway
name. Because a long gateway name is truncated past 64 chars in the
OpenAI-translated view the guardrail scans, the pairing also falls back to the
tool-call id read from the request's own untranslated messages, which is never
truncated.

Fixes #38558
2026-09-02 12:07:13 -07:00
mateo-berri
25bb8c92e3 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_mistral_voxtral_tts_speech 2026-09-02 12:06:17 -07:00
mateo-berri
cc2cbb36f3 fix(otel): stamp Langfuse root observation input and output from the request task 2026-09-02 11:57:45 -07:00
mateo-berri
70fbf7f4a3 Merge branch 'litellm_internal_staging' of https://github.com/BerriAI/litellm into litellm_fix_guardrail_event_hook_resync
# Conflicts:
#	tests/test_litellm/integrations/test_custom_guardrail.py
2026-09-02 11:57:22 -07:00
mateo-berri
49c69c46b2 fix(bedrock): drop the OpenAI base suffix from BEDROCK_MANTLE_API_BASE before the mantle messages path 2026-09-02 11:51:27 -07:00