Commit graph

808 commits

Author SHA1 Message Date
Mateo Wang
d8267d507d
Merge pull request #41956 from BerriAI/litellm_explicit_cache_injection_points_survive_client_marks
fix: apply configured cache_control_injection_points beside client cache_control marks
2026-09-21 12:28:02 -07:00
mateo-berri
f567fe230e fix: reserve cap slots for direct marks on /v1/messages when extra_body unmarks them 2026-09-21 11:39:25 -07:00
yuneng
b2ae0151e7 chore: merge main into litellm_migrate_tests_p1 2026-09-20 12:54:53 +00:00
yuneng
03a650c8a9 test: migrate wave 1 phase 1 legacy tests to tests/unit
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 09:17:57 +00:00
yuneng
522c3e3ed6 test: migrate wave 1 phase 2 legacy unit tests to tests/unit
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 07:50:43 +00:00
mateo-berri
827d1c99a0 test: type the cache hook test helpers
Some checks failed
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
2026-09-19 18:48:39 -07:00
mateo-berri
2c3fc4cbff test: drop narrating docstrings and wrap long lines in the cache hook tests 2026-09-19 18:34:23 -07:00
mateo-berri
b0971ee0ba fix: count extra_body tools and cache_control in place of the direct ones 2026-09-19 18:22:41 -07:00
yucheng-berri
2ec5c2c7cd
Merge pull request #41740 from BerriAI/litellm_otel_v2_langfuse_llm_spans_only
feat(otel v2): opt-in llm_only span scope for Langfuse destinations and the operator Langfuse exporter
2026-09-19 17:24:50 -07:00
mateo-berri
9573fd4161 Merge remote-tracking branch 'origin/main' into litellm_explicit_cache_injection_points_survive_client_marks
Main's #41920 scoped the automatic breakpoints to supported Claude transports and
taught the client-mark check to read the extra_body envelope. Both changes are kept:
the defaults still stand down on any client mark, extra_body included. Configured
injection points keep applying beside client marks, and the cap census now counts
extra_body marks too, so a configured point never lands as a fifth block.
test_new_transports_preserve_client_controls now expects configured points to apply
beside client marks instead of standing down
2026-09-19 17:01:16 -07:00
yucheng
358e4ea27a fix(otel v2): stop langfuse_span_scope tripping the family guard, normalize its spelling, and keep tenant routes on the full scope
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 22:00:02 +00:00
yucheng-berri
ac281507fd
Merge pull request #41991 from BerriAI/litellm_otel_v2_langfuse_responses_output
fix(otel v2): map Responses API output onto the Langfuse generation output
2026-09-19 14:23:59 -07:00
yucheng
7d93821e41 fix(otel v2): keep Responses refusal text on the folded assistant message
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 19:30:57 +00:00
yucheng-berri
4301ac4940
Merge pull request #41986 from BerriAI/litellm_revert_post_call_guardrail_context
revert(guardrails): drop the scoped request conversation and tools from post-call scans (#41220)
2026-09-19 12:06:30 -07:00
joshua-berri
eda1faba14
Merge pull request #41718 from BerriAI/litellm_mcp_dependency_gate_7737
refactor(mcp): upgrade SDK2 while preserving legacy gateway behavior
2026-09-19 18:53:19 +00:00
yucheng
364d897545 fix(otel v2): map Responses API output onto the Langfuse generation output
Responses API calls build the generation output only from response["choices"],
which Responses payloads do not carry, so Langfuse rendered a blank output.
Fold output[] into one assistant choice (output_text parts concatenated,
function_call and custom_tool_call items as tool_calls) and derive the finish
reason from status when choices are absent. Custom tool call input is now
redacted alongside function call arguments under turn_off_message_logging.

Carries the behavior of #41604 by @moshemorad (issue #41591) onto current
main with typed conversion and single-message output.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 18:26:59 +00:00
tin-berri
77a4624f13
Merge pull request #41920 from BerriAI/litellm_claude_auto_cache_providers
fix(caching): scope automatic breakpoints to supported Claude transports
2026-09-19 12:54:30 -05:00
yucheng
537cdaf487 Revert "Merge pull request #41220 from BerriAI/litellm_post_call_guardrail_context"
This reverts commit e40b90bbfa, reversing
changes made to d8d5437f55.
2026-09-19 17:45:15 +00:00
yucheng
c4d6c3046e fix(otel v2): keep embedding observations typed as generation in Langfuse
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 17:38:20 +00:00
Tin Chi Lo
2b086dc7aa fix(caching): scope automatic breakpoints to supported Claude transports 2026-09-19 09:55:38 -07:00
yucheng
c5181f6178 fix(otel v2): summarize embedding vectors as Langfuse observation output
The v2 LLM span built its output only from response choices, so /v1/embeddings
rendered a Langfuse generation with input, usage and cost but a blank output.
Embedding calls now carry an EmbeddingOutput(count, dimensions) summary that the
Langfuse mapper serializes as the observation output, and they are exported with
the embedding observation type instead of generation. Chat and Responses output
mapping is unchanged.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 16:52:25 +00:00
Joshua Valluru
fb56a14cd4 chore(mcp): merge main with unit test timeout safeguards 2026-09-19 09:42:08 -07:00
mateo-berri
7520925924 fix: forward a tool_config point only while the cap has a slot left 2026-09-19 06:28:16 -07:00
mateo-berri
171b33abfe fix: leave tool-search tool marks out of the chat-path cache breakpoint census 2026-09-19 04:53:15 -07:00
mateo-berri
ec59078ad9 fix: apply configured cache_control_injection_points beside client cache_control marks
Configured injection points were dropped whenever the request already
carried a client-set cache_control anywhere, so an operator's rolling
tail checkpoint silently never landed once a caller marked its own
system prompt. Only the automatic defaults stand down now. Configured
points skip a target the client already marked and stay under the
provider's 4-block cap, counting the client's marks on messages, system,
tools and the root cache_control first. The chat path carries the tool
count as a stamp on the points because the prompt-management hook never
receives tools.

Fixes #40675
2026-09-19 04:17:38 -07:00
mateo-berri
e0ebcb79fc Merge remote-tracking branch 'origin/main' into litellm_budget_alert_wording 2026-09-19 02:12:42 -07:00
Joshua Valluru
f5ab563499 fix(mcp): preserve session expiry signals and scope dependency CI 2026-09-18 22:52:10 -07:00
Joshua Valluru
aea13ee03b fix(mcp): preserve legacy behavior on SDK2 and streamline verification 2026-09-18 22:28:31 -07:00
mateo-berri
12f831e863 Merge origin/main into feat/websearch-multi-query-schema
Resolves handler.py against main's SearchOutcome refactor: the file is
main's version plus this PR's substantive hunks only (the RichWebSearchInput
import, the rich= wiring at the three _execute_search call sites, the
_rich_search_input and _provider_supports_rich_search helpers, and the
_execute_search forwarding), so the 88-column re-wrap noise the PR carried
is gone and the diff against main is the feature alone. RichWebSearchInput
sits beside main's new SearchSucceeded/SearchFailed types, and main's two
_execute_search test stubs accept the new rich argument.
2026-09-18 22:15:35 -07:00
Mateo Wang
29bdd1ab47
Merge pull request #41905 from BerriAI/litellm_websearch_failed_search_error_block
fix(websearch_interception): surface a failed search as a web_search_tool_result_error block and end the turn
2026-09-18 18:34:11 -07:00
joshua
a873ead5d3 test(mcp): read SDK2 snake_case fields on CallToolResult
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 00:36:03 +00:00
yucheng
95c1d5b0a6 feat(otel v2): name and re-root the kept generation under llm_only, widening to the account's widest scope
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 00:33:46 +00:00
mateo-berri
cdc0e57e93 fix(websearch_interception): surface a failed search as a web_search_tool_result_error block and end the turn 2026-09-18 17:24:52 -07:00
yucheng-berri
8e93031c19
Merge pull request #41786 from BerriAI/litellm_passthrough_xpass_trace
Pass-through requests inject the proxy span into upstream headers since #40669, which
replaced an explicit x-pass-traceparent with an unrelated trace and dropped its
x-pass-tracestate. Keep the caller's context when the carrier already names a
different trace, and keep the proxy child span for same-trace or missing headers.

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-18 16:07:28 -07:00
yassin
b10944ef1d Merge remote-tracking branch 'origin/main' into litellm_lazy_fastapi_bpe_imports 2026-09-18 08:56:21 +00:00
yucheng
c5cf32b49d test(otel v2): drop the explanatory docstrings from the span scope tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-18 08:50:10 +00:00
yucheng
318b027782 fix(otel): keep caller traceparent and tracestate on pass-through relays
Pass-through requests inject the proxy span into upstream headers since #40669, which
replaced an explicit x-pass-traceparent with an unrelated trace and dropped its
x-pass-tracestate. Keep the caller's context when the carrier already names a
different trace, and keep the proxy child span for same-trace or missing headers.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-18 08:26:39 +00:00
yucheng
1ccbc51ed8 test(otel v2): clear the cached LITELLM_OTEL_V2 flag after each destination test so it stops leaking into later modules
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-18 08:25:54 +00:00
yucheng
d264cdf231 fix(otel v2): record the wider scope when two operator exporters write one account
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-18 08:04:49 +00:00
yucheng
755890b59a fix(otel v2): scope-aware additive dedupe, reject langfuse_span_scope off langfuse_otel, render the scope as a select
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-18 07:53:32 +00:00
kerry
7975987107 test: keep behavior tests that read the cost map for a later fixture rewrite
Fifty six of the deleted tests turn out to assert the output of litellm code rather than the catalog lookup itself, things like map_openai_params, get_supported_openai_params, should_fake_stream, transform_request bodies, cost_per_token arithmetic, get_llm_provider routing, and provider config dispatch. They only happen to read shipped entries as inputs, so they belong in the later rewrite that injects a local model_cost, not in this deletion

Each one is restored verbatim from origin/main along with the fixtures, helpers, constants and imports it needs, and tests/test_litellm/test_sambanova_model_metadata.py is restored wholesale

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-18 04:52:06 +00:00
kerry
d2ac51893b test: keep the pinning-test removal free of unrelated reformatting
Regenerated every touched file from origin/main applying only the B1 test deletions and the unused import and helper cleanup they leave behind, without running the formatter across untouched code. CI only checks ruff format under litellm/, so the earlier reflows of test files were pure diff noise for reviewers

Also drops the tests/local_testing/test_prompt_caching.py entry from the caching-local shard in test-unit.yml since that file is deleted

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-18 04:27:28 +00:00
kerry
8ecbf3dbc1 test: drop tests that pin provider-owned cost map values
The repo rule is that a test must only fail when litellm code changes, never when a vendor updates a price, renames a field, or drops a model. These tests asserted shipped catalog entries directly, comparing lookup results to literals copied from model_prices_and_context_window.json or requiring named entries to exist or be absent, so every cost map sync could break them without any litellm code changing

Tests that exercise real litellm behavior with an injected local model_cost, invariants like backup parity, and assertions on non-lookup code paths are untouched

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-18 03:55:51 +00:00
yucheng
72e847288a feat(otel v2): opt-in llm_only span scope for Langfuse destinations and the operator Langfuse exporter
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-18 02:47:29 +00:00
yassin
37091c2bc7 Merge remote-tracking branch 'origin/main' into litellm_lazy_fastapi_bpe_imports 2026-09-18 01:14:48 +00:00
Mateo Wang
9966d9d1a8
Merge pull request #41652 from BerriAI/litellm_remove_dead_langfuse_v1_path
refactor(langfuse): remove unreachable langfuse v1 logging path
2026-09-17 17:55:47 -07:00
mateo
8ab0d21c45 refactor(langfuse): remove unreachable langfuse v1 logging path
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 20:04:50 +00:00
Devin AI
25949a87ac test: cover deferred import branches
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 09:26:35 +00:00
yucheng
f89fb20709 test(prometheus): restore the full registry and build admission metrics fresh in the dashboard fixture
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 09:21:19 +00:00
yucheng
8ae2ebdfcf test(prometheus): reset the admission control metric owner in the dashboard consistency fixture
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 09:00:22 +00:00