Commit graph

48347 commits

Author SHA1 Message Date
kerry
9a721abf0d test(cost-map): clear LITELLM_LOCAL_MODEL_COST_MAP in register_model url test
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-09 03:50:49 +00:00
mateo-berri
8d040d89e6 fix(policy_engine): keep legacy hooks off streams their route cannot assemble and off guardrails with their own iterator hook
The streaming pipeline step only takes a post-call hook on routes whose
translation assembles the streamed response (chat completions, Responses,
Messages). On /v1/completions, the Gemini streamGenerateContent route, and
A2A streams the pipeline is skipped with the merge-base warning and the hook
runs on its own afterwards, instead of getting a None response while the
header says the guardrail ran. A guardrail that overrides
async_post_call_streaming_iterator_hook next to its post-call hook keeps its
native per-chunk path rather than running buffered through the adapter
2026-09-08 20:39:56 -07:00
mateo-berri
dd707da81c fix(bedrock): forward raw reasoning_effort to DeepSeek V3, drop it only for R1
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
2026-09-08 20:28:58 -07:00
mateo-berri
738896d776 Merge branch 'litellm_internal_staging' into litellm_fix_bedrock_deepseek_thinking_leak 2026-09-08 20:28:54 -07:00
mateo-berri
2bca7ff673 fix(anthropic): replay OpenAI encrypted reasoning byte for byte behind /v1/messages
Reasoning items the Responses API returned for a /v1/messages turn were rebuilt
from their summary text on every replay, so the prompt the model saw changed
between turns and the prompt cache never matched. The bridge now asks for
reasoning.encrypted_content, carries it in the thinking signature (or as a
redacted_thinking block when there is no summary), and replays it verbatim as
the reasoning item's encrypted_content. Anthropic replay paths drop those
tagged blocks so a cross-model resume never forwards OpenAI bytes to Anthropic
2026-09-08 20:27:14 -07:00
mateo-berri
b5d40bef2b fix(token_counter): bound offloaded token counts with a dedicated capacity limiter
Replace the thread semaphore around HuggingFace encodes with an anyio CapacityLimiter
applied at every offloaded count site through offload_token_count, so waiting counts no
longer hold slots in the shared 40-thread pool and inline counts on the event loop never
block on the bound. Rename TOKEN_COUNTER_MAX_CONCURRENT_HF_ENCODES to
TOKEN_COUNTER_MAX_CONCURRENT_COUNTS
2026-09-08 20:25:04 -07:00
mateo-berri
8e3052ff65 fix(azure_ai): honour global drop_params for image params MAI cannot serve
get_optional_params_image_gen only forwarded the per-call drop_params flag
to provider configs, so litellm_settings drop_params: true never dropped
the n the MAI generations endpoint ignores. The MAI edits config also
advertised and forwarded size, which that endpoint ignores. Non-numeric
and non-positive n now surface as a 400 instead of a 500 or a pass-through.
2026-09-08 20:20:57 -07:00
mateo-berri
c66ae07e3b fix(hosted_vllm): reject image edit params vLLM-Omni ignores 2026-09-08 20:11:01 -07:00
Mateo Wang
ee7c7e14f3
Merge pull request #40189 from BerriAI/litellm_lit_3157_azure_ai_catalog_models
fix(azure_ai): price seven Foundry catalog names and charge the model router fee once
2026-09-08 20:08:40 -07:00
mateo-berri
94f9230d13 fix(proxy): type the new pipeline tests and keep tag values out of the deferral warning
Every test this PR adds now annotates its fixture and parametrize
parameters. The submit-time warning for a tag-matched deferred policy
names only the policies, since a wildcard attachment pattern would let
caller-provided tag text reach the log.
2026-09-08 19:59:09 -07:00
kerry
4179f086e0 refactor(cost-map): share local-fallback and remote-accept paths
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-09 02:58:51 +00:00
tin-berri
902dd7b2b6
fix(mcp): log proxy tool dispatch exceptions (#40351) 2026-09-08 19:56:21 -07:00
kerry
536a85b429 fix(cost-map): keep register_model url fetch to a single attempt
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-09 02:48:17 +00:00
kerry
aa0a9ab3ea refactor(cost-map): drop initial_outcome flag from retry loop
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-09 02:29:56 +00:00
kerry
7d52832692 merge: litellm_internal_staging into litellm_cost_map_background_retries
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-09 02:17:30 +00:00
Mateo Wang
24ef3ec63b
Merge pull request #37781 from ZXT-zjbiliy/fix/build-base-response-empty-choices
fix(stream_chunk_builder): guard empty choices and missing role in build_base_response
2026-09-08 19:14:03 -07:00
mateo-berri
ddedb4867b fix: discard a streamed rewrite that drops or adds a tool call
A guardrail that removes or adds a tool call on an ended stream used to be
silently ignored: every handler substitutes the original list on a count
mismatch and the executor skipped its observer once the translation could
deliver rewrites. The executor now tracks the count change on the observer
and releases the original chunks with the discard warning on every
translation, matching what the merge base did for any tool call rewrite
2026-09-08 19:09:44 -07:00
Mateo Wang
f8e456d105
Merge pull request #40275 from BerriAI/litellm_lit6852_spend_attribution
fix(spend-tracking): recover key alias for session tokens from spend logs
2026-09-08 19:05:43 -07:00
kerry
0086b62b45 fix(cost-map): keep first fetch blocking, run retries in background
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-09 02:05:08 +00:00
Yuneng Jiang
1638473332
fix(bedrock): keep deletion response IDs in request context 2026-09-08 19:02:08 -07:00
tin-berri
1a9c6ce390
fix(mcp): preserve proxy logging and authorization coverage (#40337)
* test(mcp): exercise /mcp/proxy authorization against the real registry instead of patched manager methods

* fix(mcp): preserve proxy logging and authorization coverage

* test(mcp): respect the proxy FastAPI import boundary
2026-09-09 02:01:01 +00:00
yuneng-jiang
0d62970865
Merge pull request #40334 from BerriAI/litellm_/release-version-bump-787548
chore: bump litellm-enterprise 0.1.65 -> 0.1.66
2026-09-08 18:53:51 -07:00
mateo-berri
38a3de7641 fix(azure_ai): use the pixel cap the live MAI endpoint enforces 2026-09-08 18:46:18 -07:00
yuneng-jiang
86ee031217
Merge branch 'litellm_internal_staging' into litellm_/release-version-bump-787548 2026-09-08 18:44:54 -07:00
yuneng-jiang
1fbd1cb9ce
Merge pull request #40347 from BerriAI/litellm_fix_mcp_proxy_test_isolation
test(mcp): fix proxy fixture isolation after manager reload
2026-09-08 18:44:45 -07:00
Mateo Wang
d75aa4445d
Merge pull request #40179 from BerriAI/litellm_lit_2133_cost_map_provenance
feat(cost_map): report which revision of the price map the proxy is serving
2026-09-08 18:42:19 -07:00
Yuneng Jiang
f17632c036
chore: sync batch tests with latest staging 2026-09-08 18:36:15 -07:00
Yuneng Jiang
fb21852f7b
test(mcp): resolve current manager in proxy fixtures 2026-09-08 18:35:25 -07:00
tin-berri
314e573529
feat(auto-router): refresh family reasoning presets (#40341) 2026-09-08 18:28:46 -07:00
mateo-berri
84a99dfc31 fix(azure_ai): surface rejected MAI image params as 400 and drop comments 2026-09-08 18:24:51 -07:00
ryan-crabbe-berri
f5e4aa38ba
Merge pull request #40342 from BerriAI/litellm_prompt_cache_key_session_id
fix(anthropic): key the /v1/messages prompt cache on Claude Code's session_id only
2026-09-08 18:20:56 -07:00
ryan-crabbe-berri
634852a183 fix(anthropic): key the /v1/messages prompt cache on Claude Code's session_id only
The bridges derived prompt_cache_key as the first 64 chars of metadata.user_id.
Claude Code packs a JSON object into that field whose prefix is the per-install
device_id, so every session and subagent on one machine shared a single key,
and a plain end-user id pinned all of that user's conversations to one slot.

Parse the JSON and use session_id; send no key otherwise so the provider falls
back to its own prompt-prefix hashing. An explicit prompt_cache_key still wins.

Fixes #39145
2026-09-08 18:06:39 -07:00
yuneng-jiang
a99ecacffd
Merge pull request #40336 from BerriAI/litellm_extend_diskcache_deadline_oct1
chore(ci): extend diskcache scan exception to October 1
2026-09-08 18:05:00 -07:00
devin-ai-integration[bot]
43a1b2992a
fix(otel v2): restore the Datadog auth span and the last-wins callback merge (#40335)
* fix(otel v2): restore the Datadog auth span and the last-wins callback merge

Move @tracer.wrap() back onto user_api_key_auth so USE_DDTRACE=true emits the
auth span again, and let a failure entry's callback_vars take part in the
destination merge so the resolver picks the same account the runtime parser does

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

* test(otel v2): drop docstrings from the two regression tests

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

* ci: rerun proxy-infra after the flaky test_check_migration process-tree test

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-09 01:00:26 +00:00
yuneng-jiang
9b186680c4
Merge branch 'litellm_internal_staging' into litellm_extend_diskcache_deadline_oct1 2026-09-08 17:55:38 -07:00
Yuneng Jiang
24ee66328a
test: bound Datadog read-back retries using reset headers 2026-09-08 17:55:21 -07:00
yuneng-jiang
c417e1084d
Merge branch 'litellm_internal_staging' into litellm_/release-version-bump-787548 2026-09-08 17:54:07 -07:00
yuneng-jiang
fb36c3c5a5
Merge pull request #40333 from BerriAI/litellm_fix_prisma_timeout_test_cleanup
test(proxy): fix Prisma timeout cleanup after subreaper tests
2026-09-08 17:53:56 -07:00
mateo-berri
529b8706ee test(spend-tracking): mock the spend-log scan through the transaction its caller now opens 2026-09-08 17:51:13 -07:00
mateo-berri
1133507565 refactor: type the buffered stream rewrite helpers without Any 2026-09-08 17:46:55 -07:00
Yuneng Jiang
810d48f28f
chore(ci): extend diskcache scan exception to October 1 2026-09-08 17:41:27 -07:00
Yuneng Jiang
94a81f003e
bump: litellm-enterprise 0.1.65 -> 0.1.66 2026-09-08 17:40:34 -07:00
mateo-berri
c6a0381595 fix(token_counter): bound concurrent HuggingFace encodes so a burst of large counts cannot exhaust memory 2026-09-08 17:38:01 -07:00
Yuneng Jiang
5a7919f3f5
test(proxy): isolate reaper state and reap Prisma fixture children 2026-09-08 17:35:43 -07:00
tin-berri
754a2afe12
feat(mcp): add schema discovery proxy mode (#40298) 2026-09-09 00:30:20 +00:00
Mateo Wang
599daea985
Merge pull request #36718 from BerriAI/litellm_fix_count_tokens_budget_reservation_leak
fix(budget_reservation): don't reserve budget on token counting routes
2026-09-08 17:29:27 -07:00
mateo-berri
359c26aa1d test(policy_engine): cover the legacy stream paths with no response and no rescan
A translation that hands the hook no assembled response leaves the stream
as it is, and a rewrite the translation cannot rescan is released as the
original stream with a warning.
2026-09-08 17:27:46 -07:00
moe-berri
6112274350
Merge pull request #40273 from BerriAI/litellm_non_reasoning_tier
feat(auto_router): opt-in NON_REASONING tier below SIMPLE
2026-09-08 17:27:35 -07:00
mateo-berri
268b944081 fix(spend-tracking): bound the spend-log scan with a statement timeout and name only unanimous alias, team, and owner 2026-09-08 17:24:22 -07:00
mateo-berri
5ea447e295 fix(azure): keep the model group segment exact and casefold only deployment names in the relay guard
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
2026-09-08 17:19:23 -07:00